• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop Loss and Session Template

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

    Stop Loss and Session Template

    Dear NinjaTrader
    I would like to know how process of sending orders from Ninja Trader to my broker server is working.

    Let's say:
    I have a strategy, which has a Session Template for trading only from 09:30 - 16:00 (EST)
    In strategy analyzer my Stop Losses are filled only in this time. If price reach my SL in PreMarket it is not filled, I get filled only after 09:30, so sometimes SL is not activated - price can recover, or sometimes I got much worse execution... ok...

    But, what if I will trade this strategy in real life, are all orders sending to my broker server (Limit Buy/Sell, Stop Loss and Profit Target)? Because if so, and then they are stored at my broker server, I suppose the Stop Losses will be activated also in PreMarket session (for futures) if Price will reach my original Stop Loss. So then my results from Live trading, will be very different from my BackTests in StrategyAnalyzer.

    Please could you explain me, how does it work in real.
    Thank you!

    #2
    Hello petr882,

    Thank you for writing in. If you have ExitOnClose set to true in your strategy settings, then all your orders and positions will cancel on the session close. T^his should match between simulated and live.

    More information on this can be found in our help guide here: http://ninjatrader.com/support/helpG...ub=exitonclose

    Please let me know if you have any further questions.
    Michael M.NinjaTrader Quality Assurance

    Comment


      #3
      Hi, thanks for fast reply.
      No this strategy is developed for longer periods, so that's the problem.
      If positions will be closed on EOD, I don't have to think about it, but the problem is, what will happen to stop loses in post and pre market hours.

      Will be my stop loses activated, or not (as in Strategy Analyzer)?

      Comment


        #4
        Hello petr882,

        I would recommend checking with your broker's order desk to determine how they would handle this situation. If you had ExitOnClose set to false and your brokerage account connection was setup so that NinjaTrader was not simulating stop orders (it was sending your stop orders to the broker), then you would be potentially holding an overnight position with an associated stop loss on their servers. It is possible the trade would just be closed by the broker but again I would recommend checking with them.

        Please let me know if I may be of further assistance.
        Michael M.NinjaTrader Quality Assurance

        Comment


          #5
          ok, if we accept the stop loss is sent to broker server with entry order, is there any way how to prevent this behavior?

          I would like to, to my strategy will behave the same in real as in backtest, naturally...
          You talked about "simulated stop orders", so it is the way how to send stop order to my brooker only when price will reach the stop price?

          Or is there any other way how to make my strategy behave in the same manner as in back testing???

          This is a pretty critical question I think, because if behavior is different, the whole backtest is useless...

          Comment


            #6
            Hello petr882,

            You can simulate stop orders yourself in your strategy. As an example to exit a long position:
            Code:
            if(Close[0] < stopLossPrice && Position.MarketPosition == MarketPosition.Long)
            {
            ExitLong();
            }
            This would prevent any resting stop orders on your brokers side and make sure that your stoploss would not fill pre or post market hours.

            You can also have NinjaTrader simulate the stop loss when using the SetStopLoss method by setting the simulated flag to true. Here is the override for this:
            Code:
            SetStopLoss(string fromEntrySignal, CalculationMode mode, double value, bool simulated);
            Alternatively, you could add a method in your code to run right before the session ends which would cancel all of your stop loss orders and move their information into an array or a list, then resubmit them when the market reopens.

            Please let me know if I may be of further assistance.
            Michael M.NinjaTrader Quality Assurance

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by usero86, Today, 04:28 AM
            2 responses
            12 views
            0 likes
            Last Post usero86
            by usero86
             
            Started by bohenriksen, Today, 04:00 AM
            0 responses
            7 views
            0 likes
            Last Post bohenriksen  
            Started by Derjan, Today, 03:09 AM
            0 responses
            7 views
            0 likes
            Last Post Derjan
            by Derjan
             
            Started by CDXTrader, Today, 12:29 AM
            0 responses
            11 views
            0 likes
            Last Post CDXTrader  
            Started by TopGun13, Yesterday, 10:35 PM
            0 responses
            7 views
            0 likes
            Last Post TopGun13  
            Working...
            X