Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to detect that the last trade is closed

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

    How to detect that the last trade is closed

    I want to detect the last trade event (is closed) to don't let the strategy open a new position while there is another is already opened.

    I want to use inside the OnBarUpdate()

    thank you in advance

    #2
    Hello averoos,

    To confirm the position is flat, use if (Position.MarketPosition == MarketPosition.Flat).

    Below is a link to the help guide.
    https://ninjatrader.com/support/help...etposition.htm
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by pdeering100, 07-14-2019, 09:43 AM
    9 responses
    1,153 views
    0 likes
    Last Post Joshua 1:8  
    Started by LeroyO, Today, 04:09 PM
    0 responses
    5 views
    0 likes
    Last Post LeroyO
    by LeroyO
     
    Started by sidlercom80, Today, 04:57 AM
    2 responses
    30 views
    0 likes
    Last Post NinjaTrader_Jim  
    Started by Tartagliagroup, Today, 02:11 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by rickyblah12, Today, 01:33 PM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X