Tutorial: Create strategy with Cursor IDE
This tutorial will guide you through the process of creating a new strategy using Cursor IDE.
Introduction
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 strategy documentation to assist in creating new strategies.
Please note that Cursor is a paid IDE, but it has a free version, the free version is limited to 50 requests and 2000 completions total.
Step 1: Install Cursor and set up the project
How to install Cursor and set up the project is described in this guide. If you donβt yet know how to set up your environment to work with the FTO API for strategies, that is also covered in the same guide.
Step 2: Apply Cursor Rules
The Rules 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 strategies work in FTO, you can effectively teach Cursor the context it needs to produce accurate and consistent strategies.
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.md

Step 3: Upload FTO strategy documentation to Cursor
You can upload the FTO Strategy documentation to Cursor, and Cursor will be able to use it to help you create new strategies.
To upload it, 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-strategies-docs to the FTO Strategy documentation (Picture #7).

After some indexing, Cursor will be able to refer to the documentation to help you create new strategies.
To become more familiar with how to use this added documentation in your requests to Cursor, go to the Recommendations section below.
Step 4: Getting familiar with Cursor
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.49.6 it has 3 modes, Agent, Ask and Manual,
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.
Manual Mode: is a mode that gives you more direct control over how AI helps with your code, so it lets you initiate and approve modifications.
What makes these modes powerful is the ability to add context directly from your project or documentation
For now, select the Agent 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).

Step 5: Start building
Before we begin writing the strategy, it is expected that you are familiar with how to set up the environment to access the FTO Strategy API. If not, please read this guide first before continuing.
For this example, we will ask Cursor to implement the Breakout Day High/Low strategy for us. In this guide, we will start with an empty file, but for future strategy implementations, you can use some of our foundations provided in this section.
In the request to create the Breakout strategy for us, I included the FTO documentation for context and added the Rules discussed earlier. Also, for simplicity's sake, I asked it not to include TP or SL in the orders. In the screenshot, you can see the sections of the documentation it decided to use (Picture #11).

In the result, we got code below
Since I used agent mode, the model iterated over the initial result several times to fix linter errors and other issues with the code, so in the end it was what i`ve asked for in one simple prompt
So in the end, we got a simple strategy with just one requests by setting up Cursor properly and providing it with Rules and documentation for context.
Recommendations
For Cursor to use the documentation that we provided in Step 3 we need to do the following:
Start by selecting the Agent mode and add context to your query by typing @ and selecting Docs from the drop-down menu. In the drop-down menu, select FTO Strategy documentation, which we added earlier in Step 3 (Picture#14)

And provide add a file in which you want to create the strategy, 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 #15)

Last updated