Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CCT Bollinger help

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

    CCT Bollinger help

    hi,
    struggling with ninjascript generally, but at present, i'm trying to add color above 100 & below 0 of the cct bollinger indicator(period changed to 14) i dowloaded from the forum. see my attempt under "onbarupdate...drawregion" & please advise me of my errors. thanks.

    Add(
    new Plot(Color.FromKnownColor(KnownColor.Black), PlotStyle.Line, "Output"));
    Add(
    new Line(Color.FromKnownColor(KnownColor.Red), 100, "Upper"));
    Add(
    new Line(Color.FromKnownColor(KnownColor.LightGreen), 0, "Lower"));
    CalculateOnBarClose =
    false;
    Overlay =
    false;
    PriceTypeSupported =
    true;

    protectedoverridevoid OnBarUpdate()
    {
    Output.Set((Close[
    0]+2*StdDev(Period)[0]-SMA(Period)[0])/(4*(StdDev(Period)[0]))*100);


    DrawRegion("tag1", CurrentBar, 0, CCTBollinger(14).Upper, 1000000, Color.Empty, Color.LightSalmon, 2);

    DrawRegion(
    "tag1", CurrentBar, 0, CCTBollinger(14).Lower, 0, Color.Empty, Color.PaleTurquoise, 2);
    }

    #2
    upsndowns,

    You cannot use a value like 100000 for the barsAgo starting point. Instead you want to use CurrentBar variable in there. That will get it to the very beginning of the chart.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      hi josh,
      i am trying to fill the regions from 100 to chart edge & from 0 to chart edge, & the "drawregion" help in nt suggests putting a high value to do this for the upper region.
      when compiling, the problem seems to be with the "cctbollinger(14)upper" in :
      DrawRegion("tag1", CurrentBar, 0, CCTBollinger(14).Upper, 1000000, Color.Empty, Color.LightSalmon, 2);
      it doesn't recognise it..i think?
      thanks.


      Comment


        #4
        upsndowns,

        Please provide the exact error message. If you feel the plot does not exist I suggest you check that indicator again. Perhaps you mistyped the name or plot name of it.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          hi josh,
          i ended up painting my cct bollinger indicator background similar to 1 of the examples in "custom indicator development" in help.
          it turned out better & more informative than my original idea
          taken me 3 days adjusting my indicators to get the look i wanted more through luck than fully understanding...i'm still very fuzzy on the language.
          finally (for now), are there any ninja online events that cover indicator development? thanks again.

          Comment


            #6
            upsndowns,

            Unfortunately we currently do not have any events for indicators. We have one for Strategy Development through the Strategy Wizard though.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            574 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            332 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            553 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            551 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X