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

XATRStopLevel - MetaTrader 5 Script | Forex Indicator Download - MT4/MT5 Resources

author EAcpu | 2 reads | 0 comments |

XATRStopLevel - indicator for MetaTrader 5

Real author:

Sovpel Alexander

This indicator gives the stop loss value of open positions based on the following indicator: XATR indicator.

Thanks to the information about current market fluctuations, we can develop adaptive stops.

Average target and adaptive stop loss

We can use the average trading range over a period of time (average true range) and multiply that value by some constant (factor) to determine how far away from our entry position we can place a stop loss order. The advantage of using a stop loss based on the average true range is that it is highly adaptable to current market conditions. The distance from entry point to exit point increases during periods of greater market volatility and decreases during periods of less market volatility. Therefore, adaptive stops are an excellent way to manage risk in terms of changing market volatility.

The indicator was first implemented in MQL4 and released in the code base on September 25, 2009.

The indicator uses the SmoothAlgorithms.mqh library class (must be copied to terminal_data_folder\MQL5\Include). The use of the class "Average price series for intermediate calculations without using additional buffers" is described in detail in the article.

The indicator uses the library's class to get the font name.mqh (must be copied to terminal_data_folder\MQL5\Include).

XATRStopLevel - indicator for MetaTrader 5

Figure 1 XATRStopLevel indicator


Attachment download

📎 getfontname.mqh (5.13 KB)

📎 smoothalgorithms.mqh (133.8 KB)

📎 xatrstoplevel.mq5 (9.84 KB)

Source: MQL5 #1262

Verification code Refresh