The UNDEFINED keyword; how disable an indicator?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #160168 quote
    drfrdatadrfrdata
    Participant
    New

    Hi, just started on ProBuilder.

    I am creating a notional new indicator as follows: –

    if IntradayBarIndex > 109 AND IntradayBarIndex < (16 * 12) + 3 THEN
    atrupper = High + 2
    ELSE
    atrupper = Undefined
    ENDIF

    and would like to switch the indicator off on the charts overnight.  I had thought the keyword ‘UnDefined’ would do this, but it does not appear to work; it simply holds the indicator constant without stopping it from displaying.

    Any help greatly appreciated

    #160172 quote
    VonasiVonasi
    Moderator
    Master

    Once a variable has been defined it is not possible to return it to undefined status.

    You could try changing the contrast to zero in the COLOURED instruction.

    once atrupper = Undefined
    
    if IntradayBarIndex > 109 AND IntradayBarIndex < (16 * 12) + 3 THEN
    atrupper = High + 2
    c = 255
    ELSE
    c = 0
    ENDIF
    
    return atrupper coloured(128,0,0,c)
    #160180 quote
    drfrdatadrfrdata
    Participant
    New

    Many thanks for quick response; works perfectly

    Regards

Viewing 3 posts - 1 through 3 (of 3 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

The UNDEFINED keyword; how disable an indicator?


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
drfrdata @drfrdata Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by drfrdatadrfrdata
5 years, 7 months ago.

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