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

Multiple time frames and methods.

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

    Multiple time frames and methods.

    When a generic class level method is called from OnBarUpdate, with BarsInProgress = 2, for example, does the method also need to identify the BarsInProgress or does it just take that which was active when called?

    At this time, I am writing duplicate methods, one for each time frame. Do I need to do that?

    #2
    Hello JGRtrader,

    Thank you for your reply.

    Unless the method contains things that specifically refer to one data series, for example Close[0] would use the close price of whatever data series is currently processing whereas Closes[1][0] would specifically refer to the latest close price of the first added series, then no, you don't need to write duplicates for each time frame as the currently processing data series when the method is called would be the one used in the method.

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Kate,
      Thank you for your clarification

      After thinking a about this a bit, it seems I would have to pass the variables, and constants as parameters of the method. This could get messy so it might be better to just go with the separate methods.
      Last edited by JGRtrader; 02-09-2022, 11:07 PM. Reason: Simplified my response

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by rbeckmann05, Yesterday, 06:48 PM
      1 response
      12 views
      0 likes
      Last Post bltdavid  
      Started by llanqui, Today, 03:53 AM
      0 responses
      6 views
      0 likes
      Last Post llanqui
      by llanqui
       
      Started by burtoninlondon, Today, 12:38 AM
      0 responses
      10 views
      0 likes
      Last Post burtoninlondon  
      Started by AaronKoRn, Yesterday, 09:49 PM
      0 responses
      15 views
      0 likes
      Last Post AaronKoRn  
      Started by carnitron, Yesterday, 08:42 PM
      0 responses
      11 views
      0 likes
      Last Post carnitron  
      Working...
      X