請(qǐng)各位大師們幫助看討論一下這個(gè)公式,有什么問(wèn)題,能不能用于實(shí)盤 [開拓者 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; // 開倉(cāng)后出現(xiàn)的最高價(jià)
NumericSeries LowestAfterEntry; // 開倉(cāng)后出現(xiàn)的最低價(jià)
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)//多倉(cāng)
{
If(High>=ma1&&(High>HighestAfterEntry[1]))//增倉(cāng)
{ MyEntryPrice=Open;
Buy(Lots,Open);
HighestAfterEntry=High;
Commentary("增倉(cāng): "+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]))//未突破前期低位增倉(cāng)
{
MyEntryPrice=Open;
Buy(1,MyEntryPrice);
}
}else If(MarketPosition==-1)//空倉(cāng)
{
If(Low<ma1&&(Low<LowestAfterEntry[1]))//增倉(cāng)
{
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]))//未突破前期低位增倉(cāng)
{
MyEntryPrice=Open;
SellShort(1,MyEntryPrice);
}
}
}
End
- TB技術(shù)人員:
high是動(dòng)態(tài)的,high>***是確定的,不會(huì)最變,但是high<***就不確定了,所以信號(hào)會(huì)消失的。
- TB客服:
對(duì)于不妥的地方,希望大家作些改進(jìn)意思
- 網(wǎng)友回復(fù): 對(duì)于一些信號(hào)會(huì)消失的系統(tǒng),測(cè)試結(jié)果與現(xiàn)實(shí)會(huì)有一定的差異,結(jié)果是直接導(dǎo)致虧損
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 1145508240 進(jìn)行 有償 編寫!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒(méi)有相關(guān)內(nèi)容