Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 jclose, Today, 09:37 PM
        0 responses
        4 views
        0 likes
        Last Post jclose
        by jclose
         
        Started by WeyldFalcon, 08-07-2020, 06:13 AM
        10 responses
        1,413 views
        0 likes
        Last Post Traderontheroad  
        Started by firefoxforum12, Today, 08:53 PM
        0 responses
        10 views
        0 likes
        Last Post firefoxforum12  
        Started by stafe, Today, 08:34 PM
        0 responses
        10 views
        0 likes
        Last Post stafe
        by stafe
         
        Started by sastrades, 01-31-2024, 10:19 PM
        11 responses
        169 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X