• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simple Line indicator

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

    Simple Line indicator

    Hello,

    I am looking for a way to have a horizontal line (hopefully only the width of a bar) automatically drawn above or below (by a specified # of ticks) the prior bar .. There may be an indicator already in Ninjatrader that already does this but I can't find one. most offset by time rather than price. The goal is to attach an alert that will execute a bar-based trailing stop order.

    Thanks

    #2
    Hello Rashid Garuba,

    A line can be drawn with Draw.Line(). (A horizontal line would stretch across the chart)
    https://ninjatrader.com/support/help.../draw_line.htm

    The high of a bar is provided by the High series and index by a bars ago value.
    https://ninjatrader.com/support/help...en-us/high.htm

    For example:
    Draw.Line(this, "myLine", 1, High[1], 0, High[1], Brushes.Blue);

    I didn't find an existing indicator exactly like this but there may be one out there. This thread will remain open for any community members that may know of one.

    Below I'm also including a link to a forum post with helpful information about getting started with NinjaScript.
    https://ninjatrader.com/support/foru...040#post786040
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by _Zero_, 12-31-2019, 09:18 AM
    17 responses
    155 views
    1 like
    Last Post aviat72
    by aviat72
     
    Started by billythekid72, Today, 09:47 AM
    2 responses
    7 views
    0 likes
    Last Post billythekid72  
    Started by JohnS52, Today, 09:49 AM
    0 responses
    6 views
    0 likes
    Last Post JohnS52
    by JohnS52
     
    Started by DTSSTS, Today, 08:29 AM
    3 responses
    23 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by mtamaku, Today, 08:39 AM
    3 responses
    15 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X