Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
biggest round trip move each day, descriptive statistics.
i am trying to find some descriptive statistics for financial instruments, and i don't know whether there already exists an indicator that provides the information i have in mind or whether it would be possible to put some code together in easylanguage, ninjascript, spreadsheet software or 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 back 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 completely erased inside one single session.
maybe someone knows of an indicator or a company that has already generated this kind of statistics. i will greatly appreciate any suggestions or pointers, thanks.
Can you help answer these questions from other members on NexusFi?
Trading: Primarily Energy but also a little Equities, Fixed Income, Metals and Crypto.
Frequency: Many times daily
Duration: Never
Posts: 5,049 since Dec 2013
Thanks Given: 4,388
Thanks Received: 10,207
Could calculate yourself. The higher the granularity of the bar the greater the accuracy.
For everybar we can assume the market either went OHLC or OLHC. So in every bar the smallest maximum move is 2 * Range - Max Of (O-C, C-O). So on up bars the min is 2 * Range - C + O and on down bars 2* Range - O + C.
It's a little bit like VWAP though, to get the perfect answer you'd have to perform the calculation tick by tick.
i would like to generate these daily statistics for a 10 - 15 year period on a number of instruments.
what i think could work would be to take all the closing price data for 1 minute intervals and then from the last minute of the 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 ranked 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.
i think i can deal with the mathematical and statistical concepts to obtain this information, but this analysis is way beyond my coding capabilities right now. i don't know whether it could be possible to create an indicator that performed these operations on ninjatrader or tradestation. and in case the price data could be exported to spreadsheet or database analysis programs i wouldn't know how to get the program to differentiate each separate session, perform these calculations over and over for each one of them and then present a final tabulation by date.
this is an important statistic for me because i have been putting together strategies for 60 minute and larger bar charts and the assumptions that are made for this data (just what you mentioned, the ohlc or olhc assumptions) ignore all the price action inside the bars and make historical data completely different and unreliable when compared to live tick by tick data.
this analysis 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 and see if i can get help with this. thanks.
thanks but no. a standard deviation is the normalized average distance around an arithmetic average, the statistic i would like to measure is the biggest round trip movement inside every trading day.
i got some pointers from other sources and maybe i could be able to put together an indicator for ninjatrader that derived the information i'm looking for.
i was told i had to 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 have to 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: i could have 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.
i would be grateful if anyone could point me to some educational materials so that i could 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). i'm thinking custom classes and lists must be c# programming, as i understand that's the language ninjatrader runs on.
My thought is:
A set a variation min threshold eg. 1/4 3day ATR - (not sure if you need this)
at open:
set daymax and daymin = open
set roundtripmax=0
each min test:
if high >daymax then daymax=high
if low <daymin the daymin =low
daydif1=daymax-daymin
if daydif1 > threshold then
if daymin is less than open then
firstptlow=daymin
else firstpthigh=daymax
/testing for crossdown of firstpt low/
if daymax Crossdown firstptlow then roundtripmaxnew = daymax-low
if roundtripmaxnew>roundtripmax then roundtripmax = roundtripmaxnew
/testing for crossdown of firstpt high/
if daymix crossdown firstpthigh then roundtripmaxnew = high-daymin
if roundtripmaxnew>roundtripmax then roundtripmax = roundtripmaxnew
if time > 1500 and roundtripmax>0 then writetofile date, roundtripmax