property indicator_separate_window

  • property indicator_separate_window已关闭评论
  • A+
所属分类:未分类
#property indicator_separate_window
extern int Ma_period=60;
extern int RangeValue=5;
double Slopebuffer[];
double Mabuffer[];
double prevbuffer[];
int init()
{
IndicatorBuffers(3);
SetIndexBuffer(0,Slopebuffer);
SetIndexStyle(0,1,EMPTY,2,DarkGreen);
SetIndexBuffer(1,Mabuffer);
SetIndexBuffer(2,prevbuffer);
return(0);
}
int deinit()
{
return(0);
}
int start()
{
int counted_bars=IndicatorCounted();
int limit;
if(counted_bars > 0)
counted_bars--;
limit = Bars - counted_bars;
static int PrevSignal = 0, PrevTime = 0;
for(int i = 0; i < limit; i++)
{
Mabuffer[i]=iMA(NULL,0,Ma_period,0,MODE_SMA,PRICE_CLOSE,i);
}
for(i = 0; i < limit; i++)
{
Slopebuffer[i]=(Mabuffer[i]-Mabuffer[i+1])/0.0001;
}
for(i=0;i<limit;i++)
{
if(Slopebuffer[i]*Slopebuffer[i+1]<0 && count<=5 )