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

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 JoMoon2024, Today, 06:56 AM
                  0 responses
                  6 views
                  0 likes
                  Last Post JoMoon2024  
                  Started by Haiasi, 04-25-2024, 06:53 PM
                  2 responses
                  17 views
                  0 likes
                  Last Post Massinisa  
                  Started by Creamers, Today, 05:32 AM
                  0 responses
                  5 views
                  0 likes
                  Last Post Creamers  
                  Started by Segwin, 05-07-2018, 02:15 PM
                  12 responses
                  1,786 views
                  0 likes
                  Last Post Leafcutter  
                  Started by poplagelu, Today, 05:00 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post poplagelu  
                  Working...
                  X