Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Regressionchannel drawing

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

    Regressionchannel drawing

    Hi,

    If I draw a regression channel (via Ninjascritpt), and have it's 'end bar' set to -3, so it extends forward a little beyond the last bar, that works fine. But, what I have noticed is, this is not possible to do when manually drawing a regression channel (you cannot move beyond the last printed bar when drawing it), and 2, the issue I think, is if you do this via script, the regression channel will wiggle as new bars are developing. I guess this is because the regression channel is recalculating values from the new bars. One of the issues with this, is on 300 bars or so, that actually takes a lot of resources and the pauses on new bars can actually be noticeable.

    Could you - A, please confirm that this is the behaviour of the regression channel tool when drawn like this, and b, is it possible to draw it as a static object, like a manually drawn regression channel so that no further calculation is done?

    Thanks.

    #2
    Hello pjsmith,

    Thank you for your reply.

    The regression channel, when drawn manually, cannot have its anchor points outside the currently formed bars, that's correct. However, it can be extended to the right, beyond the currently formed bars. When drawing a regression channel from NinjaScript, if the End Anchor is placed beyond the currently forming bars, it would be expected that may change the end anchor point as bars progress.

    Anchors in the future are estimates since we couldn't say for sure what time that anchor would actually be at, even on time based charts. However, it is more likely to seen on small time frame charts like 1 second.

    This is also related to the chart being equidistant.

    So if you for example drew a vertical line at what you expect to be 10 seconds in the future on a second chart, you would do so expecting that each second would have a bar there. However, if only 3 of those seconds had ticks that bar would occur 7 bars sooner than you expected, causing the "wiggling" you mentioned.

    What I would suggest trying is to draw the regression channel so that both anchors are within the bars that have already formed and then using something like this to extend it right:

    // Instantiate a RegressionChannel object
    NinjaTrader.NinjaScript.DrawingTools.RegressionCha nnel myRegChan = Draw.RegressionChannel(this, "tag1", 10, 0, Brushes.Blue);

    // Change the object's ExtendRight
    myRegChan.ExtendRight= true;

    This will let you extend the object into the future without the wiggle, since both the start and end anchor points are already known quantities.

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by alifarahani, Today, 09:40 AM
    6 responses
    25 views
    0 likes
    Last Post alifarahani  
    Started by Waxavi, Today, 02:10 AM
    1 response
    17 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by Kaledus, Today, 01:29 PM
    5 responses
    13 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by Waxavi, Today, 02:00 AM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by gentlebenthebear, Today, 01:30 AM
    3 responses
    17 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X