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 dmking, 11-12-2019, 12:31 PM
            4 responses
            4,140 views
            0 likes
            Last Post jasonw
            by jasonw
             
            Started by roblogic, Today, 04:31 PM
            0 responses
            5 views
            0 likes
            Last Post roblogic  
            Started by morrnel, 05-12-2024, 06:07 PM
            4 responses
            53 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by xepher101, 05-10-2024, 12:19 PM
            6 responses
            70 views
            0 likes
            Last Post xepher101  
            Started by gbourque, Today, 04:11 PM
            0 responses
            1 view
            0 likes
            Last Post gbourque  
            Working...
            X