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:
    [INDENT][FONT=Courier New]
                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; 
                    } 
                }[/FONT]
     [FONT=Courier New]//...[/FONT]
      [FONT=Courier New]
            private void OnExecution(object sender, ExecutionUpdateEventArgs e) 
            { 
                Print("EXECUTION: " + e.Execution.ToString()); 
            } 
            
            private void OnOrderStatus(object sender, OrderStatusEventArgs e) 
            { 
                Print("ORDER: " + e.Order.ToString()); 
            }[/FONT]
     [FONT=Courier New]//(etc)[/FONT]
    [/INDENT]


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




    Finally, I would recommend reviewing the help guide documentation on this topic,


    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 frankthearm, Today, 09:08 AM
        7 responses
        28 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by NRITV, Today, 01:15 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by maybeimnotrader, Yesterday, 05:46 PM
        5 responses
        25 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by quantismo, Yesterday, 05:13 PM
        2 responses
        16 views
        0 likes
        Last Post quantismo  
        Started by adeelshahzad, Today, 03:54 AM
        5 responses
        33 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X