设为首页收藏本站

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

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

Rank: 2

精华
0
UID
14443
积分
107
帖子
22
主题
3
阅读权限
30
注册时间
2010-7-16
最后登录
2012-11-8
跳转到指定楼层
1#
发表于 2010-7-30 10:46:33 |显示全部楼层 |倒序浏览
给大家一个双均线交易模型,欢迎大家试用指教
//------------------------------------------------------------------------
// 简称: 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
        TotalEquity = CurrentCapital()+ Abs(CurrentContracts()*Close*ContractUnit()*BigPointValue()*MarginRatio());
        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,NextOpen,True);
        }
        if (EMA>AMA)
        {
            SellShort(EntryLots,NextOpen,True);
        }
End


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

Rank: 2

精华
0
UID
14443
积分
107
帖子
22
主题
3
阅读权限
30
注册时间
2010-7-16
最后登录
2012-11-8
2#
发表于 2010-7-30 10:48:33 |显示全部楼层
参数自己试

使用道具 举报

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

bottom

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

GMT+8, 2024-5-10 03:44

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部