Hi @globalarbtrader hope you're well! I have recently read your Systematic Trading (was a great introductory read to the world of systematic trading btw) and now I am trying to get familiar with pysystemtrade to understand how the program actually runs. Naturally, to achieve this I am trying to debug the system in prebakedsystems.py (the code I am running is shown below, everything else has been commented out) so I can understand what the flow of the program is.
I have set breakpoints on all lines of code above and I have also set breakpoints within the system.accounts.portfolio() method. I have also set breakpoints at some key points in the code that I know for sure must be getting hit e.g. within forecastScaleCap.get_capped_forecast() method. However, when I launch my debugger (the launch.json configuration for which is shown below) only the breakpoints in the prebakedsystems.py are hit, none of the other breakpoints further downstream get hit. When I try to step into the system.accounts.portfolio() method it just stays in the prebakedsystems.py file.
Launch.json configuration:
Can anyone advise me on what I'm doing wrong and how to fix this issue? Apologies if this is a basic question but would appreciate any help on this
Thanks in advance,
Darshil
Code:
from systems.provided.futures_chapter15.estimatedsystem import futures_system
system = futures_system()
instrument_list = system.combForecast.parent.get_instrument_list()
result = system.accounts.portfolio().sharpe()
print(result)
I have set breakpoints on all lines of code above and I have also set breakpoints within the system.accounts.portfolio() method. I have also set breakpoints at some key points in the code that I know for sure must be getting hit e.g. within forecastScaleCap.get_capped_forecast() method. However, when I launch my debugger (the launch.json configuration for which is shown below) only the breakpoints in the prebakedsystems.py are hit, none of the other breakpoints further downstream get hit. When I try to step into the system.accounts.portfolio() method it just stays in the prebakedsystems.py file.
Launch.json configuration:
Code:
{
"name": "pysystemtrade",
"type": "python",
"request": "launch",
"program": "/Users/darshildholakia/Documents/pysystemtrade/examples/introduction/prebakedsystems.py",
"justMyCode": true,
"subProcess": true,
},
Can anyone advise me on what I'm doing wrong and how to fix this issue? Apologies if this is a basic question but would appreciate any help on this

Thanks in advance,
Darshil
Last edited: