the buffers u assign value to, missed the index
ExtMapBuffer1=iMA(NULL,0,9,8,MODE_EMA,PRICE_CLOSE,idx);
ExtMapBuffer2=iMA(NULL,0,30,8,MODE_EMA,PRICE_CLOSE,idx);
ExtMapBuffer3=iMomentum(NULL,0,12,PRICE_CLOSE,idx);
you have to have loop to accomplish this. something like
int limit=Bars-IndicatorCounted();
for (int idx = 0; idx < limit; idx++)
{
ExtMapBuffer1=iMA(NULL,0,9,8,MODE_EMA,PRICE_CLOSE,idx);
ExtMapBuffer2=iMA(NULL,0,30,8,MODE_EMA,PRICE_CLOSE,idx);
ExtMapBuffer3=iMomentum(NULL,0,12,PRICE_CLOSE,idx);
}
by using double ExtMapBuffer1 ... u are creating new variables and not using the original buffers
elihayun
elihayun an a 1000000.99 thanx for you...
and a for me.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
hi
can you please help me with these...
i do not get any lines in the main chart !!!
//| testing.mq4 |
//| bbb|
//| aaa
//+------------------------------------------------------------------+
#property copyright "bbb"
#property link "aaa"
#property indicator_chart_window
//#property indicator_separate_window
#property indicator_buffers 3
/*#property indicator_color1
#property indicator_color2
#property indicator_color3 */
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE,STYLE_DASH,3,Red);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_LINE,STYLE_DASH,3,Blue);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle(2,DRAW_LINE,STYLE_DASH,3,Yellow);
SetIndexBuffer(2,ExtMapBuffer3);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
if (counted_bars<0) return(-1);
if (counted_bars>0) counted_bars--;
double ExtMapBuffer1=iMA(NULL,0,9,8,MODE_EMA,PRICE_CLOSE,0);
double ExtMapBuffer2=iMA(NULL,0,30,8,MODE_EMA,PRICE_CLOSE,0);
double ExtMapBuffer3=iMomentum(NULL,0,12,PRICE_CLOSE,0);
//----
return(0);
}
//+------------------------------------------------------------------+