- UID
- 2
- 积分
- 2892617
- 威望
- 1396340 布
- 龙e币
- 1496277 刀
- 在线时间
- 13326 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2024-12-25
|
Dual Thrust策略 [MC模型源码]
- [LegacyColorValue = TRUE];
- Inputs: K1(.5),K2(.5),Mday(1),Nday(1);
- Vars: BuyRange(0), SellRange(0);
- Vars: BuyTrig(0),SellTrig(0);
- Vars: HH(0),LL(0),HC(0),LC(0);
- If CurrentBar > 1 Then Begin
- HH = Highest(High,Mday);
- HC = Highest(Close,Mday);
- LL = Lowest(Low,Mday);
- LC = Lowest(Close,Mday);
- If (HH - LC) >= (HC - LL) Then Begin
- SellRange = HH - LC;
- End Else Begin
- SellRange = HC - LL;
- End;
- HH = Highest(High,Nday);
- HC = Highest(Close,Nday);
- LL = Lowest(Low,Nday);
- LC = Lowest(Close,Nday);
- If (HH - LC) >= (HC - LL) Then Begin
- BuyRange = HH - LC;
- End Else Begin
- BuyRange = HC - LL;
- End;
- BuyTrig = K1*BuyRange;
- SellTrig = K2*SellRange;
- If MarketPosition = 0 Then Begin
- Buy at next bar Open of next bar + BuyTrig Stop;
- Sell at next bar Open of next bar - SellTrig Stop;
- End;
- If MarketPosition = -1 Then Begin
- Buy at next bar Open of next bar + Buytrig Stop;
- End;
- If MarketPosition = 1 Then Begin
- Sell at next bar Open of next bar - SellTrig Stop;
- End;
- End;
-
复制代码 |
论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
|