Hi Guys,
Thank You for taking your time to go through the post.
I am a newbie to the programming world.
Having been reading and trying to understand mql for the past one week and
finally I have decided to start coding.
I am creating my first indicator and need help with this.
Goal of the Indicator - If a new high is made, put an up arrow mark under the candlestick as soon as the stick is completely formed.
Now here is my code
//+------------------------------------------------------------------+
//| High.mq4 |
//| |
//| |
//+------------------------------------------------------------------+
#property copyright ""
#property link ""
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
//---- buffers
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,217);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexEmptyValue(0,0.0);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----
if (High[1] > High [2])
ExtMapBuffer1[1]=Low[1]-3*Point;
//----
return(0);
}
//+------------------------------------------------------------------+
My problem
As soon as I attach the indicator it works properly but I want the indicator to put these arrows for the last 100 bars and not just from the
time I attached the indicator.
Can you please tell me as to how to go about doing this.
Regards
Brijesh
Thank You for taking your time to go through the post.
I am a newbie to the programming world.
Having been reading and trying to understand mql for the past one week and
finally I have decided to start coding.
I am creating my first indicator and need help with this.
Goal of the Indicator - If a new high is made, put an up arrow mark under the candlestick as soon as the stick is completely formed.
Now here is my code
//+------------------------------------------------------------------+
//| High.mq4 |
//| |
//| |
//+------------------------------------------------------------------+
#property copyright ""
#property link ""
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
//---- buffers
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,217);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexEmptyValue(0,0.0);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----
if (High[1] > High [2])
ExtMapBuffer1[1]=Low[1]-3*Point;
//----
return(0);
}
//+------------------------------------------------------------------+
My problem
As soon as I attach the indicator it works properly but I want the indicator to put these arrows for the last 100 bars and not just from the
time I attached the indicator.
Can you please tell me as to how to go about doing this.
Regards
Brijesh