거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Facebook에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
당사 팬 페이지에 가입하십시오
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
- 게시자:
- Kailash Bai Mina
- 조회수:
- 8617
- 평가:
- 게시됨:
- 2021.11.09 00:52
- 업데이트됨:
- 2022.03.03 08:13
-
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동
//+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void TrailingStep(double trailingStepStartPips, double _trailingStepPips, double initialStopLossInPips=0, bool useSymbol=false, bool useMagicNumber=false, int _magicNumber=0, bool initialStopLossWillBeDone=true) { for(int i=OrdersTotal()-1; i>=0; i--) { if(OrderSelect(i,SELECT_BY_POS)) { bool magic = (useMagicNumber) ? (OrderMagicNumber()==_magicNumber) : true; bool symbol = (useSymbol) ? (OrderSymbol()==Symbol()) : true; if(!magic || !symbol) continue; if(OrderType() == OP_BUY) { if(OrderStopLoss() >= NormalizeDouble(OrderOpenPrice() + initialStopLossInPips*_Point*10,_Digits) && OrderStopLoss() != 0) {//OrderStopLoss() != 0 is not necessary here cause in Buy NULL SL is Zero and 0 Will never be grater than Order Open Price + Jobhi hai if(Bid - OrderStopLoss() > _trailingStepPips * Point() * 10) { if(NormalizeDouble(OrderStopLoss(),_Digits) != NormalizeDouble(OrderStopLoss() + _trailingStepPips * Point() * 10,_Digits)) { ResetLastError(); if(!OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(OrderStopLoss() + _trailingStepPips * Point() * 10,_Digits), OrderTakeProfit(), 0)) { Print("ERROR:"," Order Modify Failed: ",_LastError," || Function Name: ",__FUNCTION__," || Line Number: ",__LINE__); } } } } else if(initialStopLossWillBeDone && OrderStopLoss() < NormalizeDouble(OrderOpenPrice() + initialStopLossInPips*_Point*10,_Digits)){ if(Bid - OrderOpenPrice() >= trailingStepStartPips * Point() * 10) { if(OrderStopLoss() != NormalizeDouble(OrderOpenPrice() + initialStopLossInPips*_Point*10,_Digits)) { ResetLastError(); if(!OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(OrderOpenPrice() + initialStopLossInPips*_Point*10,_Digits), OrderTakeProfit(), 0)) { Print("ERROR:"," Order Modify Failed: ",_LastError," || Function Name: ",__FUNCTION__," || Line Number: ",__LINE__); } } } } } if(OrderType() == OP_SELL) { if(OrderStopLoss() <= NormalizeDouble(OrderOpenPrice() - initialStopLossInPips*_Point*10,_Digits) && OrderStopLoss() != 0) {//OrderStopLoss() != 0 is necessary here cause in Sell NULL SL is Zero and 0 Will Always be Lower than Order Open Price - Jobhi hai if(OrderStopLoss() - Bid > _trailingStepPips * Point() * 10) { if(NormalizeDouble(OrderStopLoss(),_Digits) != NormalizeDouble(OrderStopLoss() - _trailingStepPips * Point() * 10,_Digits)) { ResetLastError(); if(!OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(OrderStopLoss() - _trailingStepPips * Point() * 10,_Digits), OrderTakeProfit(), 0)) { Print("ERROR:"," Order Modify Failed: ",_LastError," || Function Name: ",__FUNCTION__," || Line Number: ",__LINE__); } } } } else if(initialStopLossWillBeDone && (OrderStopLoss() > NormalizeDouble(OrderOpenPrice() - initialStopLossInPips*_Point*10,_Digits) || OrderStopLoss()==0)) { if(OrderOpenPrice() - Bid >= trailingStepStartPips * Point() * 10) { if(OrderStopLoss() != NormalizeDouble(OrderOpenPrice() - Bid >= _trailingStepPips * Point() * 10,_Digits)) { ResetLastError(); if(!OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(OrderOpenPrice() - initialStopLossInPips*_Point*10,_Digits), OrderTakeProfit(), 0)) { Print("ERROR:"," Order Modify Failed: ",_LastError," || Function Name: ",__FUNCTION__," || Line Number: ",__LINE__); } } } } } } } }
![Trailing Function](https://c.mql5.com/i/code/script.png)
This Is a Normal Trailing Function For All Open Order In MT4.
![Correlation Calculator Panel](https://c.mql5.com/i/code/indicator.png)
Calculator
![DMH](https://c.mql5.com/i/code/indicator.png)
Directional Movement using Hann windowing - metatrader 4 version
![Limit channels](https://c.mql5.com/i/code/indicator.png)
ATR based limit channels - metatrader 4 version