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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    131 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    74 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    117 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    111 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    89 views
    0 likes
    Last Post CarlTrading  
    Working...
    X