How do I find Arrows on Chart

 

Hi All,

I currently have an indicator that i am happy using which will simply place an Up Arrow or Down Arrow over a bar.

I would like to know if it is possible to create another indicator that can read/pick up when an arrow has been placed on my chart.


If this is possible could you please point me in the right direction.


Many Thanks.

 
nixtrix:

Hi All,

I currently have an indicator that i am happy using which will simply place an Up Arrow or Down Arrow over a bar.

I would like to know if it is possible to create another indicator that can read/pick up when an arrow has been placed on my chart.


If this is possible could you please point me in the right direction.


Many Thanks.

This script for an example of work with arrows


//+------------------------------------------------------------------+
//|                                                        Happy.mq4 |
//|                        Copyright 2014, MetaQuotes Software Corp. |
//|                                              https://www.mql5.com |
//+------------------------------------------------------------------+
#include <stdlib.mqh>
#property show_inputs
#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
extern int timer=1;  //Ask me every  minutes. 
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   long chartID=ChartID();
   int i;
   bool x;
   double y=5*Point;
   int f=60*1000;
   int c=241;
   int ret;
   color clr=SpringGreen;

   while(!IsStopped())
     {
      if(ObjectFind("Happy")==-1)
        {
         Sleep(22);
         x=ObjectCreate("Happy",OBJ_ARROW,0,Time[0],High[0]+y);
         if(x==false)
           {
            Print("Can't create Happy! Error description: "+ErrorDescription(GetLastError())+"");
           }
         ObjectSet("Happy",OBJPROP_COLOR,clrRed);
         ObjectSet("Happy",OBJPROP_WIDTH,5);
        }
      RefreshRates();
      ObjectMove("Happy",0,Time[0],High[0]+y);
      ObjectSet("Happy",OBJPROP_ARROWCODE,c);
      ObjectSet("Happy",OBJPROP_COLOR,clr);
      ChartRedraw(chartID);
      i++;
      Sleep(500);
      if(f-i*500>0)continue;
      i=0;
      c=241;
      clr=SpringGreen;
      ret=MessageBox("ARE YOU HAPPY?","Question",MB_YESNO|MB_ICONQUESTION|MB_TOPMOST);
      if(ret==IDYES)continue;
      c=242;
      clr=DarkGray;
     }
  }
//+------------------------------------------------------------------+
 
nixtrix: I currently have an indicator that i am happy using which will simply place an Up Arrow or Down Arrow over a bar.
Most likely it's not creating arrow objects. It is putting a value in one of two buffers. (above or below.) Just read the last bar buffer values and see if it's not EMPTY_VALUE.
Reason: