Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MBTrading: Account Temporarily Unavailable in Forex - can it be checked using code?

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

    MBTrading: Account Temporarily Unavailable in Forex - can it be checked using code?

    Hello,

    I've made a strategy that runs 24 hours a day on forex and I'm noticing that at the 5pm rollover time and sometimes at midnight if it tries to send an order through I get a terminating error message saying that the account was unavailable. I can work around it by restarting my strategy, however I'm interested in knowing if there is simply a coding method to check if the account is available or not before placing the orders.

    If not, another workaround would be to cancel all pending orders and halt action at 5pm to 5:10pm and then resume, but that would require a lot of extra code to accommodate that.

    Thanks for any ideas or suggestions guys!

    Edit: I added "suspend pending orders" because my OnOrderUpdate handling includes followup orders to be submitted when one gets filled so it would make the same terminating error

    #2
    Hello RunnrX,

    Thank you for your post.

    There would be no method to check if the account is available. However, you can check if the order is rejected with an IOrder object: http://www.ninjatrader.com/support/h...nt7/iorder.htm

    For a reference sample on checking order status please visit the following link: http://www.ninjatrader.com/support/f...ead.php?t=7499

    If you want to incorporate a time filter you can find a reference sample at the following link: http://www.ninjatrader.com/support/f...ead.php?t=3226

    Please let me know if I may be of further assistance.

    Comment


      #3
      Thanks for letting me know. For now I'll probably just reset my strategy after each rollover and eventually program it to ignore actions during that time period - thanks!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      64 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      35 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      59 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      62 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      51 views
      0 likes
      Last Post CarlTrading  
      Working...
      X