Guarda come scaricare robot di trading gratuitamente
Ci trovi su Twitter!
Unisciti alla nostra fan page
Script interessante?
Pubblica il link!
lasciare che altri lo valutino
Ti è piaciuto lo script? Provalo nel Terminale MetaTrader 5
Sistemi Esperti

SimpleTrade - sistema esperto per MetaTrader 5

Pubblicati da::
Vladimir Karputov
Visualizzazioni:
3360
Valutazioni:
(17)
Pubblicato:
2017.03.02 09:55
Aggiornato:
2018.02.15 17:22
Hai bisogno di un robot o indicatore basato su questo codice? Ordinalo su Freelance Vai a Freelance

The Expert Advisor compares open prices of the zero and third bar.

Author of the idea is Oleksandrauthor of the MQL5 code is barabashkakvn.   

Condition to open a Buy position:

         if(iOpen(0)>iOpen(3))

- If the opening price of a zero bar is higher than the opening price of the third bar.

Condition to open a Sell position:

         if(iOpen(0)<=iOpen(3))

- If the opening price of a zero bar is less than or equal the opening price of the third bar.

SimpleTrade Sell
 

Position is closed by StopLoss or at the beginning of the next bar:

SimpleTrade Close All 

Since the EA works at the moment of emergence of a new bar, it is equipped with several protection steps — so as to avoid missing a whole bar due to possible position opening errors.

For example, if we cannot update the current prices, we should then reset the timer (static variable):

            //--- Since we work on a new bar, if refresh of current
            //--- prices fails, reset the timer
            if(!RefreshRates())
              {
               curTime=iTime(1);
               return;
              }

Also we check the result of the trading operation:

  1. The Buy or Sell method must return true
    1. and the ResultDeal method should return a non-zero value
if an error occurs, we reset the timer:

         if(iOpen(0)<=iOpen(3))
           {
            //--- Since we work on a new bar, if refresh of current
            //--- prices fails, reset the timer
            if(!RefreshRates())
              {
               curTime=iTime(1);
               return;
              }
            //--- Since we work on a new bar, if if a trade operation fails,
            //--- reset the timer
            if(m_trade.Sell(Lots,NULL,m_symbol.Bid(),m_symbol.Ask()+StopLoss*m_adjusted_point))
               if(m_trade.ResultDeal()!=0)
                  return;
            curTime=iTime(1);
            return;
           }

 

Tradotto dal russo da MetaQuotes Ltd.
Codice originale https://www.mql5.com/ru/code/17274

NRTR GATOR NRTR GATOR

Derived from the NRTR indicator, provided with a new visual display.

AIS1 AIS1

The EA works based on the analysis of Open, High and Low.

Lucky Lucky

A tick Expert Advisor. It compares the price on the previous tick and the current price.

21hour 21hour

The Expert Advisor places two pending orders at a certain time.