Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 GussJ, 03-04-2020, 03:11 PM
      11 responses
      3,227 views
      0 likes
      Last Post xiinteractive  
      Started by andrewtrades, Today, 04:57 PM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by chbruno, Today, 04:10 PM
      0 responses
      7 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Started by josh18955, 03-25-2023, 11:16 AM
      6 responses
      440 views
      0 likes
      Last Post Delerium  
      Started by FAQtrader, Today, 03:35 PM
      0 responses
      12 views
      0 likes
      Last Post FAQtrader  
      Working...
      X