请各位大师们帮助看讨论一下这个公式,有什么问题,能不能用于实盘 [开拓者 TB]
- 咨询内容:
Params
Numeric Lots(1);
Numeric ExitOnCloseMins(14.59);
Numeric maLen1(10);
Numeric maLen2(30);
Vars
Numeric ma1;
Numeric ma2;
Numeric TakeProfit(1);
Numeric TakeProfit2(2);
Numeric MinPoint;
Numeric MyEntryPrice;
Numeric MyExitPrice;
NumericSeries HighestAfterEntry; // 开仓后出现的最高价
NumericSeries LowestAfterEntry; // 开仓后出现的最低价
Numeric StopLine(0);
Begin
ma1 = Average(Open,maLen1);
ma2 = Average(Open,maLen2);
MyEntryPrice = AvgEntryPrice;
HighestAfterEntry = Close[1];
LowestAfterEntry = Close[1];
Commentary("ma1: "+Text(ma1));
Commentary("ma2: "+Text(ma2));
If(CurrentBar > maLen2)
{
If(MarketPosition==0)
{
if((Open>=ma1)&&(ma1>ma2))
{
MyEntryPrice==open;
Buy(lots,MyEntryPrice);
HighestAfterEntry = Max(HighestAfterEntry,AvgEntryPrice);
LowestAfterEntry = Min(LowestAfterEntry,AvgEntryPrice);
Return;
}
if((Open<ma1)&&(ma1<ma2))
{
MyEntryPrice==open;
SellShort(lots,MyEntryPrice);
HighestAfterEntry = Max(HighestAfterEntry,AvgEntryPrice);
LowestAfterEntry = Min(LowestAfterEntry,AvgEntryPrice);
Return;
}
HighestAfterEntry = Max(HighestAfterEntry,High);
LowestAfterEntry = Min(LowestAfterEntry,Low);
}
If(MarketPosition==1)//多仓
{
If(High>=ma1&&(High>HighestAfterEntry[1]))//增仓
{ MyEntryPrice=Open;
Buy(Lots,Open);
HighestAfterEntry=High;
Commentary("增仓: "+Text(Open));
}
If(High>=ma1&&(High<HighestAfterEntry[1]))//未突破前期高位反手
{
MyEntryPrice=Open;
SellShort(1,MyEntryPrice);
}
If(Low<ma1&&(Low<LowestAfterEntry[1]))//止损并反手
{
MyExitPrice=Open;
Sell(0,Open);
MyEntryPrice=MyExitPrice;
SellShort(1,Open);
LowestAfterEntry=Low;
}
If(Low<ma1&&(Low>LowestAfterEntry[1]))//未突破前期低位增仓
{
MyEntryPrice=Open;
Buy(1,MyEntryPrice);
}
}else If(MarketPosition==-1)//空仓
{
If(Low<ma1&&(Low<LowestAfterEntry[1]))//增仓
{
MyEntryPrice=Open;
SellShort(1,Open);
LowestAfterEntry=Low;
}
If(Low<=ma1&&(Low>LowestAfterEntry[1]))//未突破前期高位反手
{
MyEntryPrice=Open;
Buy(1,MyEntryPrice);
}
If(High>=ma1&&(High>HighestAfterEntry[1]))//止损并反手
{
MyExitPrice=Open;
BuyToCover(0,Open);
MyEntryPrice=MyExitPrice;
Buy(1,Open);
HighestAfterEntry=High;
}
If(High>=ma1&&(High<HighestAfterEntry[1]))//未突破前期低位增仓
{
MyEntryPrice=Open;
SellShort(1,MyEntryPrice);
}
}
}
End
- TB技术人员:
high是动态的,high>***是确定的,不会最变,但是high<***就不确定了,所以信号会消失的。
- TB客服:
对于不妥的地方,希望大家作些改进意思
- 网友回复: 对于一些信号会消失的系统,测试结果与现实会有一定的差异,结果是直接导致亏损
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 1145508240 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容