Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

freeman - MetaTrader 5 Expert - MQL5 #22261 - MT4/MT5 Resources

author EAcpu | 2 reads | 0 comments |

freeman - expert for MetaTrader 5

freeman - expert for MetaTrader 5

freeman - expert for MetaTrader 5

Author of the idea - VG

mq5 code author - Bara Bashkakon

NOTE: Applies to offset accounts only! Dragnets are strictly prohibited!

Stop Loss and Take Profit calculations are dynamically based on the iATR (Average True Range, ATR) indicator - the indicator value on bar #0 multiplied by the Stop Loss (used to obtain Stop Loss) and Take Profit (used to obtain Take Profit) ratios.

If there are multiple open positions and no order locks it, check the possibility of averaging the positions:

Distances are reduced to standard values ​​for four-digit pairs.

The opening volume can be constant or dynamically calculated:

Trailing is a stop-loss move tool that acts as breakeven (during the first position modification) and trailing (for subsequent modifications). Trailing stop is the minimum distance from the modified price to the stop, and trailing step is a trailing step. Both parameters are reduced to standard values ​​of four-digit pairs.

Bar control parameters define EA operation: only when a new bar appears (" true ") or within the bar (" wrong ").

Trend filter compares the iMA (Moving Average, MA) value on the current bar ( current bar ) with its value on the previous bar ( current bar - 1)

The minimum distance between price and indicator MA . For a buy position, the MA should be below the price, and for a sell position, the MA should be above the price.

The RSI filter is based on comparing the iRSI (Relative Strength Index, RSI) indicator value on the current bar ( current bar ) with rising RSI levels and falling RSI levels . For a sell position signal, the RSI should rise above the RSI level , while for a buy it should fall below the RSI level .

If there are open contracts and the last closing price in the same direction is a loss closing price, this is a prerequisite for locking the position. Let's check it out:

Detection of position closing time is performed in OnTradeTransaction.

freeman - expert for MetaTrader 5


Attachment download

📎 freeman.mq5 (69.18 KB)

Source: MQL5 #22261

Verification code Refresh