Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Price bars not keeping up with actual price

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

    Price bars not keeping up with actual price

    Hello, I was attempting to test a simple strategy on a Unirenko 1:1:3 chart with playback data. Strategy would work but periodically plot a trade well outside of the actual price plots and occasionally place repeat trades at a price point, frequently causing the strategy to terminate. Strategy help guys said I needed to debug strategy by fixing trailing stop. So I removed trailing stop and placed a fixed stop, no change. So, I ran strategy on sim mode of current market data and took screen shots (attached). It seems to me that the renko bars are not keeping up with the actual price as compared to the simultaneous 1 minute chart that I ran concurrently and the Lin Reg plot line then is out of register. The out of register LN Reg line happens with range bars also. Additionally, I had the same problem with HMA lines plotting properly. I thought internet speed might be a factor but I am assuming that the 1 minute chart is correct. What am I doing wrong? Also, I was only trading 1 contract but, it seems that the trades are being stacked, adding another trade before the close of one because price is not being plotted.

    #2
    Hello RickB60,

    Thank you for your post.

    Are you using Historical data or Market Replay data with the Playback connection?

    If you're using Historical data, I would expect to see irregularities when using renko based bars in playback. Using Renko bars in a backtest using historical data will produce results that are not comparable to real-time results due to the way Renko bars are built.

    Renko bars on real-time data re-draw the open based on the direction of the bar. This cannot be simulated historically, since backtests use four, and only four data points: the open, high, low and close. Other means of backtesting, such as Market Replay/Play Back, can still yield appropriate results.

    If you're getting these results on Market Replay data, I would suggest first deleting and redownloading the day in question's data in case what you have is incomplete or corrupted in some way, then redownloading it via Tools > Historical data > Load. Let me know if you're using Market Replay already and still see this behavior after reloading the data for the day.

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Hello,
      No, what I sent were screen shots of live data obtained moments before the post, not replay. Since that point I decided to disable the strategy and just watch to see if the LN reg separated from price but this has not happened yet, but I have seen that happen with an HMA on a range bar before, usually when there is a large amount of volume and the market is moving fast. I asked about this once before and was told that that was essentially impossible, so now I have a screen shot to prove it. I have the latest version of NT8 downloaded and the computer is new with the fastest processor that I could get. I could send you the strategy conditions but they are very simple, 2 bars in a row to get into a trade and three bars to get out with a Lin Reg filter.

      Comment


        #4
        Hello RickB60,

        Thank you for your reply.

        I appreciate your clarification; in your original post you'd first mentioned you were testing on playback and I missed the line about running on live data.

        When this occurred, did you receive any errors on screen, or were there any errors in the log tab of the Control Center? If so, please provide the text of the error(s).

        Having a brand new computer doesn't always guarantee you won't run into a performance issue, and that sounds like what you're most likely running into here. NinjaTrader 8 is multi-threaded and will take advantage of all the cores your processor has.

        As a rule of thumb I use the Task Manager > Performance tab and make sure the graph is set to display 'logical' processors (Right click on graph to change it to display each individual processor). If NinjaTrader is working hard one or more of the cores will hit 100%. If you have a single core hit 100%, you're out of 'juice' and there is a performance problem looming. If not all cores hit 100% then you still have room to go. I never use the 'aggregated' single CPU number since its misleading.

        The performance when NinjaTrader is loading a workspace or opening a chart is attributed to the processing of historical data. After the workspace or chart has loaded and all historical data has been processed the performance is primarily affected by real-time data being processed.

        You can experience unexpected or unresponsive behavior in NinjaTrader if you have many charts, indicators and other windows opened and this is depending on market volatility as well.

        One thing to check first is whether you have any open but not currently visible workspaces running. Check the Workspaces menu for any workspaces that have a gray box next to their names. If you see one, hover over it and click Close. Workspaces that are open but not visible are still receiving data and calculating values in many cases and this can have a large performance impact.

        Next, how many windows and tabs do you generally have in your workspace at once? Are they all the same instrument, or different instruments? Because NinjaTrader 8 is multi-threaded, only the thread(s) which is experiencing performance issues may slow or freeze, leaving the rest of the platform unaffected and responsive.

        Why? Well, an instrument can only be assigned one thread. If multiple threads were used per instrument, different NinjaTrader windows could get out of sync.

        With the above in mind, you may see something like this - let's say we have 30 charts with the same instrument loaded. We've then got a single thread being used, and lots of charts pulling from it, which increases the likelihood of a performance issue, like freezing up.

        If, on the other hand, we have 30 charts with 30 different instruments loaded, we'd then have 30 threads being used. The load is spread out over more threads and is therefore less likely to run into a performance issue.

        Also, I would check your indicators to see what calculation modes you've got set for them. Indicators and strategies set to calculate OnEachTick will need to run through their calculations every time a tick comes in and have a greater impact on performance than one set to OnBarClose. Price-based indicators would usually be fine calculating OnPriceChange or OnBarClose.

        To see what (if any) NinjaScript items may be contributing to the symptoms, please open the NinjaScript Utilization Monitor:
        • Control Center > New > NinjaScript Output
        • Right-click within the NinjaScript output window > Select 'NinjaScript Utilization Monitor...
        • This window will begin to populate with NinjaScript items in order of time spent processing
        • Let this window populate for at least a few minutes. The items at the top will be the ones to look at first, as they are taking the longest to process.
        Lastly, I'd like to double check your log and trace files in case they've recorded errors that may not be as obvious as something that pops up with a message. You can send those by going to the Control Center-> Help-> Email Support.

        Ensuring 'Log and Trace Files' is checked will include these files. This is checked by default.

        Please reference the following ticket number in the body of the email: 2368040 ATTN Kate W.

        Thanks in advance; I look forward to assisting further.






        Kate W.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by DayTradingDEMON, Today, 09:28 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by cmtjoancolmenero, Yesterday, 03:58 PM
        8 responses
        31 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by helpwanted, Today, 03:06 AM
        2 responses
        22 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by navyguy06, Today, 09:28 AM
        0 responses
        5 views
        0 likes
        Last Post navyguy06  
        Started by rjbtrade1, 11-30-2023, 04:38 PM
        2 responses
        77 views
        0 likes
        Last Post DavidHP
        by DavidHP
         
        Working...
        X