- 精华
- 0
- 在线时间
- 16 小时
- UID
- 162757
- 积分
- 24
- 帖子
- 2
- 阅读权限
- 10
- 注册时间
- 2013-1-15
- 最后登录
- 2017-10-12
- 精华
- 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
|
|