Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 XXtrader, Yesterday, 11:30 PM
        2 responses
        11 views
        0 likes
        Last Post XXtrader  
        Started by Waxavi, Today, 02:10 AM
        0 responses
        6 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by TradeForge, Today, 02:09 AM
        0 responses
        11 views
        0 likes
        Last Post TradeForge  
        Started by Waxavi, Today, 02:00 AM
        0 responses
        2 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by elirion, Today, 01:36 AM
        0 responses
        7 views
        0 likes
        Last Post elirion
        by elirion
         
        Working...
        X