開拓者 TB 10倍20倍均線交易策略模型 簡單可參考[開拓者公式]
- 思路內容:
若10倍均線大于20倍均線,且20倍均線大于30倍均線,則在5倍均線上穿10倍均線時買入。上漲30個點止盈,或者股價下穿10倍均線止損。
若10倍均線小于20倍均線,且20倍均線小于30倍均線,則在5倍均線下穿10倍均線時賣出。下跌30個點止盈,或者股價上穿10倍均線止損。
僅供參考
- 源碼:
- Params
- Numeric N5(5);
- Numeric N10(10);
- Numeric N20(20);
- Numeric N30(30);
- Numeric stopline(30);
- Vars
- NumericSeries MA5;
- NumericSeries MA10;
- NumericSeries MA20;
- NumericSeries MA30;
- NumericSeries MyPrice;
- //
- Begin
- ma5=AverageFC(close,N5);
- ma10=AverageFC(close,n10);
- ma20=AverageFC(close,n20);
- ma30=AverageFC(close,n30);
- PlotNumeric("MA5",MA5);
- PlotNumeric("MA10",MA10);
- PlotNumeric("MA20",MA20);
- PlotNumeric("MA30",MA30);
- If(ma10[1]>ma20[1] And ma20[1]>ma30[1] And MA5[2]<ma10[2] And MA5[1]>ma10[1])
- {
- MyPrice=Open;
- Buy(1,MyPrice);
- }
- If(MarketPosition==1 And BarsSinceEntry>0)
- {
- If(High>=MyPrice+stopline)
- {
- Sell(1,MyPrice+stopline);
- Return;
- }
- else If(Low<=ma10)
- {
- MyPrice=MA10;
- If(MyPrice>Open)MyPrice=Open;
- Sell(1,MyPrice);
- }
- }
- If(ma10[1]<ma20[1] And ma20[1]<ma30[1] And MA5[2]>ma10[2] And MA5[1]<ma10[1])
- {
- MyPrice=Open;
- SellShort(1,MyPrice);
- }
- If(MarketPosition==-1 And BarsSinceEntry>0)
- {
- If(Low<=MyPrice-stopline)
- {
- BuyToCover(1,MyPrice-stopline);
- Return;
- }
- else If(High>=MA10)
- {
- MyPrice=MA10;
- If(MyPrice<Open)MyPrice=Open;
- BuyToCover(1,MyPrice);
- }
- }
- End
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 262069696 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容