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

Plot using RoundedToTickSize in non primary BarsArray - question

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

    Plot using RoundedToTickSize in non primary BarsArray - question

    I am using the following code snippet in a multi time frame indicator:

    Neutral.Set(EMA(BarsArray[9],20)[0]);

    It works with no problem and properly shows me a price marker on the right side.

    Now I am trying to "convert" this to use RoundedToSickSize. In other indicators I used to use this, and it worked:

    Neutral.Set(Instrument.MasterInstrument.Round2Tick Size(EMA(20)[0]));

    However, when I am now trying the following to access the BarsArray[9]:

    Neutral.Set(Instrument.MasterInstrument.Round2Tick Size(EMA(BarsArray[9],20))[0]);

    I get an error message as it does not want to accept the code, "... has some invalid arguments".

    Any idea what I need to do differently here?

    sandman








    #2
    Hello sandman,

    Thanks for your post.

    If the Neutral.Set() code is copied verbatim, you have an extra end parenthesis after the EMA and before its BarsAgo reference. I have a video demonstration testing Round2TickSize with an EMA on a secondary series and I am not seeing any issue. Demo and test script attached.

    Demo - https://drive.google.com/file/d/1tIt...w?usp=drivesdk

    Please let me know if there is anything else we can do to help.
    Attached Files
    JimNinjaTrader Customer Service

    Comment


      #3
      Jim. Thank you very much for your very comprehensive response incl the video. You are right: it was that extra parenthesis.

      sandman

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Johnny Santiago, 10-11-2019, 09:21 AM
      95 responses
      6,193 views
      0 likes
      Last Post xiinteractive  
      Started by xiinteractive, 04-09-2024, 08:08 AM
      2 responses
      11 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by Irukandji, Today, 09:34 AM
      1 response
      3 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by RubenCazorla, Today, 09:07 AM
      1 response
      5 views
      0 likes
      Last Post RubenCazorla  
      Started by TraderBCL, Today, 04:38 AM
      3 responses
      25 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X