Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Pop up window blocks trading logic

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

    Pop up window blocks trading logic

    Hello.
    In rare occasions when the price movement is fast enough I get pop up error window shown below when submitting entry stop market order or limit order. The problem is once that window appears over chart it seems the strategy stops trading activity and ignore any order operations. The only way is to restart the strategy... Is there a way to make the strategy keep trading logic?

    Click image for larger version

Name:	image.png
Views:	22
Size:	58.6 KB
ID:	1296418

    #2
    Hello PopovDS,

    The default action that strategies take when an order rejection occurs is to become disabled. If your strategy is not becoming disabled that may mean that by the order being rejected your other logic stops working because it did not have logic to handle the rejection, that should only be the case if you are using a RealtimeErrorHandling setting that is not the default.
    JesseNinjaTrader Customer Service

    Comment


      #3
      The strategy does not get disabled. It keeps working but there is no any reaction to such methods as EntryLong, EntryLongLimit and so on...
      I use the following option:
      Code:
      RealtimeErrorHandling = RealtimeErrorHandling.IgnoreAllErrors;
      And the handle code (just logging):
      Code:
      protected override void OnOrderUpdate(Cbi.Order order, double limitPrice, double stopPrice,
                  int quantity, int filled, double averageFillPrice,
                  Cbi.OrderState orderState, DateTime time, Cbi.ErrorCode error, string comment)
      {
          if (order.OrderState == OrderState.Rejected)
          {
              if (_enableLog)
              {
                  _logger.Log(string.Format("Order time {0}: Order '{1}' has been rejected", order.Time, order.Name), CustomLogLevel.Warn);
              }
          }
      }​

      Comment


        #4
        Hello PopovDS,

        If you are using ignore all errors you would need to add debugging into OnOrderUpdate to verify that your handing the correct situations an also resetting any variables/logic in your script accordingly. Because you are choosing to handle the rejection that means you need to make sure your logic will continue to work after that event. The default action is to terminate the strategy so it has to be completely restarted, that is the only way the platform would be able to make sure the strategy will work normally after the rejection, it would have to recalculate and start over.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by llanqui, Today, 03:53 AM
        0 responses
        5 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        10 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        15 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        11 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Yesterday, 07:51 PM
        0 responses
        14 views
        0 likes
        Last Post strategist007  
        Working...
        X