ADX reset at time XX

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #167548 quote
    tattbytattby
    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
    robertogozzirobertogozzi
    Moderator
    Legend

    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.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

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 robertogozzirobertogozzi
5 years, 3 months ago.

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