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

Code of the strategy analyser backtesting

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

    Code of the strategy analyser backtesting

    Hi NT,

    As I have another concern, I will post in a different trend. It is related with the other one.

    I have some issue with UniRenko bars. As I develop one strategy with UniRenko bars, I get very good backtesting results on them. The thing is that NT7 is taking some king of middle point of the bar to do the calculations, and not taking the close of the bar, as it is supposed.

    That is not really a problem; it is a strategy that it is giving profits, but don't know really how or why is not taking the supposed reference point.

    The thing would be to look the code of the backtesting engine (Strategy Analizer) to understand how is it taking the reference point and which calculations does it makes. Maybe, it is doing a great strategy but I'm not able to see which. ¿Is there anyway to know it? I have the graphs in which I can see how it is not taking the real reference point and that is taking another one.

    Thank you very much on advance for the help,

    #2
    Hello EZarate,

    Thanks for the post.

    Renko bars are known to not be reliable during a backtest. The reason for this is how the Renko bar is built, so essentially all trading platforms have this limitation.

    Renko bars on real-time data re-draw the open based on the direction of the bar. This can not be simulated historically. Backtesting in the Strategy Analyzer is done over the historical data. Each bar in the historical collection has an Open, High, Low, and Close. The OHLC is static and does not change, therefore the accuracy of a Renko backtest is never 100%.

    Other means of "backtesting", such as Market Replay/Play Back, can still yield appropriate results.

    You could check with the developer of this custom Renko bar to see if they have implemented any workarounds for this limitation.

    Please let us know if we may be of any further assistance.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hi Chris,

      Thank you for your rapid answer.

      So, could we see/describe how the backtesting engine is taking those RenkoBars data?

      As it is a machine, it must be some logic underneath, whatever the logic is. I do not believe that the backtesting is taking any point that he wants.

      I mean that, maybe knowing what is the backtesting engine taking into account, we can build some custom bars exactly the same as the ones that the backtesting is using, so as to develop the strategy.

      Do I have explained myself?

      Comment


        #4
        Hello EZarate,

        Thanks for the reply.

        The Strategy Analyzer processes bars based on the OHLC and their timestamps procedurally. The way Renko bars are built relies solely on the movement of price, so NinjaTrader looks back on the previous bar(s) to calculate the next bar. This is something that most backtesting engines do not take into account.

        The source code is not public and can not be viewed. You would have to find an open source backtesting engine to design a custom bar type for Renko bars.

        If we may be of any further assistance, please let us know.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Hi Chris,

          I think that finding something else is not really necessary.

          The only thing I want is to know which is the point that the NT back-tester is going to take to make the calculation of each bar, in the case Renko bars are loaded. It seems to be the middle price of the Renko bar.

          As I understand by your explanation, the back-testing engine takes the close (if Last detailed in the Strategy Parameters) of the X minute corresponding bar. So, in this case, what do you think is happening?

          Comment


            #6
            Hello EZarate,

            Thanks for the follow-up.

            Renko bars redraw based on Tick-by-Tick movement, which is not an option in the Strategy Analyzer. The Strategy Analyzer will only look at the OHLC and timestamp of a bar. The Tick-by-Tick movement that Renko bars rely on is not available historically so they produce incorrect/unexpected results.

            If there is anything else I may assist with please let me know.
            Chris L.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by alifarahani, Today, 09:40 AM
            6 responses
            38 views
            0 likes
            Last Post alifarahani  
            Started by Waxavi, Today, 02:10 AM
            1 response
            18 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by Kaledus, Today, 01:29 PM
            5 responses
            15 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by Waxavi, Today, 02:00 AM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by gentlebenthebear, Today, 01:30 AM
            3 responses
            17 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X