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 ScottWalsh, 04-16-2024, 04:29 PM
    7 responses
    34 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by cls71, Today, 04:45 AM
    0 responses
    1 view
    0 likes
    Last Post cls71
    by cls71
     
    Started by mjairg, 07-20-2023, 11:57 PM
    3 responses
    213 views
    1 like
    Last Post PaulMohn  
    Started by TheWhiteDragon, 01-21-2019, 12:44 PM
    4 responses
    544 views
    0 likes
    Last Post PaulMohn  
    Started by GLFX005, Today, 03:23 AM
    0 responses
    3 views
    0 likes
    Last Post GLFX005
    by GLFX005
     
    Working...
    X