The ATR indicator gives me decimal numbers. I want to get the parts after the comma as a whole number.how can I do that?

 

//for eample atrs return  0.02214,  0.2, 0.1957,0.34,0.1976 but ı want to   22140,20000, 19570,34000,19760



void OnTick()
  {
//---
  double PriceArray[];

int AverageTrueRangeDefination=iATR(_Symbol,_Period,14);

ArraySetAsSeries(PriceArray,true);

CopyBuffer(AverageTrueRangeDefination,0,0,3,PriceArray);

double AverageTrueRangeValue=NormalizeDouble(PriceArray[0],5);

Comment(" double atr= ",AverageTrueRangeValue);// for eample atrs return  0.02214,  0.2, 0.1957,0.34,0.1976 but ı want to   22140,20000, 19570,34000,19760
   
  }

 

Forum on trading, automated trading systems and testing trading strategies

When you post code please use the CODE button (Alt-S)!

Use the CODE button



 
  1. Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06
              Messages Editor

  2. Perhaps you should read the manual, especially the examples.
       How To Ask Questions The Smart Way. 2004
          How To Interpret Answers.
             RTFM and STFW: How To Tell You've Seriously Screwed Up.

    They all (including iCustom) return a handle (an int). You get that in OnInit. In OnTick (after the indicator has updated its buffers,) you use the handle, shift and count to get the data.
              Technical Indicators - Reference on algorithmic/automated trading language for MetaTrader 5
              Timeseries and Indicators Access / CopyBuffer - Reference on algorithmic/automated trading language for MetaTrader 5
              How to start with MQL5 - General - MQL5 programming forum - Page 3 #22 2020.03.08
              How to start with MQL5 - MetaTrader 5 - General - MQL5 programming forum - Page 7 #61 2020.07.05
              How to call indicators in MQL5 - MQL5 Articles 12 March 2010

  3.  atrs return  0.02214,  0.2, 0.1957,0.34,0.1976 but ı want to   22140,20000, 19570,34000,19760
    You do not want 22140, 20000, etc. ATR return a difference in prices (0.02214). If you want it in points (2214 or 221.4 on JPY pairs) divide by point.