請各位大師們幫助看討論一下這個公式,有什么問題,能不能用于實盤 [開拓者 TB]
- 咨詢內(nèi)容:
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; // 開倉后出現(xiàn)的最高價
NumericSeries LowestAfterEntry; // 開倉后出現(xiàn)的最低價
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技術(shù)人員:
high是動態(tài)的,high>***是確定的,不會最變,但是high<***就不確定了,所以信號會消失的。
- TB客服:
對于不妥的地方,希望大家作些改進意思
- 網(wǎng)友回復: 對于一些信號會消失的系統(tǒng),測試結(jié)果與現(xiàn)實會有一定的差異,結(jié)果是直接導致虧損
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 1145508240 進行 有償 編寫!(不貴!點擊查看價格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容