Thank you HelixTrader,
I’ve modified your example I think is working well (presented below).
As I understand, frequently injected cash is waiting till next buy signal.
Is there possibility to code proportionally increase of current positions (at the current price)?
SetCustomBacktestProc("");
qq = Month() != Ref(Month(), 1) AND (Month() == 3 OR Month() == 6 OR Month() == 9 OR Month() == 12);
Salary = 3000;
if( Status("action") == actionPortfolio ) {
bo = GetBacktesterObject();
bo.PreProcess();
for( bar = 0; bar < BarCount; bar++ ) {
bo.ProcessTradeSignals( bar );
// last day of the quarter
if (qq[ bar ] == 1 OR qq[ bar ] == -11 ) {
// current cash
currentCash = bo.Cash;
// add salary to your cash
bo.Cash = bo.Cash + Salary;
}
}
bo.PostProcess();
}
Thank you Tomasz.
Further step is to divide trading profits and interest earnings. I've created something based on dedicated article, although I would like to add adjusted CAR for trade profit only. Issue is I don't know how to call "Days In Test" variable?