- 精华
- 0
- 在线时间
- 188 小时
- UID
- 121070
- 积分
- 133
- 帖子
- 88
- 阅读权限
- 40
- 注册时间
- 2013-7-8
- 最后登录
- 2023-8-18
- 精华
- 0
- UID
- 121070
- 积分
- 133
- 帖子
- 88
- 主题
- 35
- 阅读权限
- 40
- 注册时间
- 2013-7-8
- 最后登录
- 2023-8-18
|
如下边的代码,Direction=0的情况下,如果实时行情先突破短周期唐奇安通道下轨,再突破短周期唐奇安通道上轨,这样在奇安通道下轨上就会产生信号消失,实盘会这样吗?为什么?
If(MarketPosition==0 and TurtleUnits>=1 and DonchianFastUpper>0)
{
// 首次入市1:带过滤条件的,如果过滤条件为真,则需要前一笔交易是否是突破失败;
if(LastProfitableTradeFilter==false Or PreBreakoutFailure )
{
//开多1:突破短周期唐奇安通道上轨;
If(High>DonchianFastUpper and Direction!=-1)
{
MyPrice = Max(Open,DonchianFastUpper)+MinPoint;
preEntryPrice = MyPrice;
Buy(TurtleUnits,MyPrice);
MyExitPrice = MyPrice - 2*N;
SendOrderThisBar = true;
MyAvgEntryPrice = AvgEntryPrice;
LotsTotal = TurtleUnits;
TimesOverWeight = 1;
}
//开空1:突破短周期唐奇安通道下轨;
if(Low<DonchianFastLower and Direction!=1)
{
MyPrice = Min(Open,DonchianFastLower)-MinPoint;
preEntryPrice = MyPrice;
SellShort(TurtleUnits,MyPrice);
MyExitPrice = MyPrice + 2*N;
SendOrderThisBar = true;
MyAvgEntryPrice = AvgEntryPrice;
LotsTotal = TurtleUnits;
TimesOverWeight = 1;
}
} |
|