Download MetaTrader 5
To add comments, please log in or register
Do you know that MQL5 can create custom graphical tools?
lion999
32
lion999 2012.11.04 14:42 

Hi

would like to know how one would code "every+100pips" in mql5,.....may sound like very very dumb question......but will be of great help to me.

lion999

Tri Noviantoro
973
Tri Noviantoro 2012.11.05 10:29  
lion999:

Hi

would like to know how one would code "every+100pips" in mql5,.....may sound like very very dumb question......but will be of great help to me.

lion999

please go to "Jobs" section.
phi nuts
2184
phi nuts 2012.11.05 12:31  
Trintoro:
please go to "Jobs" section.
Don't do that. Help lion999 by giving a mql5 codes that answer the question, not asking him to job section and pay for it with money. 
Moses Olawale  Ajayi
2370
Moses Olawale Ajayi 2012.11.05 16:29  
It's obvious that no one want to do any free job again. If i know how to build EA i would have done this for you.
mikesomething
207
mikesomething 2012.11.05 18:56  
Trintoro:
please go to "Jobs" section.

a forum is a place where people come for help and to share information. if you dont want to help, then dont come to the forum 

 

lion999
32
lion999 2012.11.05 19:36  

phi.nuts , gbemitte , mikesomething.....Thanks,for your support


phi nuts
2184
phi nuts 2012.11.10 10:46  
lion999:

Hi

would like to know how one would code "every+100pips" in mql5,.....may sound like very very dumb question......but will be of great help to me.

lion999

I'm not so sure by you wanted, but here's example script for drawing horizontal lines above and below current close price about 15 pips.

Hope that's help

#property script_show_inputs  //--- show the input

input double Pips = 15.0;     //--- and this is the input

//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
  PlaySound( "wait.wav");

  double start_point[1], upper, lower, the_point;
  int count;
  
  ResetLastError();
  count = CopyClose( _Symbol, 
                    _Period,
                    0,            //--- close price of current bar
                    1,            //--- copy just one data price ...
                    start_point); //--- ... to this array
  if (count <= 0)
    {
    Alert("Fail to copy close price with error ",GetLastError() );
    }
    else
    {
    //--- changing the value of _Point, but this doesn't work on Metal pairs and some exchange pairs :(
    if (_Digits == 5 || _Digits == 3)
       {
       the_point = 10*_Point;
       }
       else
       {
       the_point = _Point;
       }
    
    //--- draw horizontal line on n pips above current close price
    upper = start_point[0] + Pips*the_point;
    DRAW_LINES (1, upper);
    
    //--- draw horizontal line on n pips below current close price
    lower = start_point[0] - Pips*the_point;
    DRAW_LINES (2, lower);
    }

  }
//+------------------------------------------------------------------+
bool DRAW_LINES(int line_no, double value)
  {
  string name; 
  bool success = false;
  
  StringConcatenate( name, MQL5InfoString(MQL5_PROGRAM_NAME)," ",_Symbol," ",line_no);
  
  success = ObjectCreate(0,            //--- which chart to draw : current chart
                        name,          //--- name of the object, must be different for every each object
                        OBJ_HLINE,     //--- type of the object : horizontal line
                        0,             //--- main window chart or sub window chart : main window chart
                        0,             //--- time coordinate : not used when drawing horizontal line
                        value );       //--- price coordinate
  if (success == true)
    {
    ObjectSetInteger(0, name, OBJPROP_TIME, 0);
    ObjectSetDouble (0, name, OBJPROP_PRICE, value);      //--- price coordinate
    ObjectSetInteger(0, name, OBJPROP_SELECTABLE, true);  //--- make it selectable ...
    ObjectSetInteger(0, name, OBJPROP_SELECTED, false);   //--- ... but not selected.
    ObjectSetInteger(0, name, OBJPROP_COLOR, clrYellow);  //--- color is yellow
    ObjectSetInteger(0, name, OBJPROP_WIDTH, 2);          //--- thickness is 2
    }
  return (success);
  }
//+------------------------------------------------------------------+
Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types
Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types
  • www.mql5.com
Standard Constants, Enumerations and Structures / Objects Constants / Object Types - Documentation on MQL5
Moses Olawale  Ajayi
2370
Moses Olawale Ajayi 2012.11.10 15:52  

Please, kindly explain in detail how the above script woks

I'm not a coder/programer and i don't understand it.

Is it mql5 or mql4?

Thanks

Achmad Hidayat
14766
Achmad Hidayat 2012.11.16 11:22  
gbemitte:

Please, kindly explain in detail how the above script woks

I'm not a coder/programer and i don't understand it.

Is it mql5 or mql4?

Thanks

mql5

work as usual script

/
To add comments, please log in or register