您现在的位置:程序化交易>> 期货公式>> (MC)multicharts>> MC公式>>正文内容

海龟法则策略源码[MC公式]

  • 海龟法则源码


  • variables: n(0),tr(0),pnd(0),dv(0),accountbalance(0),unit(0),var1(0),var2(0);
    tr=maxlist(h-l,h-c[1],c[1]-l);
    pnd=AvgTrueRange(20);
    n=(19*pnd+tr)/20 ;
    dv=n*bigpointvalue;
    var1=currentbid;

    condition5=currentbid>highest(h,55)[1];
    condition6=currentbid>highest(h,20)[1];
    condition7=currentbid<lowest(l,55)[1];
    condition8=currentbid<lowest(l,20)[1];

    {//55}
    if condition5 then;
    buy next bar var1 or higher;
    if condition5 and var1=currentbid+0.5*n then
    buy next bar var1 or higher;// cxh99.com
    if condition5 and var1=currentbid+1*n then
    buy next bar var1 or higher;
    if condition5 and var1=currentbid+1.5*n then
    buy next bar var1 or higher;// www.cxh99.com

    if condition6 then
    sell next bar market;

    if condition7 then
    sellshort next bar var1 or lower;
    if condition7 and var1=currentbid[1]-0.5*n then
    sellshort next bar var1 or lower;
    if condition7 and var1=currentbid[1]-1*n then
    sellshort next bar var1 or lower;
    if condition7 and var1=currentbid[1]-1.5*n then
    sellshort next bar var1 or lower;// cxh99.com

    if condition8 then
    buytocover next bar market;

     

 

有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友

可联系技术人员 QQ: 1145508240  有需要帮忙请点击这里留言!!!进行 有偿 编写!不贵!点击查看价格!

 


【字体: 】【打印文章】【查看评论

相关文章

    没有相关内容