Hi Dan, thanks for taking a look at the details. 🙂 It feels good seeing people digging deeper and challenging the code.
Honestly, I don’t understand the first line either. This is coming from the original by Pshai. The only thing I added was checking for isBacktest
because SetFee()
is applied in backtests only anyways and I thought it might speed up the backtest by a nano second if I check this first. If you would like to understand why setFee()
is used like this please approach Pshai, most preferrably on the Discord server in the #haasscript-bots channel. I am sure he has an answer to this…I just trusted him with this line of code but now that you’re asking I am interested as well.
Regarding if not isBacktest then CC_VPM3() end
I have a proper answer. 😀 It’s loading the Custom Command for Virtual Position Management by Kobalt but this is definitely not used in backtests why I also tried to save some time in backtests not loading it at all. I did some performance tests and it doesn’t save as much as I was hoping for but if you’re testing a large timeframe and some variations (HaasLabs) it definitely counts.
I hope this helps.
Cheers,
Shoe