哎呦 [開(kāi)拓者 TB]
- 咨詢(xún)內(nèi)容:
本帖最后由 haoliangbohai 于 2014-11-28 16:04 編輯
關(guān)于oops交易系統(tǒng),就是跳空回調(diào)后買(mǎi)入。 勝率挺高的,優(yōu)化后能到60%以上,盈利能力也可以。就是交易次數(shù)有點(diǎn)少。就算在《完美的日內(nèi)交易商2》書(shū)中給出的例子,82年4月到98年交易SP500也才177次。可以做為策略池中的一個(gè)。針對(duì)一日的缺口的代碼:- Params
- Numeric gapsize(2); //缺口大小
- Numeric breaksize(3); //突破大小
- Numeric stoploss(10); //止損
- Numeric takeprofit(20); //止盈
- Vars
- Bool isgap;
- Bool temp;
- Numeric enterprice;
- NumericSeries HighestAfterEntry(0);
- NumericSeries LowestAfterEntry(0);
- Begin
- isgap = OpenD(0)>HighD(1)+gapsize; //高開(kāi)
- temp = Low<HighD(1)-breaksize; //跌破前日最高價(jià)
- enterprice = HighD(1)-breaksize-2;
- If(isgap And temp And MarketPosition==0)
- {
- SellShort(1,enterprice);
- LowestAfterEntry=Low;
- }
- isgap = OpenD(0)<LowD(1)-gapsize; //低開(kāi)
- temp = High>LowD(1)+breaksize; //漲破前日最低價(jià)
- enterprice = LowD(1)+breaksize+2;
- If(isgap And temp And MarketPosition==0)
- {
- Buy(1,enterprice);
- HighestAfterEntry=High;
- }
- /*止損止盈部分*/
- If (MarketPosition!=0 And BarsSinceEntry!=0)
- {
- If(MarketPosition==-1)
- {
- LowestAfterEntry = Min(LowestAfterEntry,Low);
- If(High>EntryPrice And LowestAfterEntry>EntryPrice-takeprofit)
- {
- BuyToCover(1,EntryPrice-takeprofit); //空單止盈
- LowestAfterEntry=0;
- } Else If(High>EntryPrice+stoploss) //空單止損
- {
- BuyToCover(1,EntryPrice+stoploss);
- LowestAfterEntry=0;
- }
- }
- If(MarketPosition==1)
- {
- HighestAfterEntry = Max(HighestAfterEntry,High);
- If(Low<EntryPrice And HighestAfterEntry>EntryPrice+takeprofit)
- {
- Sell(1,EntryPrice+takeprofit); //多單止盈
- LowestAfterEntry=0;
- } Else If(Low<EntryPrice-stoploss)
- {
- Sell(1,EntryPrice-stoploss); //多單止損
- LowestAfterEntry=0;
- }
- }
- If((Date[-1]!=InvalidInteger && Date!=Date[-1])||(Date[-1]==InvalidInteger && Date < CurrentDate)) //當(dāng)日平倉(cāng)
- {
- Sell(1,Close);
- BuyToCover(1,Close);
- }
- }
- End
- Params
- TB技術(shù)人員:
謝謝!先頂后看
- TB客服:
這個(gè)系統(tǒng)很有名,謝謝分享
- 網(wǎng)友回復(fù):
開(kāi)盤(pán)區(qū)間突破交易系統(tǒng)
發(fā)現(xiàn)這個(gè)很好用啊,開(kāi)始還挺鄙視這種交易系統(tǒng),認(rèn)為太簡(jiǎn)單了,看過(guò) 拉里.威廉斯的《短線(xiàn)交易秘訣》后感覺(jué)還挺好用的。比上一個(gè)好用多了。如果能夠把日趨勢(shì)考慮進(jìn)去,做到日間的,收益率感覺(jué)還能上去。看的比較粗糙,分別用前一日開(kāi)盤(pán)和收盤(pán)的差,以及最高和最低差表示波幅回測(cè)了下,發(fā)現(xiàn)用最高價(jià)最低價(jià)的差乘以0.25為區(qū)間效果不錯(cuò)。感覺(jué)以這個(gè)為基礎(chǔ)可以實(shí)盤(pán)模擬啊。- Params
- Numeric perc(0.1);
- Numeric stoploss(10); //止損
- Numeric takeprofit(20); //止盈
-
- Vars
- Bool con1; //開(kāi)多條件
- Bool con2; //開(kāi)空條件
- Numeric enterprice;
- NumericSeries HighestAfterEntry(0);
- NumericSeries LowestAfterEntry(0);
- Begin
- con1 = high > OpenD(0) + perc*Abs(HighD(1)-LowD(1)); //先用開(kāi)盤(pán)收盤(pán)表示前一日波幅
- con2 = Low < OpenD(0) - perc*Abs(HighD(1)-LowD(1));
- If(MarketPosition==0 And con1)
- {
- Buy(1,OpenD(0) + perc*Abs(OpenD(1)-CloseD(1)));
- HighestAfterEntry=High;
- }
- If(MarketPosition==0 And con2)
- {
- SellShort(1,OpenD(0) - perc*Abs(OpenD(1)-CloseD(1)));
- LowestAfterEntry=Low;
- }
-
- /*止損止盈部分*/
- If (MarketPosition!=0 And BarsSinceEntry!=0)
- {
- If(MarketPosition==-1)
- {
- LowestAfterEntry = Min(LowestAfterEntry,Low);
- If(High>EntryPrice And LowestAfterEntry>EntryPrice-takeprofit)
- {
- BuyToCover(1,EntryPrice-takeprofit); //空單止盈
- LowestAfterEntry=0;
- } Else If(High>EntryPrice+stoploss) //空單止損
- {
- BuyToCover(1,EntryPrice+stoploss);
- LowestAfterEntry=0;
- }
- }
- If(MarketPosition==1)
- {
- HighestAfterEntry = Max(HighestAfterEntry,High);
- If(Low<EntryPrice And HighestAfterEntry>EntryPrice+takeprofit)
- {
- Sell(1,EntryPrice+takeprofit); //多單止盈
- LowestAfterEntry=0;
- } Else If(Low<EntryPrice-stoploss)
- {
- Sell(1,EntryPrice-stoploss); //多單止損
- LowestAfterEntry=0;
- }
- }
- If((Date[-1]!=InvalidInteger && Date!=Date[-1])||(Date[-1]==InvalidInteger && Date < CurrentDate)) //當(dāng)日平倉(cāng)
- {
- Sell(1,Close);
- BuyToCover(1,Close);
- }
- }
- End
- Params
- 網(wǎng)友回復(fù):
本帖最后由 趨勢(shì)跟蹤 于 2014-11-22 08:02 編輯
四樓的源碼雖然有點(diǎn)問(wèn)題,但源碼一定要頂!
有思路,想編寫(xiě)各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 1145508240 進(jìn)行 有償 編寫(xiě)!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒(méi)有相關(guān)內(nèi)容