Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reset StopLoss with ATM

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

    #16
    Hello Ronhb107,

    I’m unaware of any reference samples which do exactly what you’re looking for however have provided some links which would help you create this as part of a custom strategy.

    Method Position.AvgPrice would give you the breakeven for which you could base your trailing stop off.


    You might find the following reference example helpful for setting your stop and or trailing stop.
    The OnOrderUpdate() and OnExecution() methods are reserved for experienced programmers. Instead of using Set() methods to submit stop-loss and profit target orders, you can submit and update them manually through the use of IOrder and IExecution objects in the OnOrderUpdate() and OnExecution() methods. The OnOrderUpdate()


    You will find Reference Samples online as well as some Tips and Tricks for both indicators and strategies:

    Click here to see our NinjaScript Reference Samples: http://www.ninjatrader.com/support/f...splay.php?f=30

    Click here to see our NinjaScript Tips:


    These samples can be downloaded, installed and modified from NinjaTrader and hopefully serve as a good base for your custom works.

    There is a also a growing library of user submitted custom indicators (100+) that can be downloaded from our support form. Please look in the NinjaScript File Sharing section of our support forum as you may find what you are looking for there: http://www.ninjatrader.com/support/f...splay.php?f=37

    Please let me know if you have any questions.
    Alan P.NinjaTrader Customer Service

    Comment


      #17
      ATM Strategy code

      Hi Alan:

      I am trying to modify strategy "ProfitTargetTrailingStop_101b" to simply manage a manually entered position.

      What I need is the following:

      1. Have the strategy available in the list within the ATM Strategy drop down. This way, if I have several coded strategies, I can select which strategy to use. I think using AtmStrategyCreate() might be the approach, but I do not want to create an entry (position) programmatically.
      2. Have the code simply recognize the manual entry (whether long or short) and capture its ID.

      I appreciate the assistance.

      Ron

      Comment


        #18
        Hello Ron,

        It would not be possible to have your custom strategy available for selection in the ATM drop down.

        It would also not be possible to attach a strategy to a manual order.

        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        90 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        137 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        120 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        72 views
        0 likes
        Last Post PaulMohn  
        Working...
        X