I´ve created a double to calculate the right amount of contracts for the entry order.
double KontrakteLong = Math.Round(MaxRisk/RiskTicksLong*Tickwert);
MaxRisk is the maximum Risk (in Euro, Dollar, ...)
RiskTicksLong is the amount of ticks between entry and stop order.
Tickwert is the tick value.
The entry order: EnterLongLimit(KontrakteLong, Close[0], ""); requires an integer, instead of KontrakteLong, so compiling was not successful.
So i`ve tried to convert the double to an integer:
int PositionsgroesseLong = (int) (KontrakteLong);
After this, compiling was successful, but in every backtest the strategy still trades 1 contract.
Hope you can help me.
Best Regards
Comment