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

IsFirstTickOfBar with LineBreak barstype. Error

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

    IsFirstTickOfBar with LineBreak barstype. Error

    Hello,

    It seems that the "IsFirstTickOfBar" instruction will not work correctly when it is used with the "LineBreak" bar type, and Calculate is not equal to Calculate.OnBarClose. It is running continually.

    You can run the attached indicator in a chart with the next DataSeries configuration to check the bug. (set Calculate = Calculate.OnEachTick or Calculate.OnPriceChange).

    Thanks
    Attached Files

    #2
    Hello cls71,

    Are you testing over historical data or real-time data?

    Are you getting no prints in either historical or real-time?

    Or are you not getting a print on the first update of a bar when Calculate is On price change in real-time data only?

    Or are you getting a print on every update of OnBarUpdate when you are only expecting 1 per bar?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello cls71,

      Are you testing over historical data or real-time data?
      Real-time data

      Originally posted by NinjaTrader_ChelseaB View Post
      Are you getting no prints in either historical or real-time?
      In Historical I get 1 print for each bar (it is correct). In real-time I get a lot of prints.

      Originally posted by NinjaTrader_ChelseaB View Post
      Or are you not getting a print on the first update of a bar when Calculate is On price change in real-time data only?

      Or are you getting a print on every update of OnBarUpdate when you are only expecting 1 per bar?
      In real time when Calculate = Calculate.OnPriceChange, I am getting a print on every update of OnBarUpdate when I am only expecting 1 per bar.

      Comment


        #4
        Hello cls71,

        I was able to research and find an answer on this.

        The LineBreak bar calls RemoveLastBar() internally. IsFirstTickOfBar is true anytime RemoveLastBar is called.

        From the help guide:
        "If a bar type is set up to remove the last bar on a chart, IsFirstTickOfBar will automatically be set to True."

        Below is a public link to the help guide.


        This will also affect any other bar type (such as Renko bars) if and when it calls RemoveLastBar().
        Last edited by NinjaTrader_ChelseaB; 06-14-2022, 09:50 AM.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks ChelseaB,

          But then there is no solution in NT8?

          Because in NT7 this error does not occur and it works fine.

          Comment


            #6
            Hello cls71,

            I am not aware of a work around for this. RemoveLastBar() is a new concept for NinjaTrader 8.

            I am happy to submit a feature request on your behalf for IsFirstTickOfBar to not be true when RemoveLastBar() is called if you would like.

            Please note, it is up to the NinjaTrader Development to decide if a request will be implemented.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_ChelseaB View Post
              Hello cls71,
              I am happy to submit a feature request on your behalf for IsFirstTickOfBar to not be true when RemoveLastBar() is called if you would like.
              Yes, thanks.

              Comment


                #8
                Hello cls71,

                I've received tracking ID #SFT-3298 for your request that IsFirstTickOfBar is not set to true when RemoveLastBar() is called.

                Please note it is up to the NinjaTrader Development to decide if or when any request will be implemented.

                Thank you for your suggestion. Please let me know of any other requests you have for NinjaTrader.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Just for info, came across this when I just realised IsFirstTickOfBar is set to true permanently when using these bar types. Seems silly to me, but I guess some workaround with CurrentBar can be made.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by ghoul, Today, 06:02 PM
                  2 responses
                  12 views
                  0 likes
                  Last Post ghoul
                  by ghoul
                   
                  Started by jeronymite, 04-12-2024, 04:26 PM
                  3 responses
                  44 views
                  0 likes
                  Last Post jeronymite  
                  Started by Barry Milan, Yesterday, 10:35 PM
                  7 responses
                  20 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by AttiM, 02-14-2024, 05:20 PM
                  10 responses
                  180 views
                  0 likes
                  Last Post jeronymite  
                  Started by DanielSanMartin, Yesterday, 02:37 PM
                  2 responses
                  13 views
                  0 likes
                  Last Post DanielSanMartin  
                  Working...
                  X