Sorry newbie at work and need some advice.
I trying out my first EA and facing many error. Anyone can advice me on this issue first.
double AverageHL = HH - LL;
double p0272 = HH + (AverageHL*0.272);
OrderSend(Symbol(),OP_BUYSTOP,Lots,p0272,3,0,0,"",12321,0,Green);
I beening prompt that my entry with invalid number as it came out 8 decimal place. How should i set it to only 4 decimal place. I try using "DoubleToStr'" but still cannot, think i use wrongly. any advice. thanks
U need to use NormalizeDouble(). See example here -> MQL4 Reference -> Conversion functions -> NormalizeDouble
p.s. i recommend u use more descriptive variable names than something like p0272... but it's up to u.
dEntryPrice=NormalizeDouble(p0272,Digits);
Otherwise, show us the relevant section of code and we'll advise.
CB
You can not set a buyStop closer to Ask than MODE_STOPLEVEL
dEntryPrice=MathMax(NormalizeDouble(p0272,Digits), Ask+MarketInfo( Symbol(), MODE_STOPLEVEL )*Point);
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Sorry newbie at work and need some advice.
I trying out my first EA and facing many error. Anyone can advice me on this issue first.
double AverageHL = HH - LL;
double p0272 = HH + (AverageHL*0.272);
OrderSend(Symbol(),OP_BUYSTOP,Lots,p0272,3,0,0,"",12321,0,Green);
I beening prompt that my entry with invalid number as it came out 8 decimal place. How should i set it to only 4 decimal place. I try using "DoubleToStr'" but still cannot, think i use wrongly. any advice. thanks