Tutorial: Create indicator with Cursor IDE
This tutorial will guide you through the process of creating a new indicator using Cursor IDE.
Last updated
This tutorial will guide you through the process of creating a new indicator using Cursor IDE.
Last updated
Cursor IDE is a fork of VS Code that has powerful AI capabilities, allowing it to access your code directly and have information about your project.
Cursor can also be provided with FTO custom indicator documentation to assist in creating new indicators.
How to install Cursor and set up the project is described in guide. If you don’t yet know how to set up your environment to work with the FTO API for indicators, that is also covered in the same guide.
The feature in Cursor IDE allows users to define custom guidelines or behaviors that the AI should follow when generating code. By setting up rules that describe how indicators work in FTO, you can effectively teach Cursor the context it needs to produce accurate and consistent indicators.
To set up global rules for Cursor, click the setting icon (Picture #1)
From here, click the Rules setting (Picture #2)
In the User Rules field (Picture #3), download and paste contents of the file below called Rules.txt
You can upload the FTO indicator documentation to Cursor, and Cursor will be able to use it to help you create new indicators.
To upload the FTO indicator documentation to Cursor, you need to follow these steps:
1. Click the setting icon in the top right corner of the Cursor IDE. (Picture #4)
2. Select "Features" on the left sidebar (Picture #5).
Scroll down until you see Docs (Picture #6)
Click on the "Add new doc" button and insert link https://fto-2.gitbook.io/fto-indicators-docs to the FTO indicator documentation (Picture #7).
After some indexing, Cursor will be able to refer to the documentation to help you create new indicators.
To open Cursors AI window, you can press Ctrl+L
or click on the icon in the top right corner of the Cursor IDE (Picture #8)
This panel has a chat interface and in Cursor version 0.47.8 it has 3 modes, Agent, Ask and Edit,
each catering to different needs during development (Picture #9).
Agent Mode: This mode allows for automated code generation and completion by interacting with the AI. It helps streamline the coding process by providing intelligent suggestions and solutions. I access your project files directly and suggests code which you can accept or reject
Ask Mode: In this mode, developers can ask questions about their codebase, programming concepts, or any development-related topics. The AI will respond with helpful guidance and explanations.
Edit Mode: Edit Mode assists in making modifications to the existing code. It aids in refactoring, simplifying, or improving code sections as needed.
What makes these modes powerful is the ability to add context directly from your project or documentation
For now, select the Ask mode
Next to the "select mode menu" there is also an option to select a model of AI that we want to use, for now we should choose Auto-select (Picture#10).
In the result, we got code below
The current logic seems correct, but it's using only the Close price, and there is currently no way for the user to specify their own price type. Let's ask it to fix that (Picture #12).
The code that Cursor wrote in his second response is below
And with the addition of this new parameter and internal method, we get a nice dropdown with price types (Picture #13).
Start by selecting the Ask mode and add context to your query by typing @ and selecting Docs from the drop-down menu (Picture #14).
And provide add a file in which you want to create the indicator, you can do it by drag and dropping it from explorer window on the left onto the chat window or finding it in the @ drop-down menu under Files & folders (Picture #16)
To become more familiar with how to use this added documentation in your requests to Cursor, go to the section below.
Before we begin writing the indicator, it is expected that you are familiar with how to set up the environment to access the FTO Indicator API. If not, please read guide first before continuing.
For this example, we will ask Cursor to implement the On Balance Volume (OBV) indicator for us. In this guide, we will start with an empty file, but for future indicator implementations, you can use some of our indicator foundations provided in .
In the request to create the OBV indicator for us, I included the FTO documentation for and added the discussed earlier. In the screenshot, you can see the sections of the documentation it decided to use (Picture #11).
So in the end, we got a proper indicator with just two simple requests by setting up Cursor properly and providing it with and documentation for context.
For Cursor to use the documentation that we provided in we need to do the following:
In the drop-down menu, select FTO Indicator documentation, which we added earlier in (Picture#15)