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

Ok to call SetStopLoss multiple times

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

    Ok to call SetStopLoss multiple times

    Is it ok for a strat to call SetStopLoss multiple times with different values from a single OnBarUpdate call? Will this generate multiple order modifies or is Ninja smart enough to collapse those into a single modify if the price has changed on the last call?

    #2
    Hello aslane,

    NinjaTrader will use signal names to update Set methods which can be called multiple times.

    However, if the position is open this would result in rapid change requests which may cause issues with the brokerage.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Ok, that is kind of what I expected, so I should be sure to calc the final value and set just once.

      However, that brings up another question. How often is too often for doing an order modify? For example, as an instrument moves quickly, can a strat update a trailing stop many times per sec, or should it be limited to some number of updates per sec? Similar for entries or targets.

      Certainly, using OnOrderUpdate to limit updates while an order modification is pending makes sense, but is there a recommended best practice?

      This is for managed orders.
      Last edited by aslane; 09-23-2019, 04:53 AM.

      Comment


        #4
        Hello aslane,

        That depends on the brokerage.

        The Sim101 shouldn't have a problem unless there are so many so rapid the CPU is maxed out.

        A brokerage account may have a limit. Contact your broker to find out the limit of order messages per second for your brokerage.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by GussJ, 03-04-2020, 03:11 PM
        15 responses
        3,271 views
        0 likes
        Last Post xiinteractive  
        Started by Tim-c, Today, 02:10 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Taddypole, Today, 02:47 PM
        0 responses
        2 views
        0 likes
        Last Post Taddypole  
        Started by chbruno, 04-24-2024, 04:10 PM
        4 responses
        51 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        10 responses
        403 views
        1 like
        Last Post beobast
        by beobast
         
        Working...
        X