Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Looking for Swing Indicator

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

    #31
    Hello,

    Unfortunately, it looks like your screenshot did not upload correctly. However, this should be fairly easy to accomplish, using the DrawLine() method, as long as you can define your starting and ending x and y values. Using the last version of the indicator in this forum thread, you should be able to edit the condition that draws dots as follows:

    Code:
    if (High[0] > High[1] && High[0] > lastDotPrice)
    {
    	DrawDot("hh"+upCount, false, 0, High[0] + 1 * TickSize, Color.Green);
            DrawLine("line" + CurrentBar, 0, High[0] + 1 * TickSize, lastDotBar, lastDotPrice + 1 * TickSize, Color.Green);
    	lastDotPrice = High[0];
            lastDotBar = CurrentBar;
    }
    What I'm doing in the above snippet is setting the starting X of the line to the current bar, and the starting Y to the current high. I'm then setting the ending X of the line to the bar number of the last dot drawn, and setting the ending Y to the high of that bar. You could switch this around to start in the past and end on the current bar, if you wish.

    For more information on DrawDot(), please see the link below:

    http://www.ninjatrader.com/support/h...l?drawline.htm
    Dave I.NinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    61 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    148 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    98 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    286 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X