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 lmatiukas, Today, 07:09 PM
    0 responses
    2 views
    0 likes
    Last Post lmatiukas  
    Started by ComfyCouch, Today, 06:04 PM
    0 responses
    12 views
    0 likes
    Last Post ComfyCouch  
    Started by Ousher, Today, 04:35 PM
    0 responses
    4 views
    0 likes
    Last Post Ousher
    by Ousher
     
    Started by Rugosoft, 11-17-2020, 08:22 AM
    3 responses
    38 views
    0 likes
    Last Post Shansen
    by Shansen
     
    Started by hpolthof, Today, 03:48 PM
    0 responses
    7 views
    0 likes
    Last Post hpolthof  
    Working...
    X