Skip to content

Latest commit

 

History

History
45 lines (25 loc) · 2.9 KB

debugging-in-vs-2022.md

File metadata and controls

45 lines (25 loc) · 2.9 KB

Debugging in VS 2022

Video manual about debugging

{% embed url="https://www.youtube.com/watch?v=w_g4mbJ4G_4" %}

Debugging setup

In order to begin debugging, it is necessary to have both a running Quantower terminal and an open strategy project in Visual Studio. Prior to starting, debugging must be configured by accessing the Quantower Algo settings in the VS Tools menu and navigating to the Algo tab within the Quantower terminal general settings screen.

Quantower Algo settings in Studio (left) and Algo settings in Quantower terminal (right)

To connect Visual Studio with Quantower Algo, we need to enable the "Allow connection from Visual Studio" option in the terminal settings and ensure that the connection port matches the one in the Quantower Algo settings.

{% hint style="info" %} Enabling this option might trigger a firewall or antivirus warning, which you should allow to establish the connection. {% endhint %}

Start debugging

  1. Press the Debug mode launch button and wait for Visual Studio to establish the debugging environment. One of the critical elements of this environment is a specialized console process (black background application) that connects your code editor and Quantower terminal.

Debug mode launch button

{% hint style="info" %} In case you haven't opened the Backtest & Optimize panel yet, Quantower will remind you to do so and select your strategy. {% endhint %}

  1. Configure the backtesting environment and locate the "Start in debug mode" button at the bottom of the sidebar. Click on this button to begin debugging your strategy.

Start in debug mode button

  1. Locate the specific line in your Visual Studio editor where the algorithm needs to be paused and set a breakpoint there.

Visual Studio Community 2022 editor with an active Breakpoint halt

Stop debugging

To exit Debug mode, simply click on the Stop button - a red square icon located to the right of the Continue button on the Visual Studio debug toolbar. This will close the binding console process and disconnect Visual Studio from the Quantower terminal.

Stop the Debugging mode in Visual Studio