Hi,

First time posting here, so please be gentle. 😊

I am trying to use Lean CLI for python using VS Code. But the debugger does not stop at the breakpoint. 

I went through various help articles and documentations, and also tried searching through google but still could not find the solution. It works fine if one has simple boilerplate example. 

I went here to look for information but could not resolve it

here is an example code that I am using 

  1. from AlgorithmImports import *
  2. class GeekyTanCat(QCAlgorithm):
  3. def Initialize(self):
  4. self.SetStartDate(2021, 6, 24)
  5. self.SetCash(100000)
  6. self.Schedule.On(self.DateRules.EveryDay(), self.TimeRules.At(16, 1), self.TradingAfterMarketClose)
  7. self.AddEquity("SPY")
  8. def OnData(self, data):
  9. self.Debug("In OnData Function")
  10. pass
  11. def TradingAfterMarketClose(self):
  12. self.Debug("In TradingAfterMarketClose Function")
  13. pass
+ Expand

I am trying to stop the debugger at “self.Debug …” but it never stops, neither it gives me any error for me to resolve it.

I would highly request somebody to make a You tube video on a somewhat complex tutorial. The one here does not tell much

(13) Debugging Python Algorithmic Trading Strategies in VSCode - LEAN CLI - YouTube

Please let me know if this is not the right place to post it, I would post it at the right place.

Thank you,

Avi

Author

Avi Dix

July 2021