• 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

Overnight Strategies Are Disabled...

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

    Overnight Strategies Are Disabled...

    Hi,
    I have a custom strategy written for me by a developer. The strategy has start, stop times, ATM selection, etc. What I would like to do is enable the strategy before I go to bed - say 10pm EST. Then the enabled strategy would "start" at my selected start time and look for the setup until the stop time. The custom strategy also has a "profit goal" that when hit during trading closes positions and no more trades are taken.

    2 questions:

    1) There seem to be NT "system resets" or "system updates" that happen around midnight that sometimes (I can't say all the time) disable my strategy. Based on your knowledge of what NT does at 12am (end of a day start of a new day) would this cause enabled strategies to disable?

    2) Account activity for the day "zeroes out" at midnight. If NT is running when this happens does this happen correctly? Or does NT need to be shutdown and restarted to correctly reset my accts to zero?

    At this point I find myself waking up at 12:01am to enable my strategies and then go back to bed and that is a major pain!

    Thank you for your help.
    Mark

    #2
    Hello Marklhc1988, and thank you for your questions.


    To your first question, first, I would like to mention that we do recommend that you monitor your strategy and machine while running any automated strategy to avoid any unforeseen errors. That said, what you are observing is data feed specific. There are some data providers such as IB TWS that are known to reset at night.




    To your second question, If you would like your strategies to be aware of your account position, you can use code such as the following.
    Code:
    foreach (NinjaTrader.Cbi.Account a in NinjaTrader.Cbi.Globals.Accounts) { if (a.Name == accountName) { account = a; account.Execution += new ExecutionUpdateEventHandler(OnExecution); account.OrderStatus += new OrderStatusEventHandler(OnOrderStatus); account.PositionUpdate += new PositionUpdateEventHandler(OnPosition); account.Connection.ConnectionStatus += new ConnectionStatusEventHandler(OnConnection); break; } } //... private void OnExecution(object sender, ExecutionUpdateEventArgs e) { Print("EXECUTION: " + e.Execution.ToString()); } private void OnOrderStatus(object sender, OrderStatusEventArgs e) { Print("ORDER: " + e.Order.ToString()); } //(etc)


    I would also review the code at this link, which can help you sync your strategy and account positions


    http://www.ninjatrader-support.com/v...ead.php?t=4033

    Finally, I would recommend reviewing the help guide documentation on this topic,
    http://ninjatrader.com/support/helpG..._positions.htm

    Please let us know if there are any other ways we can help.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      With regard to the question about running a strategy overnight, I also have a question about that. Mark's question was would the reset cause enabled strategies to disable and I feel you have not answered that part yet. Whether or not one's data feed resets, will an enabled strategy be disabled? If yes, what can be done to ensure the strategy remains enabled? Please let me know. Thanks.

      Comment


        #4
        Hello,

        Thank you for the reply.

        Yes, the strategies would be disabled if the data connection is reset.

        Whether or not one's data feed resets, will an enabled strategy be disabled?
        If the data feed is not being reset there should not be a reason that the DataFeed would have to disable a strategy, are you seeing that a script you are creating is being disabled while connected? Can you provide more detail on this comment?


        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ahadari28, Today, 04:01 PM
        0 responses
        1 view
        0 likes
        Last Post ahadari28  
        Started by TazoTodua, Today, 06:00 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by TazoTodua, Today, 09:06 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by gbux11, Today, 02:36 AM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by NinjaCustomer, 05-09-2019, 08:54 AM
        4 responses
        67 views
        0 likes
        Last Post Harry
        by Harry
         
        Working...
        X