Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

do not plot if false

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    do not plot if false

    Hi, I am working with this script from your tutorial. How can I tell it DO NOT PLOT ANYTHING if the expression is false?

    if the condition evaluates to false, then the second expression will be run (the expression on the right side of the colon ":", which will assign the value of the indicator plot to the Low price of the specified bar, less five ticks:

    Values[0][BarsAgo] = (Close[BarsAgo] > Close[(BarsAgo + 1)]) ? (High[BarsAgo] + (5 * TickSize)) : (Low[BarsAgo] - (5 * TickSize));

    #2
    Hi trader3000a, thanks for posting.

    Change the PlotBrushes to Transparent to hide it e.g.

    Values[0][BarsAgo] = (Close[BarsAgo] > Close[(BarsAgo + 1)]) ? (High[BarsAgo] + (5 * TickSize)) : (Low[BarsAgo] - (5 * TickSize));

    if(!(Close[BarsAgo] > Close[(BarsAgo + 1)]))
    PlotBrushes[0][BarsAgo] = Brushes.Transparent;


    Comment


      #3
      thanks, that's very helpful! Is there a way to clean the code up to remove any action after a false test of the expression? Instead of having to print transparent stuff for a false can we just leave it out entirely? I tried just writing in "" after the colon but got an error.

      Comment


        #4
        Hi trader3000a,

        You must give the code to make the plot transparent. The plot should have a value for each slot index. If the plot should have no value you can set it to 0.

        Kind regards.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        637 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        366 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        107 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        569 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        571 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X