Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Position.MarketPosition == MarketPosition.Long

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

    Position.MarketPosition == MarketPosition.Long

    In the context of OnBarUpdate

    if ( conditions )
    {
    entryorder = EnterLong(Quantity, label);
    }


    If these four conditions below are TRUE:
    order == entryorder
    order.OrderState == OrderState.Filled
    order.OrderState != OrderState.PartFilled
    order != null



    Is this condition below ALWAYS going to be TRUE?
    Position.MarketPosition == MarketPosition.Long



    Thanks

    #2
    Hello Stratagemma,

    While if an order fills this will create a long position, this will happen asynchronously. Meaning there may be a moment before OnPositionUpdate runs where the Position.MarketPosition has not yet been updated.

    Also, if another order gets you out of the trade, the MarketPosition is no longer long, so this will not stay true.

    So I can't say thats exactly always true, but in a general sense, yes it mostly will be.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by rbeckmann05, Yesterday, 06:48 PM
    1 response
    12 views
    0 likes
    Last Post bltdavid  
    Started by llanqui, Today, 03:53 AM
    0 responses
    6 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    10 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    15 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Working...
    X