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.
    http://www.ninjatrader.com/support/f...ad.php?t=33893
    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 samir, Today, 07:00 PM
        0 responses
        9 views
        0 likes
        Last Post samir
        by samir
         
        Started by travisloneker, Today, 06:52 PM
        0 responses
        6 views
        0 likes
        Last Post travisloneker  
        Started by InfraredBusa, Today, 05:50 PM
        0 responses
        3 views
        0 likes
        Last Post InfraredBusa  
        Started by White Fork, Today, 04:56 PM
        1 response
        8 views
        0 likes
        Last Post White Fork  
        Started by steveyinyang, Today, 02:48 PM
        3 responses
        20 views
        0 likes
        Last Post steveyinyang  
        Working...
        X