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 DayTradingDEMON, Today, 09:28 AM
        4 responses
        21 views
        0 likes
        Last Post DayTradingDEMON  
        Started by geddyisodin, Yesterday, 05:20 AM
        9 responses
        50 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by George21, Today, 10:07 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Started by Stanfillirenfro, Today, 07:23 AM
        9 responses
        24 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by navyguy06, Today, 09:28 AM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X