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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        61 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        148 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        162 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        98 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        286 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X