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

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 Brevo, Today, 01:45 AM
            0 responses
            3 views
            0 likes
            Last Post Brevo
            by Brevo
             
            Started by aussugardefender, Today, 01:07 AM
            0 responses
            3 views
            0 likes
            Last Post aussugardefender  
            Started by pvincent, 06-23-2022, 12:53 PM
            14 responses
            240 views
            0 likes
            Last Post Nyman
            by Nyman
             
            Started by TraderG23, 12-08-2023, 07:56 AM
            9 responses
            384 views
            1 like
            Last Post Gavini
            by Gavini
             
            Started by oviejo, Today, 12:28 AM
            0 responses
            6 views
            0 likes
            Last Post oviejo
            by oviejo
             
            Working...
            X