Forum

Access ATR Value

HI. I want to build an expert advisor that will automatically set my SL to 2xATR of the position I'm in Tried a few things but they didn't work Any kind of help is much appreciated

MQL5 ATR Based Position Size Calculator

GREETINGS So should the price hit our Stoploss, we lose 2% of our equity The formula to calculating the proper lot size is Equity*Risk/Stoploss Now our Stoploss is going to be 2*ATR Value I've been trying to turn all this into an MQL5 code PROBLEM: When I set the SL to a number (e.g. 50), the EA