|
以下为程序,求解为何蓝色线无法显示出来,求指教 =================================================================== //+------------------------------------------------------------------+ //| MA System.mq4 | //| Philip Hall | //| APP | //+------------------------------------------------------------------+ #property copyright "Philip Hall" #property link "APP" #property version "1.00" #property strict #property indicator_separate_window #property indicator_buffers 2 #property indicator_color1 Red #property indicator_color2 Blue #property indicator_width1 2 #property indicator_width2 2 //指标参数设置 input int MA_1=5; input int MA_2=8; double MASystem_1[]; double MASystem_2[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit(void) { IndicatorDigits(Digits+1); //--- indicator buffers mapping SetIndexStyle(0,DRAW_LINE); SetIndexStyle(1,DRAW_LINE); SetIndexDrawBegin(0,MA_12); SetIndexDrawBegin(1,MA_12); SetIndexBuffer(0,MASystem_1); SetIndexBuffer(1,MASystem_2); //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { int i,limit; limit=rates_total-prev_calculated; if(prev_calculated>0){limit++;}; for(i=0; i<limit; i++) MASystem_1[i] =iMA(NULL,0,MA_1,0,MODE_EMA,PRICE_CLOSE,i); MASystem_2[i] =iMA(NULL,0,MA_2,0,MODE_EMA,PRICE_CLOSE,i); //--- //--- return value of prev_calculated for next call return(rates_total); } //+------------------------------------------------------------------+ //| Timer function | //+------------------------------------------------------------------+ void OnTimer() { //--- } //+------------------------------------------------------------------+ |
EA入门学院