Watch how to download trading robots for free
Find us on Telegram!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Experts

Expert_RSI_Stochastic_MA - expert for MetaTrader 5

Published by:
Vladimir Karputov
Views:
8399
Rating:
(31)
Published:
2017.08.10 12:54
Updated:
2018.06.27 13:21
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

The author of the idea is Oksana Berenko, and the author of the mq5 code is barabashkakvn.

The Expert Advisor uses three indicators: MA(150), RSI(3) with levels 80 and 20, Stochastic(6, 3, 3) with levels 70 and 30. You can change these parameters and set your own values. 

1. Trade entry direction is determined based on MA (Moving Average). Only one trade is opened in one direction.

  • If Bid > MA, consider the buy direction.
  • If Ask < MA, consider the sell direction.

2. Position entry is performed when RSI and Stochastic conditions are met.

  • Buy if RSI and Stochastic are below the lower level, i.e. RSI < 20 and Stochastic < 30.
  • Sell if RSI and Stochastic are above the upper level, i.e. RSI > 80 and Stochastic > 70.

3. Exit is based on Stochastic.

Exit with profit points.

  • (Trailing Stop = 0) If Trailing Stop is set to zero, close a position upon reaching the opposite Stochastic level, if the trade has a certain profit in points.

b) Close BUY if Stochastic > 70 and OpenPrice <= Bid 
s) Close SELL if Stochastic < 30 and OpenPrice >= Ask

  • (Trailing Stop > 0) If the Trailing Stop value is specified, then once the opposite Stochastic level is reached, the position Stop Loss will be trailed at the opening of each new candlestick, keeping the specified distance form the price. Note that in this case a position can be closed with a loss, since Stop Loss sometimes is not immediately moved to a breakeven level.

Closing with a loss in points.

  • (allow Loss = 0) If 'allow Loss' is set to 0, close a position upon reaching the opposite Stochastic level, if the trade has a certain loss in points.

b) Close BUY if Stochastic > 70 and OpenPrice > Bid 
s) Close SELL if Stochastic < 30 and OpenPrice < Ask

  • (allow Loss > 0) If 'allow Loss' is specified, and we have exited the position entry zone as per Stochastic, while a trade has a loss specified in points or even more, the position is closed.
b) Close BUY if Stochastic > 30 and OpenPrice - Bid >= allow Loss in points
b) Close SELL if Stochastic < 70 and Ask - OpenPrice >= allow Loss in points

Expert_RSI_Stochastic_MA

Testing on EURUSD,H1:

Expert_RSI_Stochastic_MA EURUSD_H1

Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/18671

Color_QEMA_Envelopes_Digit_HTF Color_QEMA_Envelopes_Digit_HTF

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

Color_PEMA_Envelopes_Digit_HTF Color_PEMA_Envelopes_Digit_HTF

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

StopATR_auto StopATR_auto

Automated calculation of Stop Loss levels based on the ATR indicator.

ExpertClor_v01 ExpertClor_v01

An assistant Expert Advisor. Only CLOSING positions.