Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add Channel Lines To The SMA Indicator

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

    Add Channel Lines To The SMA Indicator

    Hello,

    I am trying to add channels lines that would parallel and move with the Simple Moving Average at a fixed price level above and below the SMA line.
    • For example lets say the SMA price level on a 5 minute chart is $3000 at 10:45am. I am looking to add channel plots that would be at the price level of $3005 and $2995. Next bar at 10:50am the SMA is at $3001 and so the channel lines should start moving up with the SMA with new channel plots for 10:50am should be $3006 and $2996.
    Any help would be greatly appreciated.

    #2
    Hello Cross161,

    Welcome to the NinjaTrader forums.

    Use AddPlot() to add plots, and set the Values[plotIndex][barsAgoIndex] to set the value for the plot.

    Below are links to the help guide.
    https://ninjatrader.com/support/help...t8/addplot.htm
    https://ninjatrader.com/support/help...nt8/values.htm
    https://ninjatrader.com/support/help.../nt8/value.htm

    Add ticks to the values from the SMA calls with TickSize.

    For example:
    Values[0][0] = SMA(7)[0] + 5 * TickSize;

    Below is a link to the help guide.
    https://ninjatrader.com/support/help...8/ticksize.htm

    Also, below is 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


      #3
      Thank you Chelsea!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by wooofad, Today, 11:34 AM
      1 response
      25 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by mr_trade, Today, 08:41 AM
      1 response
      20 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by StoneMan78, Today, 05:24 AM
      1 response
      17 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by rocgusma, Yesterday, 04:42 PM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Jorge.andres.o, 09-17-2020, 06:00 PM
      2 responses
      49 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X