• 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

Stoploss Fill

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

    Stoploss Fill

    I am testing strategy via Strategy Analyzer. When the position is open the strategy setup the stoploss at the Fibonacci level 223.6.
    But it exites at close of the bar even though I use ExitOnClose = false;
    1) Do you know why?
    2) Both the entry and stoploss should be shown at the previous bar (23:50) than it is (23:55), please can you help?

    #2
    Hello Luigio,

    Thanks for your post.

    ExitOnClose refers to the session hours of the data series and it means if a position is open at the end of the session, to then close the trade(s). So it would not relate to this exit. Reference: https://ninjatrader.com/support/help...xitonclose.htm

    In backtesting, the strategy will always be a bar behind because the decision to make a trade is in one bar and the trade placement is on the next bar. The strategy executes once per bar at the close of the bar when backtesting.

    We recommend that you debug your strategy by printing out the specific values that you are setting the stop at to ensure it is as expected. Here is a link to our debugging tips: https://ninjatrader.com/support/help...script_cod.htm

    In addition here is further information you may find useful:
    https://ninjatrader.com/support/help...a_strategy.htm
    https://ninjatrader.com/support/help...ime_vs_bac.htm

    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Ok I get it. But what is for the optimization of strategy if all losing trades will be on closes instead of the relevant stoplosses. The results of optimization neither bactesting won't give me any information I need.

      Comment


        #4
        Hello Luigio,

        Thanks for your reply.

        Just to clarify my response, your code will execute at the end of a bar which is the same as setting the calculation mode of Calculate.OnBarClose. It does not mean, "all losing trades will be on closes instead of the relevant stoplosses".

        Your stop loss will depend on the exit method used and the variable data provided. This is where you need to spend your debugging efforts.
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by JohnAymin, Today, 02:38 PM
        0 responses
        2 views
        0 likes
        Last Post JohnAymin  
        Started by Rmos22, Today, 02:20 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Spencer  
        Started by sawtooth500, Today, 12:59 PM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_Spencer  
        Started by Steve L, Yesterday, 09:36 PM
        1 response
        19 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by MichaelAlexander, 04-25-2017, 03:28 AM
        9 responses
        1,170 views
        0 likes
        Last Post dani neira  
        Working...
        X