How can I get +DI and -DI review of ADX indicator?

 
handleAdx = iADX(_Symbol, _Period, 14);


I can get the main ADX value. But I need +DI and - DI values. Is there a way to get these values without calculating manually?

 
guga19:

With,

handleAdx = iADX(_Symbol, _Period, 14);


I can get the main ADX value. But I need +DI and - DI values. Is there a way to get these values without calculating manually?

You show how to get the handle, not how to get the ADX value.

Read the documentation.

iADX

The buffer numbers are the following: 0 - MAIN_LINE, 1 - PLUSDI_LINE, 2 - MINUSDI_LINE.


 
Keith Watford #:

You show how to get the handle, not how to get the ADX value.

Read the documentation.


int handleADX;

handleAdx = iADX(_Symbol, _Period, 14);


Isn't it like that?

I copied handleADX to an array with CopyBuffer and when I printed any value of the array I could only get the ADX value.

I didn't understand what I was missing.


EDIT :  I think I got it, I'll give it a try. I'll edit here if I can.

 
Look into the ADX code from the folder Examples: How many buffer does the indicator have? How are they initialised through SetIndexBuffer? Which buffer is which index number? These are the buffer numbers you need for copying the buffers. Try it and if you have questions show your attempt.
 
guga19 #: I copied handleADX to an array with CopyBuffer and when I printed any value of the array I could only get the ADX value.
  1. You don't copy the handle at all. You use the handle with CopyBuffer. Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the source file.
         How To Ask Questions The Smart Way. (2004)
              Be precise and informative about your problem

    We can't see your broken code.

  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/OnCalculate (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)
              How to start with MQL5 - MetaTrader 5 - General - MQL5 programming forum - Page 7 #61 (2020)
              MQL5 for Newbies: Guide to Using Technical Indicators in Expert Advisors - MQL5 Articles (2010)
              How to call indicators in MQL5 - MQL5 Articles (2010)

 
CopyBuffer(iADXWilder(_Symbol,_Period,1),0,0,Bars(_Symbol,_Period),adx__);
   CopyBuffer(iADXWilder(_Symbol,_Period,1),1,0,Bars(_Symbol,_Period),adx_p);
   CopyBuffer(iADXWilder(_Symbol,_Period,1),2,0,Bars(_Symbol,_Period),adx_m);