SetProfitTarget("Long", CalculationMode.Ticks, 40);
works just fine of course, as the 40 above is an integer.
Replacing that integer with anything other than another direct numerical integer value yields random results, mostly 1 to 1/2 point targets.
I'm sure this can be simplified, but in the moment I have:
double bodySize = Math.Abs(Open[0] - Close[0]);
double bodySize1 = Math.Round(bodySize);
int Profit = System.Convert.ToInt32(bodySize1);
Trying
SetProfitTarget("Long", CalculationMode.Ticks, Position.AveragePrice + Profit); or
SetProfitTarget("Long", CalculationMode.Ticks, Profit);
still yields random results.
Obviously my conversion method is amiss?
Setting int Profit to a direct integer value, i.e. int Profit = 40; works just fine...
Thanx
JM
Comment