• 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

assigning trading hours within OnStateChange

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

    assigning trading hours within OnStateChange

    Hi,

    Is it possible to assign (re-assign) or change the Trading Hours within OnStateChange for the primary data series?

    E.g. suppose I have a strategy that I am running on ZS and ES, where for ZS I want to use say CBOT Agriculturals ETH, while for ES I want to use CME US Index Futures ETH.

    Can I do something with in OnStateChange like this: if instrument.MasterInstrument.name contains ZS then use CBOT Agriculturals ETH, else if instrument.MasterInstrument.name name contains ES than use CME US Index Futures ETH ?


    #2
    Hello uday12,

    Thanks for your post.

    When you assign a strategy to a chart, the strategy will use the Trading hours of the charts data series. When you apply it to the ES (assuming default trading hours used) then the strategy will use the CME US Index Futures ETH as that is the default for the ES. When you the strategy to ZS, it will use the default trading hours of CBOT Agricultural ETH as that is the instruments default trading hours.

    In the case of a strategy that has both data series, the strategy would use the primary data series trading hours (which cannot be changed by the strategy), however when you add the second data series you can specify in the AddDataSeries() method which trading hours to use for that data series. reference: https://ninjatrader.com/support/help...dataseries.htm

    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by liquid150, Today, 06:22 AM
    0 responses
    5 views
    0 likes
    Last Post liquid150  
    Started by liquid150, Today, 06:20 AM
    0 responses
    4 views
    0 likes
    Last Post liquid150  
    Started by bubblegum, Yesterday, 01:13 AM
    2 responses
    12 views
    0 likes
    Last Post bubblegum  
    Started by Atilla, Yesterday, 04:05 PM
    1 response
    54 views
    1 like
    Last Post im197
    by im197
     
    Started by vevbarrq, Today, 12:11 AM
    0 responses
    4 views
    0 likes
    Last Post vevbarrq  
    Working...
    X