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

Weirdness with draw.regressionchannel

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

    Weirdness with draw.regressionchannel

    Hi,

    I am drawing a regression channel on a chart which uses the ninzarenko bar type.

    The issue I am experiencing is that once you have drawn the channel, if the channel is longer than the bars currently displayed, the regressionchannel recalculates itself based on the bars on the chart, not the length of the channel and moves around the screen. This can also cause ninjatrader to lock up.

    Should not the regression channel be static once drawn? I'm surprised the channel is redrawing itself, even when new bars are being created, simply by scrolling back through the chart.

    Would this be expected?

    The statement I use to plot the channel is as follows

    Draw.RegressionChannel(this, "lrc3", false, i, 0, LineColour, DashStyleHelper.Dash, 3, LineColour, DashStyleHelper.Dash, 1,LineColour, DashStyleHelper.Dash, 3);


    If you then use the chart scroll bar to scroll left, even when no new data is being received, the channel recalculates itself and jumps all over the screen once the right of the channel scrolls off the right. I would add, the channel is longer than the bars that are displayed on the chart.

    Perhaps this is related to the bar type and the way it is implemented?

    Any suggestions to keep the channel static?

    [edit] - just to add. If the line type is .Dash, scrolling will cause NT to lock up, or freeze for many seconds. If the line type is .Solid, the channel still jumps all over the place, but the lock up does not occur.
    Last edited by pjsmith; 03-29-2018, 03:47 PM.

    #2
    Hello pjsmith,

    Thanks for opening the thread.

    I am unable to test this with the 3rd party bar type and I am not aware what is done under the hood of ninzarenko bars in order to give further insight.

    I have tested this line of code (changing i to be a constant value) and I have not been able to reproduce the issues with any of NinjaTrader's bartypes. If you are able to reproduce these issues with NinjaTrader bartypes we could investigate further.

    I would typically expect that if data is loaded, OnBarUpdate() draws the regression channel, and then no more data is loaded, the regression channel should not be modified.

    To cover any loose ends, I would first test to make sure that the NinjaScript is not calculating with each tick and the the issue can be reproduced while disconnected. If the issue is only reproducible with ninzarenko bars, NinZa should be informed about the issue.

    If this can be reproduced with our bar types, could you provide a reduced example we can use to look into on our end?

    As always, our NinjaScript team is available to assist any vendors with issues that are occurring between AddOns and the platform.

    I look forward to being of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thank you for the reply. I have been able to reproduce this with the native renko and tick type bar types also and nothing but a single chart with no indicators etc running. The main issue is that NT becomes unstable when this occurs when you draw the channel with 'Dash' instead of 'Solid. NT chart goes blank, freezes and the whole platform becomes unstable. If you are lucky, it unfreezes 15 seconds later, if not, as when I was in a trade yesterday....

      This also happens with markets closed and no new data being processed (testing this morning). NT is for some reason recalculating and repainting the channel as you scroll through the chart.

      I getting testing/reproducing for you, I found this issue only occurs on charts with more than one data series, which is why you might not have seen the issue your side first test.

      Here are the steps to reproduce

      Open a new chart (I used NQ 06-18) with 3 days 150 tick data
      Size the window so that not all data is shown in one window and there are maybe 100 bars showing
      Add your indicator. All this indicator does in OnBarClose/ObBarUpdate is

      Draw.RegressionChannel(this, "lrc3", false, 300, 0, LineColour, DashStyleHelper.Dash, 3, LineColour, DashStyleHelper.Dash, 1,LineColour, DashStyleHelper.Dash, 3);

      Scroll back and forth. All works fine.

      Add another dataseries with a different time period. NQ 06-18 240 minute, 30 days. In separate window or same and hidden as I tend to use it. Does not seem to matter

      Now, scroll back through the data and monitor the channel on the tick series. You'll note it jumps all over the place and is redrawing even though the data is not changing. Worse, I found the hard way that if you use dashstyle.Dash, NT chart windows all lock up when this occurs after a very short time and freeze for around 15 seconds. The platform then becomes unstable. Interestingly, I do not seem to get the freezes with DashStyle set to Solid, though the channel repainting issue still exists.

      In case you wish to see the issue firsthand and cannot replicate, here is a very short video made following the steps above



      For info, in further testing, and this is something I had observed over a considerable time period, but did not know the cause. Sometimes when scrolling the scale on a chart setup like this, the channel will disappear completely. It will come back when it re-draws if you continue to change the scale/scroll.
      Last edited by pjsmith; 03-30-2018, 03:22 AM.

      Comment


        #4
        Thanks for the steps to reproduce, pjsmith.

        I did not encounter an issue using Dash instead of Solid, but I was able to reproduce the issue with the regression channel not staying steady.

        Could you confirm that this is not an installation issue for using Dash? If that particular issue can be hit on a clean installation, is there any other detail you could share so we can hit the issue on our end?

        I'll report the "jumping" issue with the regression channel further and will update this post with more information as it becomes available.
        JimNinjaTrader Customer Service

        Comment


          #5
          Hi Jim,

          Here is another video example showing the problem on a clean install. I used the same exact steps to reproduce as before, but with linestyle set to dash. I cannot offer more than the steps I provided. I was recording this chart only, but at the end of the video, ninja trader completely quit (which is the first time I think I've had that. Normally it just locks up) and returned to the desktop. You don't see the desktop as the video terminates when the window closes.

          It is Saturday, so of course, not data coming in at all.

          I did up the bar count, as you'll see in the video. This would be more typical of the instances I have seen it happen in (I use 4 range charts) than the previous example which was a slightly longer time frame.



          I this instance, I experience the chart lock up and go blank, which is typical of what I see. All windows freeze. This time, ninjatrader just quit back to the desktop. Hopefully when the devs look at part of the issue, they will discover the cause for the other.

          No errors are reported in the logs, so I have nothing further I can add I think, other than to demonstrate it and show it happening. It is clearly reproducible here.

          I discovered this issue as my platform started to hang on Thursday. This was after a change I made earlier in the day to change the linestyles to Dash. I had thought it was something else at first. This was during a working session, so I was not able to test extensively ( I was attempting to trade at the time ). I changed the linetype back to solid and did not get the issue again. I did switch back once more to check and experienced the issue again, so changed back to solid once more and left it alone. I needed to work and can't have the platform crashing all the time. It could be the issue occurs regardless of the line type, but my limited testing seemed to indicate that it did not happen on the solid type. I had upgraded to .13 a day or so earlier. Otherwise, I have run the same channels with the solid type for many months and under the prior version (.12) and earlier. I did not experience this issue (the hanging - the repainting I believe was probably still there) with the line type set to solid.

          Comment


            #6
            Thanks again for the detail, pjsmith.

            I've been able to reproduce that issue as well.

            The ticket ID's for the issues are as follows.

            Chart freezing with Regression Channel using DashStyleHelper.Dash - NTEIGHT-12683 (This freeze involves interacting with the chart after data has been loaded and Regression Channel appears. Any observed "freezing" while the chart is loading 30 days of 20 tick data and processing it with an indicator would be expected since there are millions of operations for NinjaTrader to complete.)

            Regression Channel changing directions - NTEIGHT-12687

            These ticket ID's can be found in the Release Notes page of the help guide for a future version of NinjaTrader that includes these fixes. We cannot present an ETA as they are fulfilled based on the development team's schedule and priorities.

            Release Notes: https://ninjatrader.com/support/help...ease_notes.htm

            If there is anything else we can do to help, please let us know.
            Last edited by NinjaTrader_Jim; 04-05-2018, 03:50 PM.
            JimNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by gentlebenthebear, Today, 01:30 AM
            2 responses
            13 views
            0 likes
            Last Post gentlebenthebear  
            Started by Kaledus, Today, 01:29 PM
            2 responses
            7 views
            0 likes
            Last Post Kaledus
            by Kaledus
             
            Started by frankthearm, Yesterday, 09:08 AM
            13 responses
            45 views
            0 likes
            Last Post frankthearm  
            Started by PaulMohn, Today, 12:36 PM
            2 responses
            16 views
            0 likes
            Last Post PaulMohn  
            Started by Conceptzx, 10-11-2022, 06:38 AM
            2 responses
            56 views
            0 likes
            Last Post PhillT
            by PhillT
             
            Working...
            X