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 rdtdale, Today, 01:02 PM
        0 responses
        3 views
        0 likes
        Last Post rdtdale
        by rdtdale
         
        Started by alifarahani, Today, 09:40 AM
        3 responses
        15 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by RookieTrader, Today, 09:37 AM
        4 responses
        18 views
        0 likes
        Last Post RookieTrader  
        Started by PaulMohn, Today, 12:36 PM
        0 responses
        8 views
        0 likes
        Last Post PaulMohn  
        Started by love2code2trade, 04-17-2024, 01:45 PM
        4 responses
        41 views
        0 likes
        Last Post love2code2trade  
        Working...
        X