• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 aligator, Today, 12:29 PM
      0 responses
      8 views
      0 likes
      Last Post aligator  
      Started by bob77713, Today, 11:30 AM
      0 responses
      0 views
      0 likes
      Last Post bob77713  
      Started by FMtrader, 03-15-2019, 02:30 AM
      6 responses
      38 views
      0 likes
      Last Post James108  
      Started by timko, Today, 08:18 AM
      0 responses
      2 views
      0 likes
      Last Post timko
      by timko
       
      Started by victorsmith, Today, 06:00 AM
      0 responses
      6 views
      0 likes
      Last Post victorsmith  
      Working...
      X