Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Profitable strategy in backtest getting always hitting stop loss before profit target

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

  • NinjaTrader_BrandonH
    replied
    Hello torch2k,

    Thank you for writing in.

    You should expect that a strategy running real-time (live brokerage account, live market simulation, Playback connection etc...) will produce different results than the performance results generated during a backtest.

    When using Historical data, Strategies can ONLY be processed at the close of each bar. The fill price of an order is based on the OHLC of a bar and the price of the order itself since that is the only information that is known during a backtest.

    When using real-time market data or Playback you have a choice to run a strategy tick by tick (Calculate set to 'On Each Tick') which could produce different results. The fill price is based on incoming market data and volume, and you may receive better or worse fill prices depending on where the bid or ask price is and what volume is available at this market prices. During real-time live brokerage trading, orders are filled according to market dynamics.

    This is why you may see orders NOT fill in real-time that you may otherwise expect to see filled based on your backtesting results.

    Here is a NinjaTrader Help Guide link with information about discrepancies between realtime and historical data — https://ninjatrader.com/support/help...ime_vs_bac.htm

    Please let us know if we may assist further.

    Leave a comment:


  • Profitable strategy in backtest getting always hitting stop loss before profit target

    I have a strategy in the works where is is looking for a small scalp while trading the ES market.

    When the right conditions are met, it simply looks for a profit of 5 ticks. Strategy Analyzer determined that the best results were yielded when the Stop Loss was set to 8 ticks.

    I've now tested the strategy settings on a playback connection, and it's giving me ~20% win rate rather than the ~80% win rate the back test showed. The problem is that the bar does fill the profit target, but most of the time a little later on into the bar.

    Can this be solved by switching the Strategy to an Calculate.OnPriceChange method instead of OnBarClose?

    My first idea was just to increase the stop loss. This fixed some of the bars, but then the the result of the strategy remains a loss because of the now larger stop loss.

Latest Posts

Collapse

Topics Statistics Last Post
Started by Raginpower, Today, 01:53 PM
0 responses
10 views
0 likes
Last Post Raginpower  
Started by andrewjoseph939, Today, 12:55 PM
0 responses
18 views
0 likes
Last Post andrewjoseph939  
Started by NT-Roland, Yesterday, 04:44 AM
4 responses
15 views
0 likes
Last Post NT-Roland  
Started by szferi, Yesterday, 02:04 AM
4 responses
31 views
0 likes
Last Post bltdavid  
Started by augustfay, Today, 05:02 AM
0 responses
16 views
0 likes
Last Post augustfay  
Working...
X