Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Compiling Statistics

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

    Compiling Statistics

    This is not directly related to NinjaTrader but I posting this question to see if the NinjaTrader has any suggestions.

    Suppose I have 2 years worth of 1 minute data on the futures. How would you compile statistics with this data?

    For example:
    1) When an emini future breaks an opening range, how often does it pullback versus continuing the breakout?
    2) How often does the High/Low of the day occur in the first 30 minutes? First 90 minutes? First 135 minutes? Etc.
    3) When the trade breaks the top of the opening range, how often does the day end above the opening range, middle of the opening range, below the opening range?
    4) Etc.

    #2
    - I would write indicators that plotted a value of 1 or 0 for true or false for when the conditions occured and have an internal counter that kept track of each time the condition was seen and print this information the NinjaScript Output window.
    RayNinjaTrader Customer Service

    Comment


      #3
      That's a novel idea, thanks.

      Comment


        #4
        Hi guys,
        I just started messing around with this exact type of stuff too. I've been just writing a strategy that doesn't buy or sell anything, just spits stuff out to the output window. If you look at the example of how to write a text file, that might be an easier way to go but I couldn't get it working in the brief time I tried.
        #2 is pretty easy with something like:
        if (ToTime(Time[0]) >= 90000 && ToTime(Time[0]) <= 100000)
        {

        if(High[0] > Highbar)
        {
        Highbar = High[0];
        }

        }
        ect...then Print(Time[0].ToString()); Print(Highbar);

        Comment


          #5
          You can also take a look at the code in my genetic optimizer (in the misc code samples forum), which writes to a .csv file so you can easily open it in Excel & don't have to worry about overrunning the Output window. This is how I would do it.

          Comment


            #6
            In the interests of lazyness/sharing - Has anyone written anything like this e.g. a script which will output the times of HODs and LODs to excel? Giving something like the following? http://www.traderslaboratory.com/for...nute-3880.html

            Or is there any service/website/software I can use to generate this as (correct me if I'm wrong) I can't get historical intraday data for continuous contract with zen-fire?

            thanks

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by alifarahani, Today, 09:40 AM
            3 responses
            15 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by RookieTrader, Today, 09:37 AM
            4 responses
            18 views
            0 likes
            Last Post RookieTrader  
            Started by PaulMohn, Today, 12:36 PM
            0 responses
            5 views
            0 likes
            Last Post PaulMohn  
            Started by love2code2trade, 04-17-2024, 01:45 PM
            4 responses
            40 views
            0 likes
            Last Post love2code2trade  
            Started by junkone, Today, 11:37 AM
            3 responses
            25 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X