Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SMA of OBV crossover Indicator

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

    SMA of OBV crossover Indicator

    Hi,

    I am new to Ninjascript. I was trying to create an indicator with below condition.

    - If 13 Period SMA of OBV is greater than 50 period SMA of OBV, plot a green arrow below the price candle.
    - If 13 Period SMA of OBV is less than 50 period SMA of OBV, plot a red arrow above the price candle.

    I have attached my code to this thread. No arrows are being plotted however. Can someone please help me out?

    Thanks,
    Deepak
    Attached Files

    #2
    Hello dpkgpl91,

    Thank you for writing in and welcome to the NinjaTrader Support Forum!

    Take a look at your Properties region.

    You're trying to obtain the values of Values[1] and Values[3].

    You have added two plots in Initialize().

    The first added plot will be at index 0. The second will be at index 1.

    Your getter for PlotRed is attempting to access Values[3], which does not exist.

    You will want to change PlotGreen's getter to Values[0] and PlotRed's getter to Values[1].

    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Wow that was a fast response. Thanks for the feedback. It worked like a charm.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by szferi, Today, 02:04 AM
      0 responses
      1 view
      0 likes
      Last Post szferi
      by szferi
       
      Started by MidenThur, Today, 12:52 AM
      0 responses
      6 views
      0 likes
      Last Post MidenThur  
      Started by seseoraf, Today, 12:51 AM
      1 response
      6 views
      0 likes
      Last Post charmingishagarg  
      Started by Rosario, Today, 12:50 AM
      0 responses
      3 views
      0 likes
      Last Post Rosario
      by Rosario
       
      Started by kemoyums, Today, 12:38 AM
      0 responses
      3 views
      0 likes
      Last Post kemoyums  
      Working...
      X