I am trying to access the custom backtester interface to change the share size based on account value. But the code is off. I think sig.poshares is incorrect. Is there another term to call or set the shares in the backtester.
if (Status("action")==actionPortfolio)
{
bo=GetBacktesterObject();
bo.preprocess();
for(bar=0;bar<BarCount;bar++)
{Currentportfolioequity =bo.equity;
for(sig=bo.getfirstsignal(bar);sig;sig=bo.getnextsignal(bar))
{
if(Currentportfolioequity>20000)sig.poshares=4;
if(Currentportfolioequity<20000)sig.poshares=2;
}
bo.processtradesignals(bar);
}bo.postprocess();
}