- Indicator Will Not Display Array Numbers.
- Indicator Will Not Display Array Numbers.
- Passing Array Elements Between Arrays.
//--------------------------------------------------------------------
// Ease Of Movement.mq4
//
//--------------------------------------------------------------------
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Lime
#property indicator_color2 Red
double Buf_0[],Buf_1[];
//--------------------------------------------------------------------
int init()
{
IndicatorBuffers(2);
//--------------------------------------------------------------------
SetIndexBuffer(0,Buf_0);
SetIndexStyle (0,DRAW_LINE,STYLE_SOLID,1);
//--------------------------------------------------------------------
SetIndexBuffer(1,Buf_1);
SetIndexStyle (1,DRAW_LINE,STYLE_SOLID,1);
//--------------------------------------------------------------------
return;
}
//--------------------------------------------------------------------
int start()
{
int i,
Counted_bars;
//--------------------------------------------------------------------
Counted_bars=IndicatorCounted();
i=Bars-Counted_bars+1;
double vol[500];
double FastMA[500];
double SlowMA[500];
double Indicator[500];
int limit=ArraySize(vol);
ArraySetAsSeries(vol,true);
ArraySetAsSeries(FastMA,true);
ArraySetAsSeries(SlowMA,true);
ArraySetAsSeries(Indicator,true);
for(i=0; i<limit; i++)
vol[i]=iVolume(NULL,0,i);
for(i=0; i<limit; i++)
FastMA[i]=iMAOnArray(vol,0,14,0,MODE_SMA,0);
for(i=0; i<limit; i++)
SlowMA[i]=iMAOnArray(vol,0,21,0,MODE_SMA,0);
for(i=0; i<limit; i++)
Indicator[i]=FastMA[i]/SlowMA[i];
ArrayCopy(Buf_0,Indicator,0,0,WHOLE_ARRAY);
Alert(Buf_0[0],"***",Buf_0[1],"***",Buf_0[2],"***",Buf_0[3],"***",Buf_0[4]);
return(0);
}
//-------------------------------------------------------------------
Add this to the posted code, remove and reattach the above indicator:
#property indicator_maximum 2
#property indicator_minimum -2
Why? Display window is for some reason out of range of the indicator value.
Why? I don't know.
Add this to the posted code, remove and reattach the above indicator:
#property indicator_maximum 2
#property indicator_minimum -2
Why? Display window is for some reason out of range of the indicator value.
Why? I don't know.
phy,
Do you know why when I attach an indicator to this website, the name of the indicator changes? My original indicator is named Volume Oscillator.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use