Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnMarketData

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

    OnMarketData

    Hey guys,

    I have developed a strategy that uses a trailing stop behavior calculating ticks as a trigger. So lets say after 20 ticks from the entry price the sto should follow 30 tick the latest price. This works fine for a realtime strategy (I use the OnMarketData- Method to calculate the tick offset and distance to activate the trailing stop). But this will not work in backtesting mode because the OnMarketData method will never be called. How should I solve this problem to get a implementation that works in realtime and in backtesting the same way?

    Thanks for your help
    Markus

    #2
    Hi cicondo,

    Correct, OnMarketData is not called on Historical data.

    Likely the most accurate way to simulate this would be with Market Replay
    Market Replay in 6.5:

    Market Replay in 7:


    More on real-time vs. backtesting:
    TimNinjaTrader Customer Service

    Comment


      #3
      Optimization

      Tim,

      Thanks for your reply!
      I have an other question about backtesting. With NT 6.5 it is only possible to optimize values in the "parameter"-section and only numeric values. Is it possible with NT 7 to optimize other data types like enums or boolean?

      Thanks
      Markus

      Comment


        #4
        Hello Cicondo,

        It's possible to optimize on non-numeric values, but ultimately the optimizer will need to have a number value to work with.

        Please see this strategy in our file sharing section, which offers one way to optimize based on the day of the week. You could probably adapt the principles here for other types of values.
        Last edited by NinjaTrader_RyanM1; 07-19-2010, 11:32 AM.
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        88 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        48 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        30 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        34 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        68 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X