Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 260

 
mt1002:

A hint I'm drawing an object:

ObjectCreate(0, "good_"+(string)s,OBJ_ARROW,0,0,0,0); // create an arrow

ObjectSetInteger(0, "good_"+(string)s,OBJPROP_ARROWCODE,252); // set arrow code

ObjectSetInteger(0, "good_"+(string)s,OBJPROP_TIME,Time[1]); // set time

ObjectSetDouble(0, "good_"+(string)s,OBJPROP_PRICE,High[1]+0.0001);

ObjectSet("good_"+(string)s,OBJPROP_COLOR,Lime);

ObjectSet("good_"+(string)s,OBJPROP_WIDTH,2);

s++;

How to make the arrow go 10 pips higher than the bar's high. High[1]+0.0001 doesn't do it(((

High[1]+10*Point
 
Alekseu Fedotov:
High[1]+10*Point

Does High[1]+10*_Point != High[1]+0.0001 ??????????????

In which quotes should it be 10?

 
Alekseu Fedotov:
High[1]+10*Point

Chet doesn't work in the tester. My quotes are 5 decimal places.

 
mt1002:

Chet doesn't work in the tester. My quotes are 5 decimal places.

How do you determine what's not working? The price of the object is not at the bottom. That's why you can't see that one point. Do 5-7 points and you'll see.

 

How to calculate the SL by ATR ?

//================================================================//
double atr(int bar)
  {
   return (iATR(Symbol(),0,ATR,1));
  }
//============Расчет СЛ по ATR===================================//
double atr(int Sl)
  {
   double atr=iATR(Symbol(),0,ATR,1);
   Sl=atr/0.00001*Point;
   return(Sl);
  }
 
Ibragim Dzhanaev:

How to calculate the SL by ATR ?

Simply iATR/Point() - get in points
 
Artyom Trishkin:
Simply iATR/Point() - get in points

is this correct ?

//============Расчет СЛ по ATR===================================//
int Sl(int stop)
  {
     Sl=iATR(Symbol(),0,ATR,1)/0.00001*Point;  
   return(stop);
  }
 
Ibragim Dzhanaev: is that correct ?

If you have a five digit Point() function - see reference - or a variable with an underscore ahead of _Point is 0.00001

 
STARIJ:

If you have five digits, the Point() function or a variable with an underscore ahead of _Point is 0.00001


Thank you.

 
Ibragim Dzhanaev:

is that correct ?

I told you - just divide the atr value by the point.