Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem report: Strategy stopped by automatic error handling has green color

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

    Problem report: Strategy stopped by automatic error handling has green color

    Problem:
    If running strategy (in Unmanaged mode) gets order in state Rejected,
    then automatic error handling is activated. Strategy stops, but it still
    has the green color, like in case when it is running fine and correctly.

    This green color leads to false assumption, that strategy is OK and
    it it hard to understand, where is the problem.
    This should be fixed and strategy should get disabled at least, or be red coloured better.

    Best regards
    Misova

    #2
    Hello Misova,

    Thanks for your post.

    So that we can look into this further please email platformsupport[at]ninjatrader[dot]com with your log and trace files from a day this happened. Include the time that it happened and a link to this forum topic.
    BrandonNinjaTrader Customer Service

    Comment


      #3
      Hi Brandon,
      I have investigated the problem in the logs and I found the problem.

      One problem is solved: if there is a rejection and automatic error-handling is activated,
      then the strategy is not green. This was my false assumption. My mistake. Strategy was correctly disabled and had white color as it should have. So this part is solved and OK.


      The remaining problem is, that logical exception (not order related like order-rejection) was thrown in OnExecution() method. We do not catch/handle exceptions in this method. It had to bubble somewhere higher - probably into the NT error handler... ---> and this is the question/problem: the strategy remained green, it just didn't do anything (I expect it was doing nothing, because it didn't open trade 1 hour later, when it should open new trade and didn't write logs as the strategy periodically writes...)

      So the new primary question now is:

      What happens if exception (logical exception, not order-rejection) is thrown in OnExecution()
      method of the API ? Who/What catches the exception and how it is handled? What is the strategy processing after handling this exception?
      • A) exception is just logged and processing continues (by continuation I mean standard NT callbacks like OnBarUpdate(), OnExecution(), ... are invoked and strategy continues...)
      • B) exception is catched and next processing is stopped
      • C) or something else ?


      Which one is true A/B/C ?
      Last edited by misova; 05-04-2015, 10:58 AM.

      Comment


        #4
        Hello misova,

        This would depend on what your error handling is set to.

        If using the default settings, an exception will cause the strategy to become disabled.

        If using RealTimeErrorHandling.TakeNoAction then no action will be taken and the script will continue.
        http://www.ninjatrader.com/support/h...orhandling.htm
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thank you, understood.

          Just one additional question:
          For which cases the (default) realtime errror handling is activated ?
          A) is it for all orders, that got status Rejected
          B) is it for all exceptions, that are thrown and not catched in user code
          C) are there any other cases ?

          Default realtime error handling disables the strategy.
          And does it close all open positions and cancel all remaining pending orders of the strategy ?

          Thanx
          Misova

          Comment


            #6
            Hello misova,

            Things that will disable a strategy:

            Overfills, rejections, failed order modifications, exceptions, index errors, user interactions such as clicking the close button or flatten everything.

            No script will exit a position when disabled unless explicitly written to do so in OnTermination().

            Whether working entry and exit orders are cancelled depends on if you have set this to do so in Tools -> Options... -> Strategies -> NinjaScript.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by bortz, 11-06-2023, 08:04 AM
            47 responses
            1,606 views
            0 likes
            Last Post aligator  
            Started by jaybedreamin, Today, 05:56 PM
            0 responses
            9 views
            0 likes
            Last Post jaybedreamin  
            Started by DJ888, 04-16-2024, 06:09 PM
            6 responses
            19 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by Jon17, Today, 04:33 PM
            0 responses
            6 views
            0 likes
            Last Post Jon17
            by Jon17
             
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            15 views
            0 likes
            Last Post Javierw.ok  
            Working...
            X