Debugging backtestings with visual studio
It would be amazing if we could debug Trading Systems and Indicators with Visual Studio taking profit of the great backtesting environment of AlgoStudio.
I realize that debugging with viusal studio is already possible in PTMC with current data, as showed in this video:
But I've been out of luck trying to do the same with AlgoStudio during a backtest.
This feature was discribed in the article "How to debug a trading strategy with Visual Studio"
-
dreyes 29.06.2016
I have been playing a little bit with this approach and it looks really powerful!. I think that having an IDE like Visual Studio for development and the AlgoStudio for backtesting and optimization is the perfect combination. You have the best of both worlds in your hands :).
I have been able to debug in Visual Studio an indicator, and even a robot running on the Trading System. But both were running on PTMC. I did only need to attach the Visual Studio project to the netclient.exe as stated in the video above. However, like the OP, I have not been able to attach my Visual Studio project to AlgoStudio.
Is it possible to do the same with algostudio.exe? I don't know if you did something special to the netclient.exe to allow debugging in Visual Studio... but... could you enable attaching to AlgoStudio process in the same way it is done for PTMC?
-
Bogdan Alexey 10.07.2016
Just tried to debug strategy written in Visual Studio and running in Algo without any problems. We will add article with full instructions this week, but in a few words you need to do next steps:
1. Run Visual studio. Create new dll project, add references: commons.dll and PLTRuntime.dll. Create class for your strategy, it should be inherited from NETStrategy. Override OnQuote method, set breakpoint. Compile your dll.2. Run algo, open dll created by Visual Studio.
3. Select Attach to process in Studio and run backtesting in Algo. It will stop on your breakpoint and now you can use all Visual Studio functionality for debugging.
-
Alejandrez Miguel 11.07.2016
Hi Alexey,
Thank you very much for your response.
I've tried the steps you mention without success Surely, I have done something wrong at some point, the article will be very much appreciated.
Regards,
Miguel
-
Bogdan Alexey 13.07.2016
Link for the article: https://protrader.org/articles/reviews/debug-tradin...