Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is there a way to track and reference entry prices within a strategy?

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

    Is there a way to track and reference entry prices within a strategy?

    Here's an example of what I'm trying to accomplish within an NT7 strategy:

    Let's say the strategy opens a long position... like a market order to buy 1 NQ contract at $11,850.25. Minutes later, that position hits the stop loss price and is closed out. How can I reference that losing trade so I can code my strategy to not take long trades around that same price area?

    How can I "save" and reference the (CalculationMode.Price, Position.AvgPrice) of losing trades so my strategy can look at them later and include that data in the logic that determines if a position should be opened? Determining the price area to avoid isn't my question, but what I can't figure out os how to get the strategy to look back at prior trades entry prices.

    If it matters, I'm using the managed order entry approach and would prefer not to use unmanaged if at all possible.

    Thanks in advance for any help or code samples.​

    #2
    Hi fredb987, thanks for posting. You can use the OnExecutionUpdate event to track every entry and exit that happens within the strategy. Typically, entries and exits are identified by their signal names which you create when calling an entry order.

    Here are some examples that demonstrate this well:



    Kind regards,
    -ChrisL

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    51 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    142 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    160 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    96 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    275 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X