🐞Debugging and Testing a Strategy with Cursor

Learn how to debug and test your FTO strategies with Cursor — step by step, with screenshots, tips, and a bit of patience.

So, you’ve asked Cursor to write a strategy — now let’s see how to build, test, and debug it step by step.

Step 1: Write the Request

Open the Cursor chat and write your request.(see Picture #1)

Picture 1

Important: don’t forget to tag the documentation with “@” so Cursor has the context it needs. You can type @ from the keyboard or select it in the chat window.

If your rules are set on the project level instead of globally, make sure Apply = Always. (see Pictures #3 and #3)

Picture 2
Picture 3

Step 2: Let Cursor Build

Sometimes Cursor will suggest building the file automatically after editing. If you see that option, you can skip the manual terminal step and just hit Run right away (see Picture #4).

Picture 4

Saves you a few keystrokes — not bad!

If Cursor doesn’t offer an automatic build, no problem. Just:

  • Accept the generated code with Apply,

  • Then head to the terminal and run npm run build.

    (See Picture #5.)

Picture 5

Step 3: Test & Debug in FTO

Now comes the detective work — running your strategy and spotting what’s off.

3.1. Visual check (Picture #6)

  • Run your project in Forex Tester Online, upload the strategy, and hit Start testing.

  • Watch what happens on the chart.

    In our case, we immediately saw two problems:

    • The strategy opened two orders per day (even though we’d forbidden it).

    • It never opened any sell orders at all.

  • If you notice strange behavior, write it down. That’s your first clue something’s wrong.

Picture 6

3.2. Debug with DevTools

  • Open DevTools (F12 or Ctrl+Shift+I).

  • Switch to the Console tab.

  • To be sure the errors belong to your strategy (and not some background noise):

    • Pause the strategy,

    • Clear the console (Ø or Ctrl+L),

    • Run the strategy again.

  • If you see errors, take a screenshot of both the chart and console together (Picture #6).

3.3. Send feedback to Cursor (Picture #7)

  • Collect your notes + screenshots.

  • Send them back to Cursor with a short bug description.

  • The more context you provide, the faster Cursor can help you fix it.

Picture 7

Step 4: Apply Fixes

Wait for Cursor to process the bug report and generate a fix.

Apply the changes and rebuild with npm run build (see Picture #8).

Picture 8

Step 5: Test Again

Run the updated strategy in FTO.

  • The sell orders bug was fixed

  • But the strategy was still opening more than one order per day

  • Plus, it started to lag after the last fix.

So we report back to Cursor again with the new issue (see Picture #9).

Picture 9

Step 6: Iterate

Cursor suggests another fix.

Apply → build → test again (see Picture 10).

Picture 10

Step 7: Success!

Finally, after a couple of iterations, we see the strategy working as intended (see Picture #11).

Time to celebrate — you’ve just debugged your first AI-assisted trading strategy!

Picture 11

Wrapping It Up

Debugging with Cursor isn’t always a “one and done” story — and that’s perfectly normal.

Sometimes it takes a few rounds of edits, builds, and tests before your strategy behaves the way you want.

The good news? Each iteration gets you closer, and with Cursor doing the heavy lifting, fixing bugs is faster and less painful than going solo.

So don’t get discouraged — treat it as part of the process. In the end, you’ll not only have a working strategy but also a repeatable workflow for tackling the next one.

Last updated