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 wzgy0920, 04-20-2024, 06:09 PM
      2 responses
      27 views
      0 likes
      Last Post wzgy0920  
      Started by wzgy0920, 02-22-2024, 01:11 AM
      5 responses
      32 views
      0 likes
      Last Post wzgy0920  
      Started by wzgy0920, 04-23-2024, 09:53 PM
      2 responses
      49 views
      0 likes
      Last Post wzgy0920  
      Started by Kensonprib, 04-28-2021, 10:11 AM
      5 responses
      193 views
      0 likes
      Last Post Hasadafa  
      Started by GussJ, 03-04-2020, 03:11 PM
      11 responses
      3,235 views
      0 likes
      Last Post xiinteractive  
      Working...
      X