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

Pass Value Generated from BarsType to a Strategy

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

    #16
    Hello martin70,

    Have you tried restarting the platform after adding that to the bars type? I tried the scripts you attached and see the print when running it in a backtest.

    JesseNinjaTrader Customer Service

    Comment


      #17
      Hi Jesse,

      the calculation to run the test is simply (high+Low)/2 of the last bar.

      In real time this is calculated correctly and the printed value changes on each new bar.

      In backtest, yes, you get a print as you write, but the printed values are ALWAYS the same identical value, referring to the FIRST bar of the chart: the printed value is not changing; therefore the value it is not calculated anymore after the first bar.

      How do I get the backtest print behaviour to be correct like in real time?

      Thank you
      Martin

      Comment


        #18
        Hello martin70,

        In a backtest renko bars do not work the same as they do in realtime so you will see differences in how it processes in that use case. Renko bars use what is called remove last bar supported, any renko code that is similar to the original NT renko or that uses remove last bar will encounter that in a historical test.

        JesseNinjaTrader Customer Service

        Comment


          #19
          Hello Jesse,
          RemoveLastBar() is not used in UniRenko bars, please check the above posted code. This does therefore not seem to be the issue. What else could be the problem?

          Comment


            #20
            Hello martin70,

            In that case you would need to use prints to debug the bars type logic to find out what may be happening. As that is a third party bars type I am not aware of any specific problems that logic may have when backtesting. In general renko bars cannot be accurately backtested, we suggest to test renko bars going forward in realtime using playback or a live connection.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by MacDad, 02-25-2024, 11:48 PM
            8 responses
            173 views
            0 likes
            Last Post NinjaTrader_Erick  
            Started by alancurry, Today, 06:53 AM
            0 responses
            6 views
            0 likes
            Last Post alancurry  
            Started by Juanhuisman, Today, 06:51 AM
            0 responses
            5 views
            0 likes
            Last Post Juanhuisman  
            Started by sidlercom80, 10-28-2023, 08:49 AM
            173 responses
            2,339 views
            0 likes
            Last Post intelligenttrader  
            Started by ArkansasClint, 04-25-2024, 09:28 AM
            1 response
            23 views
            0 likes
            Last Post Leafcutter  
            Working...
            X