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

Higher Freq Bars Missing Basic Signal

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

    Higher Freq Bars Missing Basic Signal

    Evening all,

    I am building a very simple 'always in' base case for a higher freq trade into a few different futures. For simplicity, I am testing on NQ future and a Renko Brick of 4.

    I am using a basic HMA on the bars. When the HMA goes from upward to downward, I get short. When from downward to upward, I get long. Nothing else.

    So:

    (HMA[2] > HMA[1]) && (HMA[1] < HMA[0]) -->> EnterLong()

    (HMA[2] < HMA[1]) && (HMA[1] > HMA[0]) -->> EnterShort()

    Pretty simple! I tagged the trades so they show up on the chart when the strategy file is applied to a live SIM chart.

    The problem is some of the signals are not traded. This also happens with production by the way. The signals are sometimes not taken when a strat file is run on live Renko bars. The signals are taken when the backtester runs on historical. The strat file I am using in the backtester and in the chart live SIM are one and the same.

    So my question is what the heck is going on here? I am attaching a screenshot. The top is the live SIM chart w the strat running on it. The bottom is the Strategy Analysis chart with the indicator added to it. I aligned them to show roughly the same time window. The arrows point to spots where there should be trades but there aren't.

    Thank you to anyone who can assist.

    PS: I know there is a flaw in using Renko Bricks in the backtester bc the high/low wicks are not in there. I believe this messes up stop and trail etc logic but I have none of that in here: it's just an always in flipper. My input into the HMA calc is the Close series so I don't believe this could create an inaccuracy. Also, I am starting an instance of the indicator itself within the strategy* so I believe the math is matching the visual. (I also printed the HMA values calced by the strategy and compared to the chart's indicator values and they match.)

    *HMA myCalculatedHMA = HMA(Close, HMA_Lookback);

    Thank you all!

    Click image for larger version  Name:	Busted Strat.png Views:	0 Size:	173.8 KB ID:	1122736
    Last edited by ozziyhtomit; 10-14-2020, 07:23 PM.

    #2
    Hello ozziyhtomit, thanks for your post.

    The best way to debug will be to use the Print method. That will let you print out data from the script to see why conditions are not becoming true. In this case, print out the data right before the entry condition:

    Print(HMA[0]);
    Print(HMA[1]);
    Print(HMA[2]);
    if(HMA[2] > HMA[1]) && (HMA[1] < HMA[0]))
    { EnterLong(); }

    We do not recommend doing backtests on Renko bars because, in real-time, Renko bars can re-draw their open based on the direction of the price, and that can not be done in the simulation engine. It would be a better use of time to backtest using real time or playback data so you can see the actual results of the strategy so you can avoid the unrealistic results of a Renko backtest.

    I look forward to hearing of your results.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chris,

      Upon closer inspection I am also seeing that when running this in real time with Renkos, the order tags sometimes collect at the end of the chart, all bunched up. Here is an image of the above strategy running on a chart. It looks like the trades did not happen but they did (I was watching this whole time). And, their tags collected at the right hand side of the chart. Have you ever seen this?

      Click image for larger version

Name:	62446219196__7C2B50DD-254D-4EEB-A3AA-6FFFE1157EEE.JPG
Views:	243
Size:	563.5 KB
ID:	1122850

      Comment


        #4
        Hello ozziyhtomit, thanks for your reply.

        Do you have any additional instruments on the chart? Do you see that happening on a blank chart with no other indicators, only the Renko bars?

        If none of these apply, please reset your database by going to Tools>Database Management>Reset Database>Reset. Test the strategy after completing this.

        I look forward to assisting.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          The cosmetic problem happens still even after resetting.

          Forget about it, it's just cosmetic. But it looks terrible.

          If I see any more missed trades I'll post here.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by ScottWalsh, Today, 06:52 PM
          4 responses
          32 views
          0 likes
          Last Post ScottWalsh  
          Started by olisav57, Today, 07:39 PM
          0 responses
          4 views
          0 likes
          Last Post olisav57  
          Started by trilliantrader, Today, 03:01 PM
          2 responses
          19 views
          0 likes
          Last Post helpwanted  
          Started by cre8able, Today, 07:24 PM
          0 responses
          6 views
          0 likes
          Last Post cre8able  
          Started by Haiasi, Today, 06:53 PM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Working...
          X