Hi, anyone could help me to find a way to anchor this indicator to the low of the candle, when i click on chart?
Thanks
Hi angevoyageur, I'm new to this forum an to MQL5, sorry for the SRC, i did not know about it.
I know this is not an indicator, but how should I call it? A tool, script, expert? Is there a better place on this forum to post this topic?
Thanks
Hi angevoyageur, I'm new to this forum an to MQL5, sorry for the SRC, i did not know about it.
I know this is not an indicator, but how should I call it? A tool, script, expert? Is there a better place on this forum to post this topic?
Thanks
Ok let me try to be more clear. The indicator/tool/expert I posted plots an arrowbuy when I click on Chart with the left mouse buttom.
What I want is to have the arrowbuy to be placed below the low of the candle relative to the point that I clicked on the chart, even if the exact point that I clicked is way down below the low of the candle, I want the arrow buy to be anchored to the low of the candle, like some magnet tool.
Thanks again.
- www.mql5.com
Thanks for your help Filter, now I'd like to know if it's possible to have a second object when clicking on the chart for the second time.
The formula below creates a horizontal line two ticks below the low of the candle when I click on the chart, then if I click again on the chart it removes the line and creates a new line at the new low relative to this new click.
I'd like to keep the first line when clicking for the second time, so I would have two lines , and then if clicking againg on the chart (Third Time) start the process again.
I just don't have any idea how to achieve that, so I really appreciate if someone could guide me through it.
Thanks
//+------------------------------------------------------------------+ //| T6.mq5 | //| Copyright 2014, MetaQuotes Software Corp. | //| http://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2014, MetaQuotes Software Corp." #property link "http://www.mql5.com" #property version "1.00"// input string InpName="HLineLow"; // Object name //--- MqlRates candle[]; //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnInit() { //--- ArraySetAsSeries(candle,true); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam) { //--- int visibleBars = (int)ChartGetInteger(0,CHART_VISIBLE_BARS,0); //--- CopyRates(_Symbol,_Period,0,visibleBars,candle); //--- double tickSize = SymbolInfoDouble(_Symbol,SYMBOL_TRADE_TICK_SIZE); //--- string comment="Last event: "; //--- select event on chart switch(id) { //--- 1 case CHARTEVENT_CLICK: { comment+="6) mouse click on chart"; //--- object counter static uint sign_obj_cnt; string buy_sign_name="buy_sign_"+IntegerToString(sign_obj_cnt+1); //--- coordinates int mouse_x=(int)lparam; int mouse_y=(int)dparam; //--- time and price datetime obj_time; double obj_price; int sub_window; //--- convert the X and Y coordinates to the time and price values if(ChartXYToTimePrice(0,mouse_x,mouse_y,sub_window,obj_time,obj_price) ) { //--- int barPos = Bars(_Symbol,_Period,obj_time,TimeCurrent()); //--- create object if(!ObjectCreate(0,buy_sign_name, OBJ_HLINE,0,obj_time,candle[barPos].low-(20*tickSize))) //OBJ_HLINE { Print("Failed to create buy sign!"); return; } } } } //--- Comment(comment); }
- www.mql5.com
Thanks for your help Filter, now I'd like to know if it's possible to have a second object when clicking on the chart for the second time.
The formula below creates a horizontal line two ticks below the low of the candle when I click on the chart, then if I click again on the chart it removes the line and creates a new line at the new low relative to this new click.
I'd like to keep the first line when clicking for the second time, so I would have two lines , and then if clicking againg on the chart (Third Time) start the process again.
I just don't have any idea how to achieve that, so I really appreciate if someone could guide me through it.
Thanks
Hi angevoyageur, could you give an example how to do it, I tryed to find it on the web but no success.
Thanks and happy new year!
Hi angevoyageur, could you give an example how to do it, I tryed to find it on the web but no success.
Thanks and happy new year!
string buy_sign_name="buy_sign_"+IntegerToString(sign_obj_cnt++);
- 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, anyone could help me to find a way to anchor this indicator to the low of the candle, when i click on chart?
Thanks