Hello guys, I've looked everywhere for an answer to this and couldn't find a satisfactory solution.
I am testing a simple rotational system that buys the top 5 signals based on ROC. Below is a sample of the code:
EnableRotationalTrading();
MaxPositions = 5;
SetOption("MaxOpenPositions", MaxPositions);
SetOption("WorstRankHeld", MaxPositions);
SetOption("AllowPositionShrinking", 1);
PositionSize = -(100 / MaxPositions);
PositionScore = (1000 + SymbolROC)
As you can see it's pretty straight forward. The problem: At a certain point in the backtest, the top raking asset is a very expensive stock and it is not possible to buy a round lot size of it (100) with the available cash. The log bellow shows how the first signal errors because it needs 27k available cash but only 9k is available.
29/06/2018
Scores:MDGL=1427.632, TNDM=1425.468, I=1400, BXC=1328.194, EGAN=1260.563, SRNE=1248.889,
MDGL not entered because of insufficient funds or wrong position size/value (reqEntryPrice: 270, reqEntryPosSize: 20% of equity (value = 9200.136), reqLotSize: 100)
0 Open Positions: , Market Value: 0.00, Equity: 46000.68, Cash: 46000.68, Margin: 0.00, Net Cash Balance: 46000.68,
Is there any way to ignore this error and enter the next 4 trades?
Thank you very much!