Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Partial Exits Question

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

    Partial Exits Question

    Objective:
    Exit a portion of a position after so many bars. Track the profitability of the VWAP exits to determine if the original entry was profitable or not. Determine the number of consecutive winners and losers using my VWAP exits as the measure of profitability.

    Example:
    Entered long 100,000 units of EUR/USD>

    After 3 bars, exit 25% of the original position (25,000 units)
    After 5 bars, 35% of the original position should be closed (10,000 units)
    etc...

    What I've done:
    I reviewed the thread and sample code from this post.


    Reviewed documentation of IOrder in the help guide.

    Questions:
    I assume that I'll be using IOrder. I don't fully understand how it works, hence this post.
    1. When I call the IOrder property Quantity, does that reflect the current quantity or the original quantity? I assume the answer is current quantity. If I want to save the original quantity, would I store this in a variable when calling OnExecution()? Then I get the current quantity when calling OnBarUpdate()?
    2. When I call the IOrder property Token and I close 25% of the position, how is the Token stored for historical trades? Will the original 75% carry the same Token as the 25% that was closed or will they differ? If they differ, is there any way to track them or am I responsible for doing this?
    3. I'm being optimisitc asking this... but are there any existing NS functions that do this: "Track the profitability of the VWAP exits to determine if the original entry was profitable or not."

    #2
    1. Quantity returns the submission quantity. Filled property is the amount of contracts actually acquired.

    2. Each order has its own unique Token. Entry orders have tokens. Exit orders have tokens.

    3. None by default. You will likely have to program what you want.
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    650 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    370 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    577 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X