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.
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
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); } //+------------------------------------------------------------------+

- www.mql5.com
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
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

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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