- 精华
- 0
- 在线时间
- 27 小时
- UID
- 204273
- 积分
- 18
- 帖子
- 8
- 阅读权限
- 10
- 注册时间
- 2015-3-2
- 最后登录
- 2021-10-14
- 精华
- 0
- UID
- 204273
- 积分
- 18
- 帖子
- 8
- 主题
- 4
- 阅读权限
- 10
- 注册时间
- 2015-3-2
- 最后登录
- 2021-10-14
|
发表于 2019-2-11 11:43:29
|显示全部楼层
li19801068 发表于 2019-2-11 10:11
版主在吗
今天实盘只出现平仓信号没有反手信号,帮忙看下这个哪里有问题!
Params
Numeric lots(1);
Numeric delayticks(5);
Vars
String strkey;
String strvalue;
NumericSeries a3;
NumericSeries a4;
Numeric lost;
Numeric lastbartime;
Numeric tickcounter;
String A_AccountID;
Begin
If(! callauctionfilter())return;
lastbartime=GetGlobalVar(0);
tickcounter=GetGlobalVar(1);
strkey=DateToString(date)+TimeToString(time);
strvalue=GetTBProfileString(symbol+"a3",strkey);
If(strvalue != invalidstring)
{
a3=Value(strvalue);
}Else
{
a3 = a3[1];
}
strkey=DateToString(date)+TimeToString(time);
strvalue=GetTBProfileString(symbol+"a4",strkey);
If(strvalue != invalidstring)
{
a4=Value(strvalue);
}Else
{
a4 = a4[1];
}
If(barstatus==2 && lastbartime !=time)
{
lastbartime = time;
tickcounter =0;
}
If(MarketPosition <>1 && a3>a4)
{
If(marketposition== 0 || barstatus !=2)
{
Buy(lost,Open);
}Else
{
BuyToCover(lost,open);
If(tickcounter == 0)
{
tickcounter =1;
}else if (tickcounter<delayticks)
{
tickcounter=tickcounter+1;
}else
{
Buy(lost,Open);
}
}
}
If(MarketPosition <>-1 && a3<a4)
{
If(marketposition== 0 || barstatus !=2)
{
SellShort(lost,Open);
}else
{
Sell(lost,Open);
if(tickcounter == 0)
{
tickcounter =1;
}else if (tickcounter<delayticks)
{
tickcounter = tickcounter +1;
}else
{
SellShort(lost,Open);
}
}
}
End |
附件: 你需要登录才可以下载或查看附件。没有帐号?注册
|