거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Telegram에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
Experts

Nevalyashka_BreakdownLevel - MetaTrader 5용 expert

게시자:
Vladimir Karputov
조회수:
5131
평가:
(29)
게시됨:
2017.08.10 12:51
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Author of the idea — Vladimir Khlystovauthor of the MQL5 code — barabashkakvn.

Trading strategy: the breakout of a High/Low in the selected time interval. To recover losing positions, the EA uses the "Nevalyashka" strategy and a martingale technique to increase the lot.

The EA calculates the High and Low price in the specified time interval from "Time start" to "Time end":

Nevalyashka BreakdownLevel

If the price exceeds the High of this period, a BUY position is opened. If the price is below the Low, a SELL position is opened. StopLoss is set at an opposite border of the period, i.e. at a Low price for BUY positions and at a High price for SELL positions. TakeProfit is set based on the height of the control period.

If "Use time close" is set to true, the "Time close" parameter (time to close all positions) will be active.

Only hours and minutes are taken into account for parameters  "Time start""Time end" and "Time close".

Closure by StopLoss is monitored in OnTradeTransaction.

When "DEAL_ENTRY_OUT" (en: "Entry out") is found, check the comment field of this deal. If the comment contains "sl", it means the deal was closed by StopLoss:

      if(deal_symbol==m_symbol.Name() && deal_magic==m_magic)
         if(deal_entry==DEAL_ENTRY_OUT)
           {
            MqlDateTime str1;
            TimeToStruct(TimeCurrent(),str1);
            //--- there is a chance that this was a closure on the TakeProfit
            if(StringFind(deal_comment,"tp",0)!=-1 || deal_profit>=0.0)
              {
               TradeDey=str1.day;
               return;
              }
            //--- there is a chance that this was a closure on the StopLoss
            if(StringFind(deal_comment,"sl",0)!=-1)
              {
               if(TradeDey!=str1.day)
                 {
                  Print("A StopLoss closure has been detected!");

                  double loss=MathAbs(deal_profit/m_symbol.TickValue()/deal_volume);

                  if(deal_type==DEAL_TYPE_SELL) // the buy position is closed
                    {
                     double SL=m_symbol.Bid()+loss*m_symbol.Point();
                     double TP=m_symbol.Bid()-loss*m_symbol.Point();
                     double Lot=LotCheck(deal_volume*InpK_martin);
                     if(Lot==0.0)
                        return;
                     OpenSell(SL,TP,Lot,"Nevalyashka");

                    }
                  if(deal_type==DEAL_TYPE_BUY) // the sell position is closed
                    {
                     double SL=m_symbol.Ask()-loss*m_symbol.Point();
                     double TP=m_symbol.Ask()+loss*m_symbol.Point();
                     double Lot=LotCheck(deal_volume*InpK_martin);
                     if(Lot==0.0)
                        return;
                     OpenBuy(SL,TP,Lot,"Nevalyashka");
                    }
                  return;
                 }
              }
           }

Open a position opposite to the closed one (if the deal type is "DEAL_TYPE_SELL", then a BUY position was closed; "DEAL_TYPE_BUY" means that a SELL position was closed), with an increased lot multiplied by K. martin. If a position was closed with a positive profit, the Expert Advisor waits for the start time of the next period "Time end", and repeats the above procedure.

 "No loss" parameter means the breakeven; when half of position profit is reached, StopLoss is moved to the position open price.

Example if testing on EURUSD,M30:

Nevalyashka BreakdownLevel test EURUSD M30

MetaQuotes Ltd에서 러시아어로 번역함.
원본 코드: https://www.mql5.com/ru/code/18645

Boa_ZigZag_Arrows_HTF Boa_ZigZag_Arrows_HTF

The Boa_ZigZag_Arrows indicator with the timeframe selection option available in the indicator input parameters.

AutoTradeLevels AutoTradeLevels

The indicator marks all performed trades with short horizontal lines.

Boa_ZigZag_channel Boa_ZigZag_channel

A channel based on peaks and troughs of Boa_ZigZag

ZigZag_channel ZigZag_channel

A channel based on peaks and troughs of the ZigZag indicator.