设为首页收藏本站

 找回密码
 注册
查看: 1774|回复: 0

A_BuyPosition使用问题? [复制链接]

Rank: 1

精华
0
UID
162757
积分
24
帖子
2
主题
2
阅读权限
10
注册时间
2013-1-15
最后登录
2017-10-12
发表于 2017-10-12 14:03:16 |显示全部楼层
程序能运行,但是平仓不能实现?
请大侠帮忙看看


Params
    Numeric Para1(1);
    Numeric Para2(2);
    Numeric Para3(3);

    Numeric JValue(2800);
    Numeric SValue(1);
       
Vars
        Bool Condition1;
        Bool Condition2;
        Numeric M;
        Bool Condition6;
       
Begin
        Condition1 = close<=JValue And Close>JValue-Para1;
        Condition2 = close<=JValue-Para1 And Close>JValue-Para2;

       
        Condition6 = (A_BuyPosition==1);
//第一阶段开仓       
        if (Condition1  And A_BuyPosition==0 )
          {
                Buy(SValue,JValue-Para1);
          }
//第一阶段平仓       
        if(A_BuyPosition==1)
          {
            Sell(1,JValue+Para1);
           }

//第二阶段开仓          
        if (Condition2 and A_BuyPosition==1 )
        {
                Buy(SValue,JValue-Para2);
     }
//第二阶段平仓
        if(A_BuyPosition==2)
          {
            Sell(SValue,JValue);
           }   
       
End



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

bottom

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

GMT+8, 2024-4-19 02:58

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部