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

FOREX.com Order Rejected Reason

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

    FOREX.com Order Rejected Reason

    Situation:
    • AddOn
    • Connected to a live FOREX.com Account
    • A Long position with multiple Orders, some Filled, some Working (Limit and Stop Market)
    • Market Sell Order submitted to exit an associated filled Buy Order some several seconds after the Buy was filled
    • Order is Rejected with the Comment "Another instruction has already made changes to the trades and orders."
    Note that I am not here looking for a code or logic analysis. (No need for trace/log investigations.) I want to know what this rejected error means and how one can either avoid it or reduce the risk of it (or, preferably, eliminate it, given the discussion that follows).

    There was a Forum post more than four years ago about this: https://ninjatrader.com/support/foru...order-handling

    The comment there from NT Support is "This is due to the G2 adapter used in FOREX.com. This occurs when multiple attempts to change the order are seen in quick succession. FOREX.com will have further details on exactly why this occurred".

    The discussion there relates to Managed Orders, not an AddOn. It also relates to what would appear to have been an attempt to "reverse" a position.

    Further along in the thread, the following comment is made: "This is a known item that has been reported to FOREX.com. Currently this is expected on their end as two orders cannot act on the same position at the same time. They have let our development team know they are looking into this to attempt to prevent this error.".

    Questions:
    1. In the context of the situation described at the beginning of this post above, what is the meaning of this type of rejection for this Order submitted from an AddOn?
    2. Is this same error message as in the "long ago" post likely to be for a different reason? (Doesn't seem to make much sense in context.)
    3. As noted in that long-ago post, the behaviour was reported to FOREX.com, and the implication is that it is "unintended" behaviour that FOREX.com would investigate and possibly change -- what was the outcome of that process? (Is there any hope of improved behaviour, four+ years later?)
    4. Is there any know avoidance or "risk reduction" approach for this circumstance?
    Note that I have not approached FOREX.com on the matter, given there has been organisational-level contact from NinjaTrader in the past. One would hope that the interaction at an organisational level could be effective at resolving this.

    Grateful for updates, insights, etc.

    Thanks.
    Multi-Dimensional Managed Trading
    jeronymite
    NinjaTrader Ecosystem Vendor - Mizpah Software

    #2
    Hello jeronymite,

    Thank you for your note.

    Because this thread involves NinjaScript strategy concerns and the solution has to do with the NinjaScript logic, I am going to move this to the Strategy Development section of the forums.

    This error is a known item due to how reversals in NinjaTrader work with FOREX.com; they do not always work nicely together. We are tracking interest via feature request SFT-5324 which requests to improve the FOREX.com reversal handling. I will add your vote to the request.

    Currently, as you have described in your bullet points, this is a result of a close position/exit order is received after the reversal entry. In order to mitigate this, you could do the following with the NinjaScript logic when you want to reverse:
    • Set a bool, for example "WaitingForExit" when you want to reverse
    • Submit your exit order to exit the position
    • Check for that exit order to be executed in OnExecutionUpdate() along with your bool
    • Once you see the execution and WaitingForExit is true, use a market order to enter in the reversed direction and then set the bool back to false
    This has also been discussed in the following forum post:
    I have been trying to do live trading using Forex.com (form the NT 8 platform) for some time time. I keep getting errors that shut down my trading. The log: 2021-09-02 11:44:30:053|2|4|Session Break (Version 8.0.24.3) 2021-09-02 11:44:31:263|1|4|Verifying license at primary server... 2021-09-02 11:44:31:368|1|4|Type=Regular


    I hope this helps to answer your questions by clarifying what is happening and how to prevent it from happening. Please feel free to reach out with any additional questions or concerns.
    Emily C.NinjaTrader Customer Service

    Comment


      #3
      Thanks, NinjaTrader_Emily. (And thanks for moving the post.)

      As mentioned, this is an AddOn, and the Order that demonstrated this issue was the corresponding exit Order for a previous Buy that had executed many seconds beforehand. It was not a reversal -- it was an exit.

      Thanks for adding my vote to SFT-5324. Nevertheless, I believe this is not a "feature request" -- it is a bug. Whilst understanding that brokers monitor the sequence of Orders and their timing, there should be zero impediment to exiting a position. The outcome of this bug in the case discussed was an open position when it should have been completely flat.

      It's easy to say "well, just go check, and if it's still open, flatten it". No! That is not an acceptable approach in a commercial-grade product! This is real money on the line, and a commercial financial product must fix issues that are obviously poorly designed or implemented, and acknowledged as such. In the case of this issue, it was identified more than four years ago. It is acknowledged to be an issue, not a "wouldn't it be nice to do this differently" matter.

      This should be reclassified as a bug, and NinjaTrader and FOREX.com should jointly work to eliminate it.

      Thanks.
      Multi-Dimensional Managed Trading
      jeronymite
      NinjaTrader Ecosystem Vendor - Mizpah Software

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by f.saeidi, Today, 10:19 AM
      0 responses
      2 views
      0 likes
      Last Post f.saeidi  
      Started by kujista, Today, 06:23 AM
      4 responses
      14 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by traderqz, Yesterday, 09:06 AM
      2 responses
      16 views
      0 likes
      Last Post traderqz  
      Started by traderqz, Today, 12:06 AM
      3 responses
      6 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by RideMe, 04-07-2024, 04:54 PM
      5 responses
      28 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X