View Single Post
  #2 (permalink)  
Old 12-07-2005, 09:51 PM
codersguru's Avatar
codersguru codersguru is offline
Senior Member
 
Join Date: Oct 2005
Posts: 997
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Arrow Arrows

Quote:
Originally Posted by xsd
I am newbie here. Please be gentle.

I want to create one simple arrow (any shape is fine).. on the current candle bar (one on the HIGH and another on its LOW).. I know it could be simple, kindly post MQ4 SAMPLE code. Thanks in advance.
xsd,

Is this what do you want:


PHP Code:
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Blue
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   
SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID 2Red);
   
SetIndexBuffer(0,ExtMapBuffer1);
   
SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID 2Red);
   
SetIndexBuffer(1,ExtMapBuffer2);
//----
   
return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 
   
//----
   
return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {

//----    
      
ExtMapBuffer1[0]=High[0];
      
ExtMapBuffer2[0]=Low[0];
//----     

   
return(0);
  }
//+------------------------------------------------------------------+ 
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Reply With Quote