- 精华
- 0
- 在线时间
- 153 小时
- UID
- 224840
- 积分
- 49
- 帖子
- 30
- 阅读权限
- 10
- 注册时间
- 2015-12-10
- 最后登录
- 2019-10-11
- 精华
- 0
- UID
- 224840
- 积分
- 49
- 帖子
- 30
- 主题
- 13
- 阅读权限
- 10
- 注册时间
- 2015-12-10
- 最后登录
- 2019-10-11
|
这么写,开仓后,达到止盈条件(盈利N跳),没有平仓,不知道是我写的不对,还是模拟网速慢的原因,谢谢!
}Else If(A_SellPosition()>=1 And TP==1) // 有空仓的情况
{
MyEntryPrice=A_SellAvgPrice();
If( Q_AskPrice()<=MyEntryPrice-N*minpoint)
{
MyExitPrice=MyEntryPrice-N*minpoint;
A_SendOrder(Enum_Buy,Enum_exit,M,MyExitPrice);
TP=0;
SetGlobalVar(0,TP);
}
If ((TIMECON>=WAITTIME))
{
If(A_BuyPosition()>=1 And TP==1) // 有多仓的情况
{
MyExitPrice=Q_BidPrice;
A_SendOrder(Enum_Sell,Enum_exit,M,MyExitPrice);
TP=0;
SetGlobalVar(0,TP); |
|