Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Current value of a XXX (int) period ADX using high price type

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Current value of a XXX (int) period ADX using high price type

    Hello!

    I am trying to get the the current vlues of x period ADX using high and low price types. For this ppurpuse I have used a loop.

    for int ( i = 100; i >= 0; i--)
    {
    double val1 = ADX(High, ADXbars)[i - 1];
    double val2 = ADX(Low, ADXbars)[i - 1];
    }


    I have seen at output that val1 and val2 are identic. For each incrementation I obtain for given position "i" the same value for val1 and val2, But I am wondering why both values are identic.
    In the documentation we have: double value = ADX(High, 20)[0]; meaning the current value of a 20 period ADX using high price type.
    My val1 should be therefore the value at position [i -1] of ADXBars (int) period using high price type, while val2 represents the value at position [i -1] of ADXBars (int) period using Low price type.
    What is wrong in my calculation so that val1 and val2 are identic?

    Thanks!

    #2
    Hello Stanfillirenfro,

    I see the sample that you are referring to, I went ahead and reported the inconsistency. Not all indicators take an input which the ADX is one that does not take input.

    You would need to make a custom ADX for that type of comparison and use Input in the ADX logic. In your demonstration it will be using the series which called the ADX indicator and its OHLC values, in that use those would be the same values.

    https://ninjatrader.com/support/help...lightsub=Input

    I have attached a sample of one way to use input in the ADX, you can of course modify the script further as needed for your use cases.



    I look forward to being of further assistance.
    Attached Files
    JesseNinjaTrader Customer Service

    Comment


      #3
      Many thanks Jesse for your reply.

      I will revert to you after going through your advices.

      Thanks!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by maiyudse, Today, 12:57 AM
      0 responses
      1 view
      0 likes
      Last Post maiyudse  
      Started by SmartArtsStudio, Yesterday, 11:24 PM
      0 responses
      3 views
      0 likes
      Last Post SmartArtsStudio  
      Started by kenz987, Yesterday, 10:06 PM
      0 responses
      3 views
      0 likes
      Last Post kenz987
      by kenz987
       
      Started by AaronKoRn, Yesterday, 07:24 PM
      0 responses
      8 views
      0 likes
      Last Post AaronKoRn  
      Started by Aquatrade, 05-15-2021, 11:46 AM
      1 response
      17 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X