Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to Add Better Renko bars to Renko Strategy

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

    How to Add Better Renko bars to Renko Strategy

    Hello I downloaded the Renko trading strategy and I have been Back testing and Optimizing but the problem I get is because
    it uses renko it doesnt show the whole bar meaning the wicks. So when I do a backtest it shows the best trades when, in reality,
    it doesnt account for the wicks. Anyhow I want to edit the code so I can use BetterRenko bars instead but it wont use it...I get an error
    code. It works if I edit the code to Minute or Range bars, probably because the BetterRenko I had to add to the platform. Is there a way
    to use the BetterRenko in the code of the Strategy or how do I add it? Attached is the Strategy. I hope im clear

    Thanks
    Attached Files

    #2
    Hello bdelorm,

    Thank you for your note.

    You simply need to change the check for the BarsPeriodType from checking for renko bars to checking for the period type of the BetterRenko bars, which is 17:

    Code:
                if(BarsPeriod.BarsPeriodType != (BarsPeriodType)17)
                {
                    Draw.TextFixed(this, "NinjaScriptInfo", "The RenkoStrategy must be ran on a BetterRenko chart.", TextPosition.BottomRight);
                    return;
                }
    Once you change that, it should work with the Better Renko bars.

    Please let us know if we may be of further assistance to you.

    Comment


      #3
      Thank u kate...shoot what was the original code? I forgot to save it

      Comment


        #4
        Never mind I did it

        Comment


          #5

          Hi Kate thanks for answering my question. If I want to use Minute or Range do I have to use a number? Also I think this Strategy has potential but unfortunately backtest and optimization isnt accuarte because of the nature of Renko bar. Is there a way to rectify that problem?

          Comment


            #6
            Hello bdelorm,

            Thank you for your reply.

            For built in types, you can use BarsPeriodType.Typename:

            Code:
                        if(BarsPeriod.BarsPeriodType != (BarsPeriodType)17 && BarsPeriod.BarsPeriodType != BarsPeriodType.Range && BarsPeriod.BarsPeriodType != BarsPeriodType.Minute)
                        {
                            Draw.TextFixed(this, "NinjaScriptInfo", "The RenkoStrategy must be ran on a BetterRenko chart.", TextPosition.BottomRight);
                            return;
                        }
            The above would let you use the strategy as long as your bar type is BetterRenko, Minute, or Range.

            Backtesting on historical renko bars will always be inaccurate as there is not a way to simulate the redrawing of the open historically.

            That being said, a good way to test would be to download Market Replay data and run the strategy on that - since it replays the chosen day's market data as if it were live, the system is able to redraw the opens and it should act nearly identical to live trading.

            You could also run it on real time data using a sim account to test as well.

            Please let us know if we may be of further assistance to you.

            Comment


              #7
              Ty Kate where can I do market replay on NT8? I cant seem to locate it

              Comment


                #8
                Hello bdelorm,

                Thank you for your reply.

                I have provided a publicly available link below to our YouTube video that provides a brief overview of downloading Market Replay data, connecting to the Playback Connection, and replaying data:To use the Playback Connection you will first need to have data for Market Replay.

                There are 2 ways of getting market data for Market Replay:
                1. Record live market data To do this you will need to enable the Market Replay Recorder by going to Tools> Options> Market Data > check 'Enable market recording for playback' > OK. Now data will be recorded for any instrument in any NinjaTrader window that is receiving live market data. Level II (market depth) data is only recorded if a Level II, SuperDOM, or FX Pro window is open and receiving data for the instrument. The Market Analyzer window is the recommended recording window as multiple instruments can be added to one Market Analyzer window and all recorded at the same time. Please see the following publicly available help guide page for more information: http://ninjatrader.com/support/helpG...ReplayRecorder
                2. Download replay data from the NinjaTrader server.

                  NinjaTrader offers a limited amount of replay data free to download. Only the most common instruments are currently available.
                To download replay data:
                • Select the Tools menu in the Control Center, select the menu item Historical Data and select "Load" tab. Here the section "Get Market Replay data" can be expanded.
                • Select the instrument and date of the desired replay data and press the OK button to begin the download.
                Please see the following publicly available help guide page for more information:



                Notes:
                • Record for market replay must be disabled from the Data tab of the Options menu before downloading replay data.
                • NOT available when connected to the Playback connection.
                To start playback, first disconnect from any other connections. Connect to the Playback Connection by going to Connections > Playback Connection.

                Select the time frame for the Market Replay Data you would like to view. NinjaTrader windows will only display data for instruments and times you have data available.

                You can check what data you have available by right clicking on the Playback Connect controls and selecting 'Available data'. Data will only be displayed within the selected time frame.

                I have provided a publicly available link below to our Help Guide that goes over Market Replay.Please let us know if we may be of further assistance.

                Comment


                  #9
                  can I add a strategy to a market replay?

                  Comment


                    #10
                    Hello bdelorm,

                    Thank you for your reply.

                    Yes, you absolutely can. When in Market Replay, you can add a strategy to the chart just like you could if you were running on a live connection. Any orders the strategy takes will be sent to the Playback101 account. Also, please be sure the chart you apply the strategy onto has bars populating it prior to the start time of your replay (historical bars).

                    Please let us know if we may be of further assistance to you.

                    Comment


                      #11
                      U know what I did everything u said but the enable button on the strategy would not check...

                      Comment


                        #12
                        Hello bdelorm,

                        Thank you for your reply.

                        Check the account selected - is it the Playback 101 account?

                        If so, try pressing play, waiting for a few bars, then try to enable the strategy while it's playing.

                        If not, remove and readd the strategy to the chart - it should automatically know it's the Playback101 account when you add it in playback, but if you're using a chart you were using with the Sim101 account, it's possible it still has that selected and just needs to be removed and re-added to work.

                        Please let us know if we may be of further assistance to you.

                        Comment


                          #13
                          Im a little confused about what Max Drawdown is. Is Max DD the total loses in a row? So for example if a strategy has a MDD of 14000 that means there was a total of
                          14000 loses in a row before the next profit?

                          Comment


                            #14
                            Hello bdelorm,

                            Thank you for your reply.

                            The max drawdown is basically the biggest decrease in account size from the highest high seen. You can learn more in our help guide here:



                            Please let us know if we may be of further assistance to you.

                            Comment


                              #15
                              Hello Im trying to understand how to read the results of the Walk Forward Optimization. Is there a video that gets into detail on
                              how to utilize this option?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by NullPointStrategies, Today, 05:17 AM
                              0 responses
                              50 views
                              0 likes
                              Last Post NullPointStrategies  
                              Started by argusthome, 03-08-2026, 10:06 AM
                              0 responses
                              126 views
                              0 likes
                              Last Post argusthome  
                              Started by NabilKhattabi, 03-06-2026, 11:18 AM
                              0 responses
                              69 views
                              0 likes
                              Last Post NabilKhattabi  
                              Started by Deep42, 03-06-2026, 12:28 AM
                              0 responses
                              42 views
                              0 likes
                              Last Post Deep42
                              by Deep42
                               
                              Started by TheRealMorford, 03-05-2026, 06:15 PM
                              0 responses
                              46 views
                              0 likes
                              Last Post TheRealMorford  
                              Working...
                              X