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 cmoran13, Yesterday, 01:02 PM
        0 responses
        29 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        21 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        160 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        95 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        148 views
        2 likes
        Last Post CaptainJack  
        Working...
        X