客服热线:18391752892

呼叫版主变色均线加入MACD条件指标,该怎么实现?

   日期:2019-01-12     浏览:158    
马上注册,结交更多好友,下载更多资源

您需要 登录 才可以下载或查看,没有帐号?注册 希望实现的是,当价格在18日均线上方且macd 0时,18日均线为红色,如果不加入MACD条件均线可以实现红绿变色,但是加入MACD条件后均线全为绿色,
 以下是我的指标,望高手指点,哪里出了错误?谢谢
 
 
 
 
 #property indicator_chart_window
 #property indicator_buffers 2
 #property indicator_color1 Red
 #property indicator_color2 Green
 extern int 变色均线=18;
 double duo[];
 double kong[];
 double macd11[];
 int init()
    {
   SetIndexBuffer(0,duo);
   SetIndexBuffer(1,kong);
   SetIndexStyle(0,DRAW_LINE);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexDrawBegin(0,变色均线);
   SetIndexDrawBegin(1,变色均线);
   IndicatorDigits(Digits);
   return(0);
    }
 int start()
    {
   double temp0,temp1;
   int limit;
   int counted_bars=IndicatorCounted();
   if(counted_bars0) counted_bars--;
   limit=Bars-counted_bars;
     for(int i=0; i=0; i--)
     {   
     duo i =EMPTY_VALUE;
     kong i =EMPTY_VALUE;
     temp0=iMA(NULL,0,变色均线,0,MODE_SMA,PRICE_CLOSE,i);
     temp1=iMA(NULL,0,变色均线,0,MODE_SMA,PRICE_CLOSE,i+1);
     if(iClose(NULL,0,i) =iMA(NULL,0,变色均线,0,MODE_SMA,PRICE_CLOSE,i) macd11 i 0)
         {duo i =temp0; duo[i+1]=temp1;}
     else {kong i =temp0; kong[i+1]=temp1;}
     }     
   return(0);
    }[/td][/tr]
外汇交易有很大的风险性,本站所有资源均来自网络,请选择使用,如若出现亏损,本站不承担任何责任!


特别提示:本信息由相关企业自行提供,真实性未证实,仅供参考。请谨慎采用,风险自负。


0相关评论
相关行情
推荐行情
点击排行