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

Using Position.MarketPosition and Position.AvgPrice

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

    Using Position.MarketPosition and Position.AvgPrice

    Hello,

    My strategy involves using limit orders 4 ticks away from market price when condition is TRUE to take long or short.

    1. Will the following the condition below become TRUE if long limit order is pending awaiting to be filled? Or will it become TRUE only if long limit order is filled?

    2. Does the Position.AvgPrice only consider filled orders and not pending orders waiting to be filled?


    // if in a long position and 15 ticks from entry, bring stop to breakevem
    if (Position.MarketPosition == MarketPosition.Long && High[0] >= Position.AvgPrice + 15* TickSize)

    (adjust stop to breakeven code)

    I am trying to make sure my break even code is not getting executing for limit pending orders.

    Thank you for the help

    #2
    Hello simple_goodoboy,

    Thanks for your post.

    Correct, Position will only reflect a filled entry order.

    From the helpguide on Position: Definition: The Position object holds data related to a currently held position by a strategy.
    Reference: http://ninjatrader.com/support/helpG...m?position.htm

    Edit: Added helpguide info and reference.
    Last edited by NinjaTrader_PaulH; 03-30-2017, 07:33 AM.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Paul View Post
      Hello simple_goodoboy,

      Thanks for your post.

      Correct, Position will only reflect a filled entry order.

      From the helpguide on Position: Definition: The Position object holds data related to a currently held position by a strategy.
      Reference: http://ninjatrader.com/support/helpG...m?position.htm

      Edit: Added helpguide info and reference.
      Thank you Paul.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by ScottWalsh, Today, 04:29 PM
      0 responses
      2 views
      0 likes
      Last Post ScottWalsh  
      Started by rtwave, 04-12-2024, 09:30 AM
      2 responses
      21 views
      0 likes
      Last Post rtwave
      by rtwave
       
      Started by tsantospinto, 04-12-2024, 07:04 PM
      5 responses
      69 views
      0 likes
      Last Post tsantospinto  
      Started by cre8able, Today, 03:20 PM
      0 responses
      7 views
      0 likes
      Last Post cre8able  
      Started by Fran888, 02-16-2024, 10:48 AM
      3 responses
      49 views
      0 likes
      Last Post Sam2515
      by Sam2515
       
      Working...
      X