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

Autotrade - MetaTrader 5용 expert

게시자:
Vladimir Karputov
조회수:
8766
평가:
(25)
게시됨:
2017.03.02 09:53
업데이트됨:
2018.06.25 15:20
Autotrade.mq5 (20.44 KB) 조회
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Two pending orders (BuyStop and SellStop) are placed with the specified expiration.

Author of the idea — John Smithauthor of the MQL5 code — barabashkakvn.  

Operation Start 

Placing two pending orders:

Autotrade start

Then we expect operation with only one position — if two positions are opened for any reason, both of them should be deleted:

//--- Control: the EA must work simultaneously with only one position
   if(total>1)
     {
      if(count_buy>1 || count_sell>1 || count_buy+count_sell>1)
        {
         CloseAllPositions(); // Close all positions if anything goes wrong
         return;              // Exit
        }
     }

Managing the open position.

First we check if minimum profit is reached. At the same time, the size of bar 1 must be less than "stabilization of points". If the condition is met, close the position and exit.

               if(m_position.Profit()>MinProfit && MathAbs(iClose(1)-iOpen(1))<=ExtStabilization)
                 {
                  m_trade.PositionClose(m_position.Ticket());
                  DeleteOrders(ORDER_TYPE_SELL_STOP);
                  return;
                 }

Second check — checking simultaneously if absolute profit or loss is reached. If condition is met, close the position.

               if(m_position.Profit()>=AbsoluteFixation || m_position.Profit()<=-AbsoluteFixation)
                 {
                  m_trade.PositionClose(m_position.Ticket());
                  DeleteOrders(ORDER_TYPE_SELL_STOP);
                 }

Results on  EURUSD, H1 from 2016.06.01 to 2016.12.21:

Autotrade test 

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

2MA_4Level 2MA_4Level

The Expert Advisor uses the values of two iMA (Moving Average, MA) indicators.

Altarius RSI Stohastic Altarius RSI Stohastic

Uses two iStochastic (Stochastic Oscillator) indicators and one iRSI (RSI, Relative Strength Index). Calculates the lot size based on the analysis of closed trades.

BIG DOG BIG DOG

The EA places pending stop orders BUY_STOP and SELL_STOP.

Reconstruction of positions Reconstruction of positions

An example of working with the trading history on Hedge accounts — reconstruction of positions.