Join our fan page
- Views:
- 117
- Rating:
- Published:
-
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance
The conditions for entering a trade are strictly formalized. For a buy, it requires that on H1 and D1, the RSI value (based on the completed candle) is above the oversold level (default 20) and that the current RSI value is greater than the previous one, indicating an upward impulse. For a sell, similarly: the RSI on both timeframes must be below the overbought level (80) and the current value must be less than the previous one, signaling a downward movement. Using completed bars eliminates the redrawing effect, as the signal is formed after the candle finishes forming.
Position management is implemented on a "one position per instrument" basis. The expert monitors for open orders with its magic number. If a buy signal appears while a sell is open, the sell is closed, and a buy is opened. The same logic applies for a sell signal. Thus, the robot is always either out of the market or in a position whose direction aligns with the most recently generated signal.
An important feature is the automatic adjustment of the trading volume according to the broker's requirements. During initialization, the robot rounds the specified lot to the nearest allowable volume step and checks that it is not less than the minimum allowed. This ensures correct operation on any account. Overall, the strategy represents a simple and clear approach to RSI trading, based on confirming signals with a higher timeframe.
Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/70467
Volatility Oscillator
The current bar volatility is measured to previous 100 bars in Standard Deviations statistical measure. That may serve as a minimum requirement for trade entry or exit. Indicator can also show divergences.
Auto Fibonacci Retracement Levels MT4
Automatically draws Fibonacci retracement and extension levels based on the most recent ZigZag swing high and low. Updates dynamically as new swing points form.
Three Colors
Example: Moving Average indicator filling by different colors
MACD Sample
Classical MACD Sample.
