Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

How to hide a dot plot by indicator.

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

    How to hide a dot plot by indicator.

    Hello,

    I have an Indicator that plots a dot when there is a condition, after that another condition is checked and I want to hide the previous dot if the second condition is false.

    The code is this:

    Code:
    protected override void OnStateChange()
    {
    ...
    AddPlot(new Stroke(Brushes.LimeGreen, 2), PlotStyle.Dot, "SistUp"); // That's the plot
    ...
    }
    
    protected override void OnBarUpdate()
    {
    ...
    if (Close[1]==Close[3]) // First Condition 
         {
         SistU = true;
         Values[0][0] = ((Low[0])*(0.9995)); //The green dot is plotted under the current candle
         }
         else
         {
          SistU = false;
          }
    ...
    if (SistU == true) 
         {
          if (High[1]>= High[3]) // 2nd Condition
              {
              CandleOutlineBrush = Brushes.Lime; // Change the current candle outline colour to lime
              }
              else  // If the 2nd Condition is false I want to delete/hide the green dot
              {
              PlotBrushes[0][0] = Brushes.Transparent;// I'll try this, but it doesn't run 
              }
    	}
    I apologize for my bad english.

    Thanks
    Last edited by wassup; 12-03-2016, 07:10 PM.

    #2
    Hello,

    Thank you for the question.

    Is the condition to set the PlotBrush to transparent becoming true on the same bar as when you have plotted the value? If not and this is the next bar, potentially you need to use 1 BarsAgo. Have you tried this?

    PlotBrushes[0][1] = Brushes.Transparent;

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hello,

      First of all, thanks for your response

      I want to erase/hide the dot plotted.

      I've tried your answer and doesn't work.

      Normally, the dot is plotted and when de next candle is created, the second condition became in play; so the dot is plotted in [1], and the outline of new candle [0] becomes lime if the second condition is true and the dot would be hide in case not.

      Thanks for your attention and patience.

      Comment


        #4
        The solution was perfect, the wrong thing was my code ...

        I apologyze for not check more than twice ...

        I'm gratefull and I really apreciate your help.

        Best regards
        Last edited by wassup; 12-06-2016, 08:26 AM.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by algospoke, 04-17-2024, 06:40 PM
        6 responses
        48 views
        0 likes
        Last Post algospoke  
        Started by arvidvanstaey, Today, 02:19 PM
        4 responses
        11 views
        0 likes
        Last Post arvidvanstaey  
        Started by samish18, 04-17-2024, 08:57 AM
        16 responses
        61 views
        0 likes
        Last Post samish18  
        Started by jordanq2, Today, 03:10 PM
        2 responses
        9 views
        0 likes
        Last Post jordanq2  
        Started by traderqz, Today, 12:06 AM
        10 responses
        18 views
        0 likes
        Last Post traderqz  
        Working...
        X