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 Waxavi, Today, 02:10 AM
            1 response
            17 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by Kaledus, Today, 01:29 PM
            5 responses
            13 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by Waxavi, Today, 02:00 AM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by alifarahani, Today, 09:40 AM
            5 responses
            23 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by gentlebenthebear, Today, 01:30 AM
            3 responses
            17 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X