Hi All,
I'm stuck with some variable that *sometimes*, not sure it's pair related, gets assigned a wrong value
The code is trying to find a horizontal line, if it does, it takes the price value of it and put it in a variable that later is used to calculate SL for my trade(s)
It works for GPUSD but fails on CADCHF, both have 5 decimal points on the price quote but while it's working for GPUSD, CADCHF shows this
The HL looks like this
I'm at a lost as to why this is happening, any help would be greatly appreciated
Thanks
I'm stuck with some variable that *sometimes*, not sure it's pair related, gets assigned a wrong value
The code is trying to find a horizontal line, if it does, it takes the price value of it and put it in a variable that later is used to calculate SL for my trade(s)
Inserted Code
int total;
string obj_name;
string SearchStringName="slStopper-"+ThisPeriod;
double stopperValue = 0;
total=ObjectsTotal();
for(int i=0;i<total;i++)
{
obj_name=ObjectName(i);
if(ObjectType(obj_name)==OBJ_HLINE && (StringFind(obj_name,SearchStringName,0)!=-1))
{
stopperValue=(NormalizeDouble(ObjectGet(obj_name, OBJPROP_PRICE1),Digits));
}
} It works for GPUSD but fails on CADCHF, both have 5 decimal points on the price quote but while it's working for GPUSD, CADCHF shows this
Inserted Code
stopperValue: 0.6497000000000001
I'm at a lost as to why this is happening, any help would be greatly appreciated
Thanks