1. Using pmms_strategy_set_entry_contract (see code below) only works starting from the second trade onwards, for each symbol. At the first trade of a certain symbol the trade size is determined according to the properties of the specific strategy. Shouldn't it work starting from the first trade?
2. In the code below I used 10 contracts for testing purposes. I want however to set the trade size using a calculation that needs to know the price of the instrument. For example, with a capital of $10,000 and 5 positions, I will allocate $2,000 per each and then divide that by the instrument price to get to the required trade size. How do I access that figure?
Code: Select all
var: curPos(0), curStrategyIndex(0), positions(0);
array: strategyIndexes[](0);
positions = pmms_strategies_in_positions_count(strategyIndexes);
for curPos = 0 to array_getmaxindex(strategyIndexes)
begin
curStrategyIndex = strategyIndexes[curPos];
pmms_strategy_set_entry_contracts(curStrategyIndex,10);
end;