设为首页收藏本站

 找回密码
 注册
查看: 13731|回复: 0
打印 上一主题 下一主题

给大家一个双均线交易模型 [复制链接]

精华
0
UID
69303
积分
60
帖子
23
主题
2
阅读权限
0
注册时间
2011-10-3
最后登录
2013-6-30
1#
发表于 2012-3-7 19:10:35 |显示全部楼层
//------------------------------------------------------------------------
// 简称: EA
// 名称: EA交易模型
// 类别: 交易指令
// 类型: 其他
// 输出: 一条指数移动均线和一条调整移动均线(适应性移动平均线)
//------------------------------------------------------------------------
Params
        Numeric Length1(16);
        Numeric Length2(80);
    Numeric FastAvgLength(2);
        Numeric SlowAvgLength(30);
Vars   
        NumericSeries AMA;
        NumericSeries EMA;
        Bool Condition1;
        Bool Condition2;
        Numeric TotalEquity;
        Numeric UseMargin;
        Numeric EntryLots;
               
Begin
      
        UseMargin = Close*ContractUnit*BigPointValue*MarginRatio;
        EntryLots = IntPart(TotalEquity*0.25/UseMargin);
        AMA = AdaptiveMovAvg(Close,Length1,FastAvgLength,SlowAvgLength);
        EMA = XAverage(Close, Length2);
        if (AMA>EMA)
        {
                Buy(EntryLots,Open);
        }
        if (EMA>AMA)
        {
            SellShort(EntryLots,Open);
        }
End


//------------------------------------------------------------------------
// 编译版本        GS2004.06.12
// 用户版本        2010/07/26 13:21
// 版权所有        mmc29170
// 更改声明        TradeBlazer Software保留对TradeBlazer平台
//                        每一版本的TrabeBlazer公式修改和重写的权利
//------------------------------------------------------------------------

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

bottom

静态版|手机版|联系我们|交易开拓者 ( 粤ICP备07044698   

GMT+8, 2024-5-9 21:08

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部