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 argusthome, 03-08-2026, 10:06 AM
        0 responses
        71 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        43 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        25 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        28 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        56 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X