A few have decided to increase leverage to exploit the Pattern Day Trader margin.
Please check your code to ensure you have not defaulted margin to a lower level, specifically:
No margin : SetOption(“AccountMargin”,100);
Over night margin: SetOption(“AccountMargin”,50);
Pattern margin: SetOption(“AccountMargin”,25);
Alternate solutions:
Set the margin amount as a parameter variable
or
Remove that line of code and manage margin through backtester settings