套利交易问题 [开拓者 TB]
- 咨询内容:
- Params
- Numeric Length(26);
- Numeric Offset(2);
- Numeric Lots0(1);
- Numeric Lots1(1);
- Vars
- NumericSeries OpenPrice;
- NumericSeries ClosePrice;
- NumericSeries UpLine; //上轨
- NumericSeries DownLine; //下轨
- NumericSeries MidLine; //中间线
- Numeric Band;
- Begin
-
-
-
- OpenPrice = Data0.Open- Data1.Open;
- ClosePrice = Data0.Close - Data1.Close;
-
-
- PlotNumeric("Open",OpenPrice);
- PlotNumeric("High",Max(ClosePrice,OpenPrice));
- PlotNumeric("Low",Min(ClosePrice,OpenPrice));
- PlotNumeric("Close",ClosePrice);
- PlotNumeric("MA",AverageFC(ClosePrice,Length));
-
- MidLine = AverageFC(ClosePrice,Length);
- Band = StandardDev(ClosePrice,Length,2);
- UpLine = MidLine + Offset * Band;
- DownLine = MidLine - Offset * Band;
- PlotNumeric("UpLine",UpLine);
- PlotNumeric("DownLine",DownLine);
- PlotNumeric("MidLine",MidLine);
-
-
-
- If(MarketPosition!=1 && CrossOver(ClosePrice[1],UpLine[1]))
- {
- DATA0.Buy(lots0,DATA0.open);
- DATA1.SellShort(lots1,DATA1.open);
- }
- If(MarketPosition!=-1 && CrossUnder(ClosePrice[1],DownLine[1]))
- { DATA1.Buy(lots1,DATA1.open);
- DATA0.SellShort(lots0,DATA0.open);
- }
- If( ClosePrice[1]<MidLine[1])
- {
- DATA0.SELL(lots0,DATA0.open);
- DATA1.BuyToCover(lots1,DATA1.open);
- }
- If( ClosePrice[1]>MidLine[1])
- {
- DATA1.SELL(lots1,DATA1.open);
- DATA0.BuyToCover(lots0,DATA0.open);}
- End
- Params
- TB技术人员:
关键是有时候可以正常交易,有时候不可以,很纠结啊
- TB客服:
无人解答啊
- 网友回复: TB开拓者的钱果然好赚啊
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 511411198 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容