Segment an indicator

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #36862 quote
    from8to800from8to800
    Participant
    Average

    Hello all,

     

    I’m seeking clarification on whether it is possible to segment an indicator so that only parts of it are shown.

     

    Say, for example that we have a Parabolic SAR plotted around price.

    Is it possible to code the indicator in such a way that it is only shown when below the price? In other words, when the PSAR i above the price, the indicator should return nothing.

     

    Many thanks,

    From8to800

    #37079 quote
    from8to800from8to800
    Participant
    Average

    Bump, anyone?

    #37081 quote
    NicolasNicolas
    Keymaster
    Legend

    Yes of course, you have to code a custom SAR for that purpose:

    a = SAR[0.02,0.02,0.2]
    
    if close>a then 
     indi=a
    else
     indi=0
    endif
    
    return indi coloured(0,200,0) style(point,3)

    To hide the PSAR, we set our variable to 0 (because there is no other way to set a variable to an empty value), so remember to change the vertical autoscaling in the price settings window.

    PSAR-indicator-below-price-only.png PSAR-indicator-below-price-only.png
    #37084 quote
    from8to800from8to800
    Participant
    Average

    Hi Nicola,

     

    Many thanks for your response.

    I guess that works too. I tend to prefer my charts vertically adjusted for indicators also, but I can live with it adjusted on price only.

     

    Once again, thank you!

    From8to800

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

Segment an indicator


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
from8to800 @from8to800 Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by from8to800from8to800
9 years, 4 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/29/2017
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...