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)
Absolute vs. percentage price change in backtesting
I trying to develop a breakout strategy with a breakout of yesterday´s High/Low + an additional value.
Now, the additional value should I test it with a absolute price change in Ticks or as a percentage price change?
e.g. Entry Long on Yesterday´s High + "n Ticks" or Entry Long on Yesterday´s High + "n%" ?
I feel insecure when it comes to test price changes on back-adjusted continuous contracts. Which way is more
reliable, absolute or percentage price change?
Thanks!
Can you help answer these questions from other members on NexusFi?
What you are attempting to do is determine which "bet" will pan out the best. But in order to know which one will pan out the best you will need to do some research. The type of data and analysis you need to research this "bet" is:
1. For your given instrument get the raw price data for a few weeks or a month or two. You don't need to burn your self out too much at this point, since this is only a proof of concept validation as a first step.
2. For each day you need to extract the high and low and a full range of data. Maybe hourly, or minute data even...
3. For each day you need to determine if it broke the previous days high or low
4. For each day that broke a previous days high or low, you need to carefully analyze the following:
A: What did it do exactly, was this a trigger for a trend, or just an arbitrary price point that kept getting crossed from both sides.
B: If it did break the high or low did it pick up at least x number of ticks. You can define this.
C: If it did break the high or low, (This is the part you want to test) and it hit some predetermined value (Either your target tick value or target % change) then what happened next.
D: From C Above: Here is where you need to draw a hypothesis and test it such as: I think that if today breaks yesterdays (High or Low) and then moves X amount of ticks, or Y percentage, then Z will occur.
E: From D Above, you need to test your hypothesis and see if you were right or wrong. If you were right considerably more than you were wrong you may have an edge to your bet, but if this is somewhere around 50% / 50% then you don't have any edge with this idea / setting / exact bet, etc.
There is no shortcut you could take to get a quantifiable answer other than doing this in my opinion. The good news is this process is straight forward and can be done in excel in a few hours.
Just be careful to not only look at the potential positive outcomes (I.E did your bet occur the way you are hoping), but also look for any opposite moves that would likely trigger a stop loss. For example, if you are betting that if a price break implies a 20 tick up move, did you end up getting a 20 tick down move also. You can get both of these... and if this is the case you can not just assume the positive outcome without considering the negative outcome as well.
Bets of luck!
Ian
In the analytical world there is no such thing as art, there is only the science you know and the science you don't know. Characterizing the science you don't know as "art" is a fools game.
What I have to know, is how reliable are tests with price changes on history data.
Maybe I have to specify my question:
Lets say, on the 9th of february 2017 the price closed 2% or respectively 10 ticks above the previous Day High. (on the single contract)
So, on back-adjusted continuous contracts where the contracts are merged together to remove the roll over gap, did the price also raise up 2% or 10 ticks on 9th of february 2017 in comparison to the day before?
1. Historical data at this level of detail can be considered very accurate. Where you might find flaws with data would be extremely granular level 2 events, and price level events where you may have thousands of data points in just a few seconds. If we are taking about using a minute, or hour time series just get H,L,O,C type of data, then you will have no issues with accuracy.
2. I think your second question concerns building an unabridged linear data set with no gaps. This is fairly easy to do as well. The key is that if there are overlapping contracts you just need to pick the one that is relevant to your use case. Some people arbitrage when there are two concurrent futures contract for the same instrument for example last month we have a few days where both the ES 03-18 and the ES 06-18 were actively traded. So if you pick a random da in March you could have data for either contract (3-18 or 6-18) available. There are two popular ways to construct data sets that run through multiple contracts: (A: As soon as the new contract is available to trade simply switch. B: Only once the volume on the new contract > the volume on the old contract switch). This just comes down to your preference.
3. To your specific questions on the back-adjusted contract: I suppose there can be variations with different data feeds, trading software, etc. But in general I see no reason why connecting 2 contracts together would produce an anomaly if done correctly. The easiest use case will be to switch contracts on the first day available. So in your analysis you would have one day on the old contract and one day on the new contract back to back. The first data point on the open of the new contract connected to the last data point from the old contract might have a large gap that inflates any real move that ever occurred because you are switching contracts. For rollover days I would just omit these from your analysis. Depending on your instrument this only occurs 1x per quarter or 1x per month. Don't make your work ahead more complex than it needs to be, just eliminate these on your first pass. Focus on the only 95% of the days that are easy to analyze and try to determine if you have a viable bet first.
In case you can't tell, I am assuming that you are downloading your data and working manually in excel. I know there are charting tools that can attempt to tie things together but since you will need to get this data in a more granular format for your analysis I am talking more to the technical aspects of building an unabridged data set with downloaded data.
Hope this helps!
Ian
In the analytical world there is no such thing as art, there is only the science you know and the science you don't know. Characterizing the science you don't know as "art" is a fools game.
You may be interested in Dynamic SR Lines.....I use what looks like their equal on the price chart looking for breakout when the price crosses the line....the Blue and Purple lines on the price chart.... https://nexusfi.com/attachments/127775d1383705225
Most futures contracts need to be tested in ticks because of back adjustment. This is not perfect. There is also a percentage back adjusted contract that is not common. Actually, I think it applies to any type of division. However, the ticks/points is not ideal either because percentage change is more likely to be robust when applied to an underlying. For example, today a 2% move on something like ES is going to be larger in points/ticks then several years ago. The nominal value changes over time.
The only real solution is to develop on the cash when possible, re-optimize, and/or test to see if your case matters. A rolling optimization is probably the easiest way to handle as it will help deal with the nominal value change which is slower. However, it won't handle certain types of changes.
Trading: Primarily Energy but also a little Equities, Fixed Income, Metals and Crypto.
Frequency: Many times daily
Duration: Never
Posts: 5,051 since Dec 2013
Thanks Given: 4,391
Thanks Received: 10,208
If your trading stocks, feel free to use either.
If you trading futures, your prices are normally "roll adjusted" by taking the outright spread between the prompt and second contract on a predefined date. If this is the case, you can not use percentage anything - percentage breakouts, stops, profit targets etc etc - in long term back tests, as your historical prices will change on every roll over. While with some contracts (index's, currencies) this may not be a huge factor, in other commodities it can be. As an example of this I've attached a 20 year chart on the NYMEX Gasoline / RBOB / RB contract. You'll see that it will show that prices used to be negative - obviously they weren't!
You can also "roll adjust" by taking the percentage spread between the prompt and second contract on a predefined date. This will maintain price integrity for things like percentage stops etc. Unfortunately you can now no longer use anything in fixed points or dollars (including commissions).
The only way I know to use percentage's with roll adjusted futures contracts is to use two different contract price feeds, one roll adjusted and one not roll adjusted. Hence the 100 day percentage change becomes
(Close of today of roll adjusted contract - Close of 100 days ago of roll adjusted contract) / Close of 100 days ago of non-roll adjusted contract