ADX reset at time XX

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #167548 quote
    tattby
    Participant
    Average

    Hello,
    I’m trying to recode the ADX indicator a little bit.
    I would like to reset the ADX value at a specific time.
    E.g. once ADX value hits 80 then reset it to zero in order to follow a new strength trend at opposite direction.
    Any ideas?

    IF currenttime = XX then
    
    
    
    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"
    #173180 quote
    robertogozzi
    Moderator
    Master

    It’s not possible to reset ADX, as it recalculates itself candle after candle according to what happened in the last N periods, like MA’s, Macd, etc…

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

ADX reset at time XX


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
tattby @tattby Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 04/19/2021
Status: Active
Attachments: No files
Logo Logo
Loading...