📅 财经日历 📊 实时波动 📈 大盘云图 📶 行情走势 🆚 投机情绪 🚀 今日热点

    股软高手过来帮个忙

    2011-12-16 · 9165 阅读
    这个指标是MT4的,可以替代均线使用,比均线灵敏平滑,很好使用,我想把它放到飞狐交易师,麻烦那位老师翻译成飞狐可用的指标,这里表示感谢了。

    • #property copyright \"Copyright ?2005, Nick Bilak\"

    • #property link      \"http://www.forex-tsd.com/\"

    • //---- indicator settings

    • #property  indicator_chart_window

    • #property  indicator_buffers 1

    • #property  indicator_color1  Crimson

    • //---- indicator parameters

    • extern int Periods=9; //12

    • extern double VolumeFactor= 0.72; //0.8

    • //---- indicator buffers

    • double e1[];

    • double e2[];

    • double e3[];

    • double e4[];

    • double e5[];

    • double e6[];

    • double e7[];

    • //+------------------------------------------------------------------+

    • //| Custom indicator initialization function                         |

    • //+------------------------------------------------------------------+

    • int init()

    •   {

    •    IndicatorBuffers(7);

    • //---- drawing settings

    •    SetIndexStyle(0,DRAW_LINE,2);

    •    SetIndexDrawBegin(0,Periods);

    •    if(

    •     !SetIndexBuffer(0,e7) &&

    •       !SetIndexBuffer(1,e2) &&

    •       !SetIndexBuffer(2,e3) &&

    •       !SetIndexBuffer(3,e4) &&

    •       !SetIndexBuffer(4,e5) &&

    •       !SetIndexBuffer(5,e6) &&

    •     !SetIndexBuffer(6,e1)

    •       )

    •       Print(\"cannot set indicator buffers!\");

    • //---- name for DataWindow and indicator subwindow label

    •    IndicatorShortName(\"T3MA(\"+Periods+\")\");

    • //---- initialization done

    •    return(0);

    •    

    •   }

    • //+------------------------------------------------------------------+

    • //| Moving Average of Oscillator                                     |

    • //+------------------------------------------------------------------+

    • int start()

    •   {

    •    int i,limit;

    •    int counted_bars=IndicatorCounted();

    • //---- check for possible errors

    •    if(counted_bars0) counted_bars--;

    •    limit=Bars-counted_bars;

    • //---- main loop

    •    for(i=limit; i>=0; i--) {

    •     e1=iMA(NULL,0,Periods,0,MODE_EMA,PRICE_CLOSE,i);

    •    }

    •    for(i=limit; i>=0; i--) {

    •     e2=iMAOnArray(e1,0,Periods,0,MODE_EMA,i);

    •    }

    •    for(i=limit; i>=0; i--) {

    •     e3=iMAOnArray(e2,0,Periods,0,MODE_EMA,i);

    •    }

    •    for(i=limit; i>=0; i--) {

    •     e4=iMAOnArray(e3,0,Periods,0,MODE_EMA,i);

    •    }

    •    for(i=limit; i>=0; i--) {

    •     e5=iMAOnArray(e4,0,Periods,0,MODE_EMA,i);

    •    }

    • double a= VolumeFactor; //0.8;

    • double c1=-a*a*a;

    • double c2=3*a*a+3*a*a*a;

    • double c3=-6*a*a-3*a-3*a*a*a;

    • double c4=1+3*a+a*a*a+3*a*a;

    • //T3MA=c1*e6+c2*e5+c3*e4+c4*e3;

    •    for(i=limit; i>=0; i--) {

    •     e6=iMAOnArray(e5,0,Periods,0,MODE_EMA,i);

    •     e7=c1*e6+c2*e5+c3*e4+c4*e3;

    •    }

    • //---- done

    •    return(0);

    •   }

    • //+------------------------------------------------------------------+

    复制代码
    ""
    还没有人打赏,支持一下
    回复

    举报

     

    回答|共 23 个

    暗色调 LV5

    发表于 2012-11-21 23:00:23 | 显示全部楼层

    怎么就没人拜我为偶像那?? ~  

    月芽儿 LV4

    发表于 2012-11-21 23:00:23 | 显示全部楼层

    顶.支持,路过.....  

    dmpdc LV5

    发表于 2012-11-22 00:05:51 | 显示全部楼层

    一楼的位置好啊..  

    ea大师 LV15

    发表于 2012-11-22 00:05:51 | 显示全部楼层

    不错啊! 一个字牛啊!  

    野狗 LV5

    发表于 2012-11-22 00:05:51 | 显示全部楼层

    华尔街EA研发中心,最具权威的EA开发服务商  

    sky LV5

    发表于 2012-11-22 00:05:51 | 显示全部楼层

    怎么就没人拜我为偶像那?? ~  

    一生跟随 LV5

    发表于 2012-11-22 00:05:51 | 显示全部楼层

    刚刚接触EA ,楼主请发份给我…  

    掘金帮 LV4

    发表于 2012-11-22 00:05:51 | 显示全部楼层

    楼上的话等于没说~~~  

    百态美语 LV7

    发表于 2015-1-24 22:36:01 | 显示全部楼层

    亏损中……………………
    123下一页
    您需要登录后才可以回帖 登录 | 注册

    提醒: 禁止引战、谩骂、灌水内容

    微信二维码

    有问题联系客服