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 Haiasi, 04-25-2024, 06:53 PM
      2 responses
      17 views
      0 likes
      Last Post Massinisa  
      Started by Creamers, Today, 05:32 AM
      0 responses
      5 views
      0 likes
      Last Post Creamers  
      Started by Segwin, 05-07-2018, 02:15 PM
      12 responses
      1,786 views
      0 likes
      Last Post Leafcutter  
      Started by poplagelu, Today, 05:00 AM
      0 responses
      3 views
      0 likes
      Last Post poplagelu  
      Started by fx.practic, 10-15-2013, 12:53 AM
      5 responses
      5,408 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Working...
      X