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

Work-around for "Stop Limit for Stop Loss" toggle in AtmStrategy for Stocks

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

    Work-around for "Stop Limit for Stop Loss" toggle in AtmStrategy for Stocks

    NT support,

    Please provide a workaround for "Stop Limit for Stop Loss" toggle in AtmStrategy unavailable for stocks.
    (ref: https://ninjatrader.com/support/help...ed_options.htm)

    Is this by design to discourage users from trading stocks? Stop limit exit must-have for stock trading outside RTH.

    If not, could you please provide a working code snippet as a work-around.

    Below work-around I tried does not work as intended, it generated 2 exit pair orders (2 stop limits and 2 limits), for each 1 entry order.
    • Inside OrderUpdate event handler, use account.Cancel to cancel stop market order,
    • use account.CreateOrder to create an order of type StopLimit
    • create a bracket limit exit order using the same oco as the StopLimit
    Last edited by yubo27; 12-04-2023, 11:18 PM.

    #2
    Hello yubo27,

    From my understanding, not all brokerages that support equities will accept a stop limit order, so a stop market order is substituted to ensure the atm works for all equity brokerages.

    The workaround would be to place the orders through a script (such as through a button click) and submit a stop limit order.

    This example shows submitting orders to an account through an indicator button click.
    I need some guidance. I need to create a script that has 3 plots that are public and they plot either a 1 or 0. But I need to create another indicator that has 3 chart buttons that sets these variables. The first indicator needs to get those values from the second indicator depending on the button clicks. Because of using


    The 'ProfitChaseStopTrailIndicatorExample' example, in the forum post below, demonstrates placing a stop and limit through an account.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      What I meant is having Stop limit as OCO profit/stop-loss pair orders as part of AtmStrategy, for stocks.

      All equity brokers support Stop limit. IB only supports Stop limit for outside RTH. Stop market will not be triggered.
      There is no problem placing Sotp limit entry orders. So No need for the examples you shared.

      I want see a piece of code that converts Stop market placed by Atm to Stop limit.

      The ways I described above through manual oco triggered an extra order that I cannot figured out why.
      Last edited by yubo27; 12-05-2023, 09:01 AM.

      Comment


        #4
        Hello yubo27,

        Submitting the exit stop limit and limit with the script would be the supported method.

        Cancelling an existing order and replacing it would not be supported by NinjaTrader as this would impair the intended functionality.

        This thread will remain open for any community members that would like to provide unsupported tips or code.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Never mind. I figured it out. Work-around is the one I described above. A bug in my code produced an extra exit order.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Haiasi, 04-25-2024, 06:53 PM
          2 responses
          17 views
          0 likes
          Last Post Massinisa  
          Started by Creamers, Today, 05:32 AM
          0 responses
          5 views
          0 likes
          Last Post Creamers  
          Started by Segwin, 05-07-2018, 02:15 PM
          12 responses
          1,786 views
          0 likes
          Last Post Leafcutter  
          Started by poplagelu, Today, 05:00 AM
          0 responses
          3 views
          0 likes
          Last Post poplagelu  
          Started by fx.practic, 10-15-2013, 12:53 AM
          5 responses
          5,407 views
          0 likes
          Last Post Bidder
          by Bidder
           
          Working...
          X