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

very general question, looking for biggest round trip move for each day.

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

    very general question, looking for biggest round trip move for each day.

    good day to everyone,


    i am trying to find some descriptive statistics for financial instruments, and i don't know whether there could already exist some indicator that provided the information i have in mind or whether it would be possible to put some code together in ninjascript, spreadsheet or database analysis software or any other free software so that it would calculate the following.


    for a financial instrument, let's say the fdax or the nk, i would like to know what is the biggest round trip price movement for each day. so, let's say the fdax is trading at 13,000 points at 900 cet, then by 1200 cet it has gone up to 13,300 and by 1500 cet it is back again at 13,000 and below, all in one same single day session. these are the kind of moves i am interested in measuring, where the price for some instrument goes up for a large number of ticks and then goes down again by that same number of ticks or greater inside one single session (it would be the same with large declines that are completely erased within the same session, i'm mostly interested in the absolute value of the moves).


    the range (high minus low) of a day provides the greatest move inside one given session, but i'm only interested in the biggest move each day that was made and then completed reversed inside one single session.


    maybe other members in this forum or the support staff for nt can think of any indicator or method to generate this information.



    i have thought of the following method for the prices at close on 1 minute bars but it requires a lot of operations, there's no way i could code these instructions into ninjatrader but it would be fantastic if something like this could be done:



    i would like to generate these daily statistics for a 10 - 15 year period on a number of instruments and what i think could work would be to take all the closing price data for 1 minute bars and then starting from the last minute of a particular day (let's say 17:00 et for nymex instruments), subtract the price for all earlier values that day (16:59 on the same day and back to 18:00 the previous day), then take the next to last period (16:59) and once again calculate its difference against all previous periods (16:58 to 18:00) and so on until the first two observations of the day (18:01 and 18:00).


    once all these subtractions have been calculated for all the 1 minute intervals in a same day, i would just need all these values to be put together in one list and ranked in descending order from the biggest positive value to the most negative negative value and the smallest of these two extreme subtractions in absolute value would be the statistic i'm looking for: the biggest round trip move that particular day. these operations would then need to be repeated for every other day in the 10 year or so period we were analyzing.




    this method i thought of deals with very basic operations and processes (subtractions, rankings, absolute values, minimums), so i don't think it would be too difficult for experienced, accomplished programmers to put it into code. i will also try to find other forums about programming and coding on the internet and see if i can get help with this. thanks.

    #2
    Hello rtwave,

    Thank you for your note.

    Regarding absolute price change during a day from a point, this would be possible with NinjaScript, but would require the writing of logic which identifies this. Range would also be possible, but would require custom scripting.

    If I were writing this I would create a custom class, and a list of that type of class, for which you could put these observations in, for which you could then sort/rank.

    Written custom scripts would be out of the scope of what our support desk can support however if you’d like I can have someone reach out with a list of third parties that would be interested in building this for you.

    Please let us know if you need further assistance or would like this third party list.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Alan,


      thanks.


      i think you were able to get the idea of the concept i have in mind and as you describe it, it doesn't really sound that hard.


      i would create a custom class for the difference in price for each one minute period from end to beginning for every single session. then, i would create a list for this type of class to hold all the values by session, rank all these observations in descending order and i would be pretty much be done at this point. i could then create several different outputs for this information: having the platform print out the largest positive number and most negative negative number for each session, or print out the 5 largest positives and 5 most negative negatives, or print out just the minimum between the absolute values of the largest positive number and most negative negative number which can then be used for other calculations.


      if you can point me to some educational materials to learn how to create custom classes, lists, and how to create a command so that the difference between all closing prices from 17:00 back to 18:00 the previous day (and then 16:59 - 18:00, 16:58 - 18:00, etc) is calculated i will try to put this code together myself. in case this project proved to be overwhelming i would then be interested in contacting the third parties you have referred to.


      very well, thanks, regards.

      Comment


        #4
        Hello rtwave,

        Below is a link to an indicator which on line 983 I create a custom class.


        The following example uses a list to hold holiday dates.


        I do not have any examples which will take the difference between certain times, however if you’d like I can someone reach out with a list of third parties that would be interested in building this for you.

        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Skifree, Today, 03:41 AM
        3 responses
        12 views
        0 likes
        Last Post Skifree
        by Skifree
         
        Started by traderqz, Yesterday, 09:06 AM
        5 responses
        32 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by guillembm, Today, 11:25 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by owensd, 04-21-2024, 11:34 PM
        9 responses
        34 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by trilliantrader, 04-10-2024, 09:33 PM
        7 responses
        25 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X