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

Position.AveragePrice

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

    Position.AveragePrice

    If a strategy is in a trade (not a live position)

    I enable the strategy - immediately submit order / sync account - opening a live position


    Is the Position.AveragePrice the price from the strategy or the price of the live position placed subsequently?

    Thank you



    #2
    Hi sdauteuil, thanks for your question.

    If the strategy does try to synchronize the account and order will be placed at the price level the would have entered at. So the Average price will be that of the last order placed historically.

    Please let me know if I can assist any further.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      I have a strategy that triggers a trailing stop (an indicator is the stop value) when the price closes above X amount of ticks from the entry price or average price.
      Start TrailStop Price = Position.AveragePrice + TriggerTicks

      If the strategy is in a live trade which is closed early (maybe lost data connection) and I re-start the strategy would the Start TrailStop Price change.

      example ES Mini - Start the trailing stop after price rises 25 points


      Enter Strategy @ 3000.00 - Start TrailStop Price = 3025.00
      Strategy closes early
      Re-enter strategy and sync account @ 2950.00 - Will the Start TrailStop Price change to 2975.00 or remain at the 3025.00

      Comment


        #4
        Hi sdauteuil, thanks for your reply.

        Please allow me to set up a test to confirm the behavior. I will reply here once I finish the test.

        Thanks in advance for your patience.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Hi sdauteuil, thanks for your patience.

          Position.AveragePrice is updated when the strategy submits the synchronization order so the trailing stop will be calculated relative to the new AveragePrice value.

          Please let us know if we can assist any further.
          Chris L.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by cocoescala, 10-12-2018, 11:02 PM
          6 responses
          939 views
          0 likes
          Last Post Jquiroz1975  
          Started by gbourque, Today, 06:39 AM
          1 response
          4 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by cmtjoancolmenero, Yesterday, 03:58 PM
          1 response
          17 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by benmarkal, Yesterday, 12:52 PM
          3 responses
          23 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by helpwanted, Today, 03:06 AM
          1 response
          20 views
          0 likes
          Last Post sarafuenonly123  
          Working...
          X