Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

entry price variable

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

    entry price variable

    is this correct code to set a variable to the current open trade entry price?

    double EntryPrice = Position.AvgPrice;

    #2
    Hello James377,

    That will be an average of all current open positions. If you have only one, that should work for you.

    If you wanted the price of a specific fill, you would have to expose this value using the IExecution interface.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      does SetProfitTarget("", CalculationMode.Ticks, EntryPrice + profitfactor);

      use entry price automatically if I just said

      SetProfitTarget("", CalculationMode.Ticks, 5); for example...is that the same as setting

      SetProfitTarget("", CalculationMode.Ticks, EntryPrice + profitfactor);

      with profitfactor being 5??

      Comment


        #4
        No, those are not the same statements.

        CalculationMode.Ticks will place an order in relation to entry price, and you don't have to specify entry price.

        Example: YM long entry at 10,000
        SetProfitTarget("", CalculationMode.Ticks, 5);

        Above statement places sell limit order at 10,005.
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by traderqz, Today, 12:06 AM
        10 responses
        18 views
        0 likes
        Last Post traderqz  
        Started by algospoke, 04-17-2024, 06:40 PM
        5 responses
        46 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by arvidvanstaey, Today, 02:19 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Started by mmckinnm, Today, 01:34 PM
        3 responses
        5 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by f.saeidi, Today, 01:32 PM
        2 responses
        9 views
        0 likes
        Last Post f.saeidi  
        Working...
        X