Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Random Bollinger calculation variances

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

    Random Bollinger calculation variances

    NT8 Team,

    I am experiencing random changes to the representation of Bollinger bands from a custom strategy. Sometimes they are colored correctly, other times they appear to be way off.

    Here's the code I use to designate 3 Bollinger bands:

    Code:
    else if (State == State.DataLoaded)
    {
    
    Bollinger1 = Bollinger(Close, 2, 14);
    Bollinger2 = Bollinger(Close, 1, 14);
    Bollinger3 = Bollinger(Close, 3, 14);
    Bollinger1.Plots[0].Brush = Brushes.DarkOrange;
    Bollinger1.Plots[1].Brush = Brushes.Goldenrod;
    Bollinger1.Plots[2].Brush = Brushes.DarkOrange;
    
    Bollinger2.Plots[0].Brush = Brushes.LawnGreen;
    Bollinger2.Plots[1].Brush = Brushes.Goldenrod;
    Bollinger2.Plots[2].Brush = Brushes.LawnGreen;
    
    Bollinger3.Plots[0].Brush = Brushes.Goldenrod;
    Bollinger3.Plots[1].Brush = Brushes.Goldenrod;
    Bollinger3.Plots[2].Brush = Brushes.Goldenrod;
    
    AddChartIndicator(Bollinger1);
    AddChartIndicator(Bollinger2);
    AddChartIndicator(Bollinger3);
    VOLMA1 = VOLMA(Close, 14);
    VOLMA1.Plots[0].Brush = Brushes.Goldenrod;
    AddChartIndicator(VOLMA1);
    ATR1 = ATR(Close, 14);
    ATR1.Plots[0].Brush = Brushes.DarkCyan;
    AddChartIndicator(ATR1);
    
    //SetTrailStop(@"TrailstopTickVal", CalculationMode.Currency, 0, true);
    }
    But this morning they aren't colored correctly and I appear to have an extra set on a longer timeframe or something.

    Click image for larger version

Name:	Screenshot 2022-03-14 073810.jpg
Views:	145
Size:	233.8 KB
ID:	1193729

    And if I change nothing in the code, but remove the strategy and reapply the strategy, then I get a totally different situation:


    Click image for larger version

Name:	Screenshot 2022-03-14 074211.jpg
Views:	84
Size:	239.5 KB
ID:	1193730

    Is there a way to get reliable Bollinger calculations consistently represented on the chart?
    ​​​​​​​

    #2
    NT8 Team,

    I was able to resolve this issue by changing the color name of the VOLMA indicator to "Chartreuse". Apparently, using too many indicators in the same color was causing the compiler to be confused.

    Thanks.

    Comment


      #3
      Hello AnotherWorkingHomeless,

      Thank you for your post.

      So that I may best try to reproduce, are you running this OnBarClose, OnPriceChange or OnEachTick? Who is your data provider?

      Thanks in advance; I look forward to assisting you further.
      Kate W.NinjaTrader Customer Service

      Comment


        #4
        Thank you NinjaTrader_Kate,

        I am using OnPriceChange. My data provider is IQFeed.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Gerik, Today, 09:40 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by RookieTrader, Today, 09:37 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by alifarahani, Today, 09:40 AM
        0 responses
        5 views
        0 likes
        Last Post alifarahani  
        Started by KennyK, 05-29-2017, 02:02 AM
        3 responses
        1,284 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by AttiM, 02-14-2024, 05:20 PM
        11 responses
        185 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X