Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Manual take profit order should cancel position

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

    Manual take profit order should cancel position

    Hi
    I am writing a strategy where I want to take profit manually.
    Once I manually take profits I want to stop the strategy.

    It appears that the handlers in StrategyBase like OnExecution, OnOrderUpdate do not get called if the order is not generated by a strategy.

    How do I accomplish my requirements ?

    I did read about ATM strategies and how one can take profit , send a stop loss, use OCO orders etc.

    Unfortunately I do not have a preset take profit level - this is up to the trader's discretion so the ATM appears to not be useful for this case.

    Another considered possibility was polling every second to check account position but a lot can happen in one second so this is not an optimal workaround.

    What is the best approach to code up this manual take profit to tie in with a strategy?

    #2
    psycho760, if you would like the trader to manually interact with the running NinjaScript strategy you would have to use the ATM strategies - the trade can setup his custom ATM strategy template including his custom take profit level as long as he names the template called correctly as expected by your strategy, for a complete sample please see the SampleAtmStrategy we install per default with NinjaTrader.

    Comment


      #3
      Thanks. I can have the manual take profit trade tie in with the ATM Strategy.

      However the stop functionality has to have 2 features
      1) Simulated stop - no stop orders sent. Send market orders if stop hit.
      2) Reverse at stop - if stop hit, reverse position.

      The above stop functionality has to be run automatically, not manually, since it will be running for the entire S&P 500. I could not find a way in Ninjascript to do the simulated stop and the reverse at stop.
      Any ideas on how to achieve this ?

      Comment


        #4
        psycho760 you would then need to call an ATMStrategyTemplate that has those features set and enabled / saved.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 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
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X