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 wzgy0920, 04-20-2024, 06:09 PM
        2 responses
        27 views
        0 likes
        Last Post wzgy0920  
        Started by wzgy0920, 02-22-2024, 01:11 AM
        5 responses
        32 views
        0 likes
        Last Post wzgy0920  
        Started by wzgy0920, 04-23-2024, 09:53 PM
        2 responses
        49 views
        0 likes
        Last Post wzgy0920  
        Started by Kensonprib, 04-28-2021, 10:11 AM
        5 responses
        193 views
        0 likes
        Last Post Hasadafa  
        Started by GussJ, 03-04-2020, 03:11 PM
        11 responses
        3,235 views
        0 likes
        Last Post xiinteractive  
        Working...
        X