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

Stop Loss Order and Market Order

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

    Stop Loss Order and Market Order

    Hello. I want to set Stop Loss order in script.
    In Help there is Simulated condition for StopLoss discribed as
    //simulated - If true, will simulate the stop order and submit as market once triggered//
    I can't understant what is that mean?

    And if Stop Loss is Market filled, it will be executed at bar close? If I need as Market price I set in it + slippage, what should I do?

    #2
    Hello,

    Thank you for your post and welcome to our forums!

    A simulated stop would be held locally on your PC until the trigger price as been reached. At this point, it will be submitted as a market order at that time.

    A non simulated stop order would be sent directly to your broker or the exchange and would reside on that server.

    Please see our Help Guide article on Simulated Stop Orders for more information:



    The order would still work within the context of your CalculateOnBarClose settings. If set to COBC = false, it will execute as soon as the signal is processed by the script. When set to COBC = true, it will execute at the close of the bar after the signal has been processed.

    If you would like to limit the slippage with your stop orders, please use a Stop-Limit order:




    Please let me know if you have additional questions.
    MatthewNinjaTrader Product Management

    Comment


      #3
      How will Stop work in Backtesting? will be executed at bar close?

      Comment


        #4
        Hello,

        Yes, in backtesting, all events will be processed at the close of the bar.
        MatthewNinjaTrader Product Management

        Comment


          #5
          But why it can't be calculatet as trigger price from Stop plus slippage? In lots of cases it's too big value, because close is far from trigger price! Example: Selling EUR future, Sell Stop = 1.3050, Close of the bar is 1.3000. There is 50p of slippage. Too big. How could I evade this? Using StopLimit as StopLoss? I need in Backtesting Stop should be triggered as price that I specify plus some slippage (I could set it too)

          Comment


            #6
            Hello,

            If you are backtesting in a single data series, there is no intrabar granularity to process these events.

            However you can design your script to add a smaller interval which can be used to submit orders before the close of the primary series in which you're checking for the signals.


            Please see our Reference Sample on Backtesting NinjaScript Strategies with an intrabar granularity for more information on how this is done:

            You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by
            MatthewNinjaTrader Product Management

            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
            8 views
            0 likes
            Last Post terofs
            by terofs
             
            Started by nandhumca, Today, 03:41 PM
            0 responses
            6 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