Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Intraday Testing

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

    Intraday Testing

    Hello,

    I'm still working with NinjaTrader and *think* I've figured out how to get it to mimic the statistical breakdown I was using in R and Matlab, however I've found a hole in my theory...

    When testing over 5 days on 1 minute bars, the problem I'm now having is that the previous day's closing bars are being used to calculate the opening signals for the next day. The reason I'm trading strictly within day is because the stocks I'm trading gap up/down dramatically. Thus this gives me an incredibly false signal for the first XX minutes, until there are enough bars from the trading day to remove all bars from the previous day.

    Exit on Close works wonderfully to close out my trades before/at the end of the trading day. How do I now get the system to reset the data series at each open? The only idea I've come up with so far is to create a fake Trading Hours framework which doesn't kick in until into the trading the day, which is a real hack and hard to modify as part of optimization.

    What else can I do to use the fresh data from the day and not the previous days?

    #2
    khoga,

    You could reinitialize your DataSeries object if you want it to reset it totally. There is a DataSeries.Dispose() method that frees up resources, but you must reinitialize the dataseries afterwards otherwise it will probably throw an exception.

    There is also a way to check for "FirstTickOfBar"

    if (FirstTickOfBar)
    {
    //do something
    }

    If you make a multi-timeframe strategy you could check if its the first tick of an added daily time series using :

    if (FirstTickOfBar && BarsInProgress == 1)
    {
    //do something
    }



    Please let me know if I may assist further.
    Adam P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by yertle, 04-18-2024, 08:38 AM
    9 responses
    40 views
    0 likes
    Last Post yertle
    by yertle
     
    Started by techgetgame, Yesterday, 11:42 PM
    0 responses
    9 views
    0 likes
    Last Post techgetgame  
    Started by sephichapdson, Yesterday, 11:36 PM
    0 responses
    2 views
    0 likes
    Last Post sephichapdson  
    Started by bortz, 11-06-2023, 08:04 AM
    47 responses
    1,615 views
    0 likes
    Last Post aligator  
    Started by jaybedreamin, Yesterday, 05:56 PM
    0 responses
    10 views
    0 likes
    Last Post jaybedreamin  
    Working...
    X