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

ninzaRenko Wicks

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

    ninzaRenko Wicks

    Team,

    I would like to build a strategy to take an entry when previous ninzaRenko candle has WICKS to its body.
    Click image for larger version

Name:	ninza1.PNG
Views:	739
Size:	2.6 KB
ID:	1159681Click image for larger version

Name:	ninza2.PNG
Views:	709
Size:	2.1 KB
ID:	1159682

    #2
    Hello surya,

    Thanks for your message.

    You can reference the OHLC values of the bar to see if High is greater than the Open/Close or the Low is less than the Open/Close to see if a wick is formed on the bar.

    To reference a previous bar, you would use a BarsAgo index of 1.

    I.E.

    Code:
    if ((High[1] > Open[1] && Open[1] > Close[1]) || (High[1] > Close[1] && Close[1] > Open[1]))
        Print("High wick found on previous bar at" + Time[0])
    Working with Price Series - https://ninjatrader.com/support/help...ice_series.htm

    If you are using the Strategy Builder, please see the information below for creating strategies with the Strategy Builder.

    Strategy Builder 301 (publicly available resource) — https://www.youtube.com/watch?v=_KQF2Sv27oE

    Conditions examples —https://ninjatrader.com/support/help...on_builder.htm

    Actions examples — https://ninjatrader.com/support/help...us/actions.htm

    We look forward to assisting.
    Last edited by NinjaTrader_Jim; 06-14-2021, 07:38 AM.
    JimNinjaTrader Customer Service

    Comment


      #3
      Team, Thank you for your response.

      I tried below code based on suggestion and looks like its taking trade on every upside and every downside.
      I wanted it to take trade only on 2nd after the marked candle (which has wicks).

      Please suggest what wrong I'm doing here.

      Click image for larger version

Name:	ninza3.PNG
Views:	739
Size:	87.5 KB
ID:	1159806
      Click image for larger version

Name:	ninza3.PNG
Views:	696
Size:	87.5 KB
ID:	1159805

      Comment


        #4
        Hello surya,

        We would need to check up bars and down bars differently, and I have modified my example in post #2 to elaborate.

        I have also attached a Strategy Builder example that shows how you can set up these conditions.

        We look forward to assisting.
        Attached Files
        JimNinjaTrader Customer Service

        Comment


          #5
          Thank you for your quick and awesome response.

          I was expecting entry on 2nd candle but it took entry on 3rd candle any reason why?

          Are you available for quick 1-on-1 session Click image for larger version

Name:	ninza4.PNG
Views:	585
Size:	11.9 KB
ID:	1160148

          Comment


            #6
            Hello surya,

            As it affects our ability to address other client inquiries in a timely manner, we would not be able to schedule a one-on-one session involving a NinjaScript Development or Debugging inquiry.

            I suggest using prints to better see how BarsAgo indexing works and how strategies process data when Calculate.OnBarClose is used, and when OnEachTick/OnPriceChange is used. For example, you can print Misc > CurrentBar, Price > Close with BarsAgo 0 and BarsAgo 1, and Time > TimeSeries to see bar indexes, values and timestamps. You can then also enable the data box on your chart, and if you right click in the data box, you can enable bar indexes and bars ago indexes which you can compare against the NinjaScript Output window.

            Prints can be added under Actions > Misc in the Strategy Builder.

            Realtime data will process the developing bar when Calculate is set to OnPriceChange/OnEachTick. (BarsAgo 0 I.E. Close[0] would be the developing bar) Historical data will follow Calculate.OnBarClose behaviors regardless of the calculate mode, unless Tick Replay is used. (BarsAgo 0 I.E. Close[0] would be the bar that had just closed.)

            Bar closures are signaled when the next bar starts developing, so when we look at the previous bar with BarsAgo 1, I.E. Close[1], and we submit an order when that trigger bar closes, the order would then be submitted and would be filled with the data after that bar.

            Please let us know if you have any additional questions.
            JimNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Jim View Post
              Code:
              if ((High[1] > Open[1] && Open[1] > Close[1]) || (High[1] > Close[1] && Close[1] > Open[1]))
              Print("High wick found on previous bar at" + Time[0])
              Maybe it works on renko but it didnt work good on regular bars
              It was picking up every bar with a wick.
              I think it needs a wick distance judgement to only catch bigger wicks thanks

              Comment


                #8
                Also, I thought I had an amazing strategy. I was winning every trade on renko bars. Then I went live and it was just loss after loss. There must be something wrong with the way renko works vs backtesting.

                Comment


                  #9
                  Did you test live on simAccount on the renko bar, before going live. Remember on Backtesting that you trigger you exit or even entry, but the backtest uses the Open of the Next bar, so slippage is a big deal in back testing. I use a brick base bar and the results on live sim is the only real test. Backtesting will not be close

                  you could test in Play Back Connection too

                  Comment


                    #10
                    Hello ezrollin,

                    Renko bars have issues with backtesting because of their behavior to repaint the open of a bar with realtime processing. With historical processing/backtesting, the bars are already formed.

                    Some custom Renko bars aim to get past this but should use High Order Fill Resolution or submit orders to a single tick data series for accurate fill prices. (Since backtesting uses the OHLC of each bar to fill orders, and does not have any tick per tick movement for processing logic or filling orders.)

                    I suggest starting with the information below on differences between historical and realtime processing which are especially important for Renko bars. Playback can also help simulate realtime data for testing Renko strategies. If you have additional questions involving backtesting, please do not hesitate to open a new thread.

                    Discrepancies between realtime and backtest - https://ninjatrader.com/support/help...ime_vs_bac.htm

                    As for the example condition, I get the attached results that show that there missing prints where there was no high wick on the previous bar.

                    Attached Files
                    JimNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Vikuno1, 11-28-2023, 11:42 PM
                    13 responses
                    345 views
                    1 like
                    Last Post PaulMohn  
                    Started by Taddypole, 04-26-2024, 02:47 PM
                    5 responses
                    35 views
                    0 likes
                    Last Post eDanny
                    by eDanny
                     
                    Started by kujista, 04-23-2024, 06:23 AM
                    6 responses
                    51 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by giulyko00, 04-24-2024, 12:03 PM
                    7 responses
                    37 views
                    0 likes
                    Last Post eDanny
                    by eDanny
                     
                    Started by NM_eFe, Today, 10:13 AM
                    0 responses
                    12 views
                    0 likes
                    Last Post NM_eFe
                    by NM_eFe
                     
                    Working...
                    X