您現在的位置:程序化交易>> 外匯現貨>> MT4>> MT4公式>>正文內容

MT4 dual thrust系統原形源碼[MT4公式]

         //dual thrust系統原形源碼
 

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 Open of next bar + BuyTrig Stop;

Sell at Open of next bar - SellTrig Stop;

End;

If MarketPosition = -1 Then Begin

Buy at Open of next bar + Buytrig Stop;

End;

If MarketPosition = 1 Then Begin

Sell at Open of next bar - SellTrig Stop;

End;

End;

 

有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友

可聯系技術人員 QQ: 262069696  點擊在線交流進行 有償 編寫!不貴!點擊查看價格!

 


【字體: 】【打印文章】【查看評論

相關文章

    沒有相關內容
  新疆18选7基本走势带坐标