设为首页收藏本站

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

写了这个单边做多的程序,请指教如何优化 [复制链接]

Rank: 1

精华
0
UID
201911
积分
34
帖子
17
主题
7
阅读权限
10
注册时间
2015-1-19
最后登录
2019-3-10
跳转到指定楼层
1#
发表于 2016-4-22 22:31:36 |只看该作者 |倒序浏览
Params
        Numeric FastLength(6);
        Numeric SlowLength(18);
        numeric bollingerlengths(18);
        Numeric offset(1.318);
        Numeric Length1(6);
        Numeric Length2(18);
        Numeric Length3(36);
Vars
        NumericSeries AvgValue1;
        NumericSeries AvgValue2;
        NumericSeries midline(0);
        NumericSeries band(0);
        NumericSeries upband(0);
        NumericSeries Vol1;
        NumericSeries Vol2;
        NumericSeries vol3;
       
Begin
        AvgValue1 = AverageFC(Close,FastLength);
        AvgValue2 = AverageFC(Close,SlowLength);
        midline=AverageFC(Close,bollingerlengths);
        band=StandardDev(Close,bollingerlengths,2);
        upband=midline+band*offset;
        Vol1=AverageFC(Vol, Length1);
        vol2=AverageFC(Vol, Length2);
        vol3=AverageFC(Vol, Length3);

        PlotNumeric("MA1",AvgValue1);
        PlotNumeric("MA2",AvgValue2);
    PlotNumeric("upband",upband);
       
        // 集合竞价和小节休息过滤
        If(!CallAuctionFilter()) Return;
       
        If(MarketPosition <>1 And AvgValue1[1] > AvgValue2[1]And Close>=upband And Vol1>vol2 )
        {
                Buy(1,Open);
        }
        If(MarketPosition==1 and BarsSinceEntry>0 And AvgValue1[1] < AvgValue2[1])
        {
                Sell(1,min(Open,midline));
        }
        //PlotNumeric("PL",Portfolio_TotalProfit);       
End
问题1:一般设置偏移,手续费,滑点多少为宜?
问题2:像这个交易系统,我需要加哪一些过滤条件增加稳定性?
问题3:收盘前清仓需要怎样写?
请大家指教。别路过!!!!
您需要登录后才可以回帖 登录 | 注册

bottom

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

GMT+8, 2024-5-18 09:25

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部