Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Anybody else here seen this strange order entry issue?

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

    Anybody else here seen this strange order entry issue?

    Hi all...

    I'm wondering if anybody else is having this issue and, if so, what they did to fix it.

    Here's what keeps happening with the strategy I'm working on:

    I enable the strategy, which is set to take only very specific trade setups.

    Sometimes, before the strategy engages, I see a setup I want to take.

    So... the default number of contracts in the strategy is 10.

    I also have the chart trader open in another chart window with the same number of contracts. No ATM strategy.

    I open a trade in the desired direction using the chart trader, and the trade begins to move in my desired direction.

    Now... at a certain point, the strategy sees an entry opportunity in the opposite direction. This is by design. However... and here is where it gets dicey...

    The strategy is set to enter the market and set a stop loss of 8 ticks from the entry price. If I'm not in the market on a "manual" trade (like im my above example), this automated goes off without a hitch... and the automated trade is executed with the necessary stop loss in place... and off we go...

    If, however, I have an open position, what happens is that the strategy closes my open position, but only places the stop loss order... in other words, the order for 10 contracts that it is placing... cancels my "manual" order, but the strategy never goes ahead and places the actual orders it's supposed to place. It is apparent that it's ignoring the fact that I already have a position open.

    How do I get the strategy to "work along with me" so that it knows I'll be occasionally placing manual trades and to close any open order I've placed manually, and then, go ahead and place its order as specified in the code of the strategy?


    Does anyone here know the absolute correct way to handle this?

    I feel like that guy who says to his robot: "Hey... I'm over here!"

    -V

    #2
    Hello V,

    What you're observing is a limitation of NinjaTrader 7. Currently, NinjaScript strategies do not have the ability to read real-world account positions.

    For example, if your account was in a manual 10 LONG position, your strategy would not be aware of the account position.

    This means that if the strategy is "flat" at that time, and if programmed to execute 10 SHORT, it will only execute an order to sell 10 contracts, and not the 20 to reverse the position as you're expecting. This leaves your account FLAT, while the strategy position is SHORT.

    It is important to understand the difference between an Account position and Strategy position. You can read more about these concepts from the following page:



    At this time, there is not a direct solution for your strategy to be able to read your account position. There may be some unsupported techniques other community members can advise you on to help in this area, but we do not support strategies reading account positions as there can be unforeseen consequences in doing so.

    The upcoming release of NinjaTrader 8 will have the ability to read and adopt real-world account positions.

    Until that release, the only advice I have to help mitigate this scenario is to connect two brokerage accounts, one for manual trading, and another for automated.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Thanks for the fast reply, Matthew. I appreciate it. Gonna have to wait until NT8.

      -V

      Comment


        #4
        Originally posted by Aurum View Post
        Thanks for the fast reply, Matthew. I appreciate it. Gonna have to wait until NT8.

        -V
        Unless you want to use some unsupported methods to get the account position, of course. Search the forum. One method has been published multiple times.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        639 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        366 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        107 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        569 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        572 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X