Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Kickout / Buyback Strategy Questions

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

    Kickout / Buyback Strategy Questions

    Hi All,

    This is my first-ever post to this forum so please be indulgent. I scoured the NT reference and posts before posting this.

    I have successfully developed and am using NT strategies in my daily trading. For the life of me, though, I don't know what the proper way is to handle the following scenario:

    I am already holding n shares of equity X. At market open, I want to place a stop market order for these shares at price P. If the order fills, I use the proceeds from the sale to buy back as many shares of X as I can on market close.

    I know how to do everything except express the original order. I can't use one of the Exit* methods because the initial purchase was done some time in the past from outside my strategy. Do I use EnterShort or one of its variants? I want a stop market order to be sent to the broker immediately on market open.

    Here's a bigger-picture question: how am I supposed to deal with the logistics of running a strategy whose timeframe spans multiple weeks? It's obviously impractical to expect the strategy to continue uninterrupted during this time (especially since IB force logs me out once every 24h), but when you restart a strategy, it uses virtual buys and sells based on the historical bar data rather than the actual buys and sells that your strategy had generated on previous days.

    Thanks in advance.

    #2
    Hello membar,

    Welcome to the NinjaTrader forums!

    A good article to get some background info here is Strategy Position versus Account Position.

    Your strategy position is a reflection of trading activity generated by signals. Your account position is a reflection of any activity made in an account. Unfortunately there is no way to explicitly declare a strategy position prior to starting it.

    Some different ways of managing the timing of order submission is found under Tools > Options > Strategies > NinjaScript. You can set orders to immediately submit live working historical orders or to wait until your position is flat.

    You can also consider adding the statement if (Historical) return; to only run the strategy on real time data.

    Ultimately your strategy will be difficult to manage if you are not attempting to align your account position with the strategy position. It may be better to manage your trade separately from a NinjaScript automated strategy and then run the strategy once you're flat.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    648 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    369 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    573 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    575 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X