设为首页收藏本站

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

老师麻烦帮编一个程序 [复制链接]

Rank: 2

精华
0
UID
207366
积分
67
帖子
45
主题
12
阅读权限
30
注册时间
2015-4-18
最后登录
2022-2-6
1#
发表于 2020-9-5 10:06:01 |显示全部楼层
本帖最后由 szchonger 于 2020-9-5 10:27 编辑
小米 发表于 2016-4-1 14:43


小米老师好,我写的抛物转向交易系统,但是开平仓在开盘价是有偷价的,麻烦老师能不能再写个A函数的程序,把开平仓控制在具体的TICK上呢?

Params
        Numeric AfStep( 0.02);
        Numeric AfLimit( 0.2 ) ;
        Numeric Lots(1);        //仓量
Vars
        Numeric oParCl( 0 );
        Numeric oParOp( 0 );
        Numeric oPosition( 0 );
        Numeric oTransition( 0 );
       
Begin
       
        ParabolicSAR( AfStep, AfLimit, oParCl, oParOp, oPosition, oTransition ) ;
       
       
        If(MarketPosition!=1 )
        {
                If(oParCl < L[1]) Buy(Lots, O);
               
        }
        If(MarketPosition!=-1)
        {
            If(oParCl > H[1]) SellShort(Lots, O);
        }
End

使用道具 举报

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

bottom

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

GMT+8, 2024-5-8 06:46

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部