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 DJ888, 04-16-2024, 06:09 PM
        4 responses
        12 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by terofs, Today, 04:18 PM
        0 responses
        11 views
        0 likes
        Last Post terofs
        by terofs
         
        Started by nandhumca, Today, 03:41 PM
        0 responses
        7 views
        0 likes
        Last Post nandhumca  
        Started by The_Sec, Today, 03:37 PM
        0 responses
        3 views
        0 likes
        Last Post The_Sec
        by The_Sec
         
        Started by GwFutures1988, Today, 02:48 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Working...
        X