Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

making bars transparent

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

    making bars transparent

    I'm trying to hide bars.

    I'm using :
    BarColor = Color.Transparent;
    CandleOutlineColor = Color.Transparent;
    into OnBarUpdate

    All the bars are transparent , nearly. But the small candle still resists the Ramon legions
    What can i do at respect?
    Attached Files

    #2
    Hi Ramon,

    Is it the last bar you're trying to make transparent there? This would be controlled with the script's CalculateOnBarClose property. You can set to false to allow for tick by tick updating.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      OK. good idea Thanks.
      Unfortunatelly I can't do that because i use OnBarUpdate to reset variables in each change of bar. with CalculateOnBarClose to false, variables would be cleared before than expècted.
      Any other suggestion?

      Comment


        #4
        There's no other way to force updating for the last bar unless you use CalculateOnBarClose = false. If you need to calculate some parts of your script logic with COBC = false and others with COBC = true, this sample can help:
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Work. We have conquered rebel candle

          I had to change COBC=false from Initialize to OnBarUpdate and only this way works. I don't know if this method makes an unnecesary waste of resources.

          I'm doing the right thing? . Thanks a bunch

          Comment


            #6
            You only need to set COBC once in Initialize() but if you change in the GUI when you apply the indicator it uses that setting instead.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Hi again.
              My scripts were going well until I added a data series
              Add(Instrument.FullName, PeriodType.Tick, 1, MarketDataType.Last);
              Add(Instrument.FullName, PeriodType.Tick, 1, MarketDataType.Bid);
              Add(Instrument.FullName, PeriodType.Tick, 1, MarketDataType.Ask);
              then i get the error
              error on calling onbarupdate ...... You are accesing an index with a value that is invalid ...

              i have commented almost all code and the guilty is
              BarColor = Color.Transparent;
              CandleOutlineColor = Color.Transparent;
              What is the correct use in this context ?
              Thanks

              Comment


                #8
                This message means you are accessing bar objects that don't exist. Common causes for this and solutions are available here:


                In a multiseries script, this means you should exclude all processing until there have been enough bars met for all series. Something like this:

                if (CurrentBars[1] < 0) return;

                You have to do this for all series, so I would verify your script works as you expect for only one added series before adding any others.
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  oops. Thanks . I was testing with
                  CurrentBar > n
                  and of course didn't work

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  579 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  334 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
                  554 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