Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

manually closing a trade a strategy has opened

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

    manually closing a trade a strategy has opened

    if I have a live strategy running (that opened a position) and I manually close the position - will the following statement see a flat account (from within my active strategy):

    privatebool Flat { get { return Position.MarketPosition == MarketPosition.Flat; } }


    I am asking because it seems that if the strategy opens a position, then it will not return TRUE until the strategy closes the position (is this correct ?)

    And if it is correct, how can I tell from within the strategy that the position is no longer open (so I can have the strategy stop managing the trade) ?

    This seems to be the case also if a position is open from a historical bar and then it catches up to the latest bar - but keeps the position open when in reality there is no open position).



    #2
    Hi Greg,

    That property only reads the strategy position, which is generated based on orders that the strategy manages. If you manually close an account position, this has no effect on the strategy position.


    NinjaScript strategies are designed as fully automated solutions, so there's no way to "tell" the strategy position your current account position. The strategy position is based only on the ruleset of your strategy and its management of orders.

    If you're looking for a model where the strategy opens a position but then you manually manage the exits, check into NinjaScript > ATM integration:
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

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