ADX Indicator Code

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #84740 quote
    roos
    Participant
    New

    Hi PRT, I was wondering if it is possible to see and play around with the default code on an indicator in ProBuilder – I am keen to see the exact logic and how it has been coded. For example I was wanting to see what the code behind your default ADX indicator is please?

    Thanks

    #84774 quote
    Nicolas
    Keymaster
    Master

    The ADX code is available as an example in the platform, here it is:

    p=14
    
    REM Let's compute +DM & -DM
    
    plusDM = max(high-high[1], 0)
    minusDM = max(low[1]-low, 0)
    
    IF plusDM > minusDM THEN
    minusDM = 0
    ENDIF
    
    IF plusDM < minusDM THEN
    plusDM = 0
    ENDIF
    
    IF plusDM = minusDM THEN
    plusDM = 0
    minusDM = 0
    ENDIF
    
    REM Let's compute the directional indicators
    
    plusDI = wilderAverage[p](plusDM)
    minusDI = wilderAverage[p](minusDM)
    
    REM Let's compute the ADX indicator
    
    DX = ABS(plusDI - minusDI) / (plusDI + minusDI) * 100
    myADX = wilderAverage[p](DX)
    
    RETURN  myADX as "ADX", 25
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

ADX Indicator Code


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
roos @roos Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Nicolas
7 years, 3 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 11/13/2018
Status: Active
Attachments: No files
Logo Logo
Loading...