Print("ATR: " + iATR(NULL, PERIOD_D1,14,0)/PipValue);The problem is what you didn't show - the value of PipValue. https://www.mql5.com/en/forum/141509
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am trying to establish the ATR as a whole number, rather than e.g. 0.00100 (ATR being 10 in this case). So far I have tried the following code all which produce 0.0xxxxx ATR values. I can use the decimal values fine to place a stop loss (Ask - ATR value) but when I need to calculate the risk for the lot size I need the ATR as a whole number to divide with the amount of equity being risked per trade. SO if the ATR was 0.00200 (twenty) then as a whole number this would be produced as 20 which would then allow me to divide it with the $x,xxx amount being risked for trade to get lot sizes (e.g. $20,000 / 20 = $ value per lot). I hope that I have explained clearly and would appreciate any feedback! Thanks guys.