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 chbruno, Today, 04:10 PM
      0 responses
      3 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Started by josh18955, 03-25-2023, 11:16 AM
      6 responses
      436 views
      0 likes
      Last Post Delerium  
      Started by FAQtrader, Today, 03:35 PM
      0 responses
      6 views
      0 likes
      Last Post FAQtrader  
      Started by rocketman7, Today, 09:41 AM
      5 responses
      19 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by frslvr, 04-11-2024, 07:26 AM
      9 responses
      127 views
      1 like
      Last Post caryc123  
      Working...
      X