Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Not sure how IsExitOnSessionCloseStrategy works

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

    Not sure how IsExitOnSessionCloseStrategy works

    Hey I have set IsExitOnSessionCloseStrategy and it corresponding ExitOnSessionCloseSeconds and I am not sure how these properties actually work. It would be nice to understand the underlying mechanics of them.

    Some questions I have about it are. If I have an entry in the market with a corresponding target and stop entries and market close occurs are those entries cancelled and how does it happen. Do I need to associate my entry, target and stop orders with the exit on close order that may be submitted?

    Is there anyway to know when this event actually occurs in code, i.e. is there an event that can be over ridden? The reason I ask is that I have an intraday tick by tick strategy that has an entry that keeps getting filled multiple times per session and I would like it to only set up once per trading session. I could set up a variable that gets set false at session close and then gets set true when my first and only entry order gets submitted and accepted for that day. That way I can check to make sure I am only getting one order submitted/accepted per strategy session.


    #2
    Hello NeverDownMoney, thanks for your post.

    On the stop and target applied to an entry order: If the entry with protective orders gets closed out the protective orders will also get canceled, this is due to the use of the Managed Approach. You can target specific entry orders by matching up its signal name parameter with the "fromSignalName" parameter when you set up the stop and target.

    We have the IsFirstBarOfSession and IsLastBarOfSession properties:

    https://ninjatrader.com/support/help...rofsession.htm
    https://ninjatrader.com/support/help...rofsession.htm

    You could check these for true and set the proper booleans at that time. Other than this method, you would need to monitor the system time with the DateTime object to know the precise time after the RealTime state is reached (which means this will not be backtestable).

    Kind regards,
    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      I don't think that IsFirstBarOfSession and IsLastBarOfSession properties will work for a tick by tick Day strategy, From documentation -
      Warning: This property will always return false on non-intraday bar periods (e.g., Day, Month, etc). For checking for new non-intraday bar updates, please see IsFirstTickOfBar

      Perhaps I should use IsFirstTickOfBar instead?

      Currently I am watching for -

      // Keep track of whether it is the end of session or not to
      if (order.Name == "Exit on close") { isEntrySubmitted = false; }

      Comment


        #4
        Hello NeverDownMoney, thanks for your reply.

        IsFirstTickOfBar would work to mark the very first tick of the session. If that is true, set a bool to true and once a single trade is made, set the bool to false to prevent trading for the rest of the day.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by soon123, Today, 02:14 AM
        0 responses
        6 views
        0 likes
        Last Post soon123
        by soon123
         
        Started by guilhem, Today, 01:53 AM
        1 response
        6 views
        0 likes
        Last Post sgkcfc
        by sgkcfc
         
        Started by elkingonzalez, 11-24-2020, 09:59 AM
        4 responses
        40 views
        0 likes
        Last Post MrSmart
        by MrSmart
         
        Started by Photon66, Today, 12:03 AM
        0 responses
        9 views
        0 likes
        Last Post Photon66  
        Started by morrnel, Yesterday, 09:38 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Marco  
        Working...
        X