• 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

Live strategy behavior around rollover

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

    Live strategy behavior around rollover

    Hi,

    I want to understand live strategy behavior around rollover.

    Situation: I am trading "ES 06-19" and I have a live contract position of long 5 contracts, and there are 8 calendar days to maturity, and I would like to rollover from "ES 06-19" to "ES 09-19" for the same 5 contracts on 23 hours window (6pm-5pm EST).

    Option 1:

    (a) Around the rollover dates, close / disable the strategy completely in NT (e.g in control center strategies tab), and close out all positions

    (b) Restart / re-enable the strategy on the new contract.

    Option 2:

    (a) Manually end of the day, I put in a sell / buy orders of "ES 06-19" / "ES 09-19" on the broker's platform, sometime before 5pm.

    (b) Since I am running the strategy on 23 hours, between 5pm-6pm EST, I manually change the strategy in NT to run on "ES 09-19" instead of "ES 06-19".

    What settings for "StartBehavior" do I need? Should I set "StartBehavior = StartBehavior.AdoptAccountPosition" ?

    Option 3:

    (a) I run my strategy on a continuous contract. For instance, I am subscribed to IQ Feed, which has a continuous symbol "@ES #C". To do this, I add a new "instrument" via the instrument tab, say "ES_Cont" that is mapped to IQ Feed's "@ES #C"

    (is this even possible?? I tried to add a new instrument with name as "ES_C" as a future, and mapped it to "@ES#C" in IQ Feed, but when I tried to view it in a chart, I got an error, but when I add it as a stock, it seems to work)


    (b) I can then run the strategy on "ES_Cont", and also add "ES 06-19" and "ES 09-19", and then manually code in the rollover instructions in the code as well, such as if the price of "ES_Cont" matches with "ES 06-19" use "ES 06-19", but if it matches with "ES 09-19" do a rollover and use "ES 09-19" going forward.

    Once a quarter, during a weekend, update the strategy to add a new contract, e.g. "ES 12-19" within the strategy code.

    ---

    I wanted to check: which of Option 1, or Option 2, or Option 3 is popular, preferable etc. What has been a common practice? Recommended practice?

    Thanks







    Last edited by uday12; 03-31-2019, 08:17 AM.

    #2
    Hello uday12,

    I recommend thinking of the new contract as different instrument.

    Changing the contract month would prevent the strategy from matching any previously placed live trades.

    If you want the account to be in sync with the strategy when the strategy is enabled, you can use synchronize account with immediately submit or wait until flat.

    Below is a link to a forum thread that discusses start behavior.
    https://ninjatrader.com/support/foru...-open-position


    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      Thanks for the answer.

      Just to be clear, your recommendation is to (1) stop trading a contract before (or on) the rollover date when it needs to rollover to the new contract, disable the strategy, (2) re-enable the strategy on the next contract.

      How can I get the programmatically get rollover date in Ninjascript, if I want to stop or exit a contract on the date it would be needed to rollover it over to the next contract? I saw in the NT help guide, there is a RolloverCollection https://ninjatrader.com/support/helpGuides/nt8/en-us/ , but the example is very clear.

      Would it be possible for you to help me with an example where (1) if the strategy is in live mode, (2) get the "current" contract's rollover date from the Rollover collection, and (3) if today's date is the rollover date, then if there are any live positions, exit them ?

      Thanks



      Comment


        #4
        Hello uday12,

        I would recommend closing all open positions on the old contract and enabling a new instance of the strategy on the new contract.

        The RolloverIndications indicator provides example logic for finding the next rollover. Below is a publicly available link.
        https://ninjatraderecosystem.com/use...indications-2/


        The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks Chelsea, very helpful.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by bomanpbm, Today, 09:27 PM
          0 responses
          1 view
          0 likes
          Last Post bomanpbm  
          Started by tgn55, Today, 08:47 AM
          0 responses
          8 views
          0 likes
          Last Post tgn55
          by tgn55
           
          Started by ballboy11, 05-04-2019, 10:26 AM
          6 responses
          58 views
          0 likes
          Last Post Kermit
          by Kermit
           
          Started by mrlucky1x, Yesterday, 10:01 PM
          0 responses
          15 views
          0 likes
          Last Post mrlucky1x  
          Started by roger556, Yesterday, 09:22 PM
          0 responses
          8 views
          0 likes
          Last Post roger556  
          Working...
          X