Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get IOrder AvgPrice > possible ??

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

    Get IOrder AvgPrice > possible ??

    Hi all. I catch myself coming back here because I always get decent answers from this community

    I have a strategy that has two sets of opening conditions: one long and one short. I use IOrders, so their respective names are LLA and SRA.

    I am now coding a certain aspect of my strategy where I would like to check whether the price of an opened position is above (or below) certain level. I tried
    Code:
    SRA.AvgPrice < Close[0]
    but that does not seem to work

    I know that
    Code:
    Position.AvgPrice < Close[0]
    DOES work, so I was wondering if the same or similar syntax exists for IOrders.


    Thank you for your consideration !!

    #2
    Hello Spinn,

    If you are looking for the fill price of an order use IOrder.AvgFillPrice.

    Below is a link to the help guide on IOrder.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi NinjaTrader_ChelseaB

      Thanks for your quick reply!

      I already knew about IOrder.AvgFillPrice, but that is not working in this case:

      I am using a secondary, finer grain, time period to check for times where the CURRENT price (and not the FILL price) of an open order is below or above a certain level, so I can adjust my trail accordingly.

      Is this possible for IOrders ?? I know it can be done with 'regular' positions using
      Position.AvgPrice, and was wondering if it were at all possible with IOrders. Perhaps a workaround exists ??

      Comment


        #4
        Hello Spinn,

        I'm not sure that I am understanding.

        You can compare any series price to the price of an order.
        Closes[0][0] thats the current primary bars price.
        Closes[1][0] thats a secondary added series current price.

        Orders do not have a value for the current price. They have values for the limit price, the stop price, and the fill price.

        If you are not wanting the fill price of the order, what are you wanting from the order?

        The position will take all orders on that instrument made by the strategy and average the prices together.
        Last edited by NinjaTrader_ChelseaB; 09-21-2016, 03:47 PM.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        633 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        364 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        567 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        568 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X