[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: adaptive systems - how to define appropriate time windows ?



PureBytes Links

Trading Reference Links

John:
Thanks for this excellent explanation and description.
Lionel Issen
lissen@xxxxxxxxxxxxxx
----- Original Message -----
From: "John Manasco" <john@xxxxxxxxxxx>
To: <metastock@xxxxxxxxxxxxx>
Sent: Wednesday, February 06, 2002 2:01 PM
Subject: Re: adaptive systems - how to define appropriate time windows ?


> Here is a discussion from another email list on adaptive systems.
>
> adaptive systems is pretty
> complicated matter.
> there are several known ways
> of doing it, at least about 4.
> the math is not too complicated but
> arcane and the concept is
> hard to comprehend.
> there are several questions:
> what does adaptive system mean?
> what do you adapt it to?
> what to adapt?
> what do you adapt it based on?
> how do you do it?
> what is the math?
> how to you implement it in code?
> is it doable?
>
> adaptive means the system's algorithm
> tunes itself up as the "market footprint"
> changes to maximize the performance
> criterion which is max reward at min risk.
>
> if you want to discuss adaptive first you
> have to discuss non adaptive systems
> like the ones you can code in TSs.
>
> the main objective of any system is to
> find the balance in between the risk
> and the reward - which is the main
> criteria. in TS we do that by running
> optimization and finding the suitable
> peak in the optimization function.
> optimization function (OF) has a
> dependent and independent variables.
> dependent variables are Max Profit (MP)
> and Min Risk (MR), independent are
> your parameters / inputs ( I )
> example: if you have 3 inputs 3 Is
> your OF will is 4 or 5 dimensional
> ( 3 Is + MR + MP ). this could be
> graphically representing as a multidimensional
> surface. the key is to find the peak of
> that surface( that's why if system has more
> than 3 inputs i toss it ) - hard to do
> because it's hard to visualize.
> you can see now that if a system does not
> adapt you have to find the peak manually
> or you have to compromise.
> *most systems fail because they are not
> adaptive - curvefitted!!!
>
> so, the purpose of adaptive system is
> to find that peak in OF in real time.
> to know the peak you need to know
> the OF. to know OF you have to
> know: MR, MP, and all Is.
> let's break it down.
> MR and MP: you have to calculate
> systems performance in real time.
> but the system does not know how
> it performs itself. it needs some criteria
> to go by. how can a system know
> if it works on all cylinders and bangs
> out max profit at min reward or just
> barely making it? you have to give it
> a reference to go by. this ref performance
> is called system efficiency (SE). SE is
> calculated in % by comparing in real time
> the performance of real system to
> the performance of ideal system. another
> term needs to be introduced - ideal system.
> ideal system buys the very top and sells
> the very bottom. you can easily calculate
> that buy coding a function that will sell
> and buy in hindsight and give you
> max possible profit at zero risk.
> now, then you take ideal system as 100%
> efficiency, then your
> SE =  real performance / ideal performance.
> say your average SE = 30% that means
> you are pulling out 30% or what you can pull
> out of the market. this becomes the criterion
> to go by in adaptation or Max SE.
> this can fluctuate from Min allowable SE
> say 20% to 100% ( will never be 100%).
> based on statistical runs you can then calculate
> mean SE to go by, say 30%.
> now you know what to adapt to.
>
> next is what to adapt:
> well, obviously you have to adapt your
> parameters or inputs - your Is.
> you have to tune your inputs to get the highest
> SE. that's where it gets real tricky.
> to be able to do that you need OF- you need that
> curve to tell you what the parameters should
> be to get max SE. let's leave this out for a second.
>
> next is what do you adapt based on:
> you adapt based on changing market conditions
> or what i call changing "market footprint".
> every instrument traded out there has it's own
> particular market footprint which is:
> a compilation of statistical variables common
> to all instruments, like: ave true range ( bar velocity),
> ave volatility, volatility std,  average volume,
> liquidity  and so on. footprint is a set of
> statistical parameters that you can use as fingerprints
> to identify and differentiate between different
> instruments you trade. this footprint will change
> in real time... volatility will fluctuate, so will volume,
> average bar range, etc. one day SP can trade
> real narrow range with low volume, the next day
> volatility can explode - market footprint changed.
>
> next is how to adapt it.
> well, the first thing that should pop into your mind
> is that you need a feedback loop of some sort.
> the rational loop is this:
> footprint changed -> adjust parameters ->
> to maximize SE ratio -> if SE drops means
> footprint changed -> repeat.
> if you examine this loop you'll notice that
> you need at least 2 functions ( transfer functions )
> to do that:
> 1. parameters = f ( footprint )
> 2. SE = f( parameters )
> of you can rewrite it as:
> SE = f ( f ( footprint ) ); tells you systems
> efficiency will fluctuate based on changing
> market conditions.
> so where do you get those functions:
>
> a. from a sample run: you do a pass
> over data, build your OF function and
> then build your parameter = f( footprint )
> function. log it in and use it for the real
> time run. you can keep updating those
> functions in real time. this is similar to
> manual optimization where you do
> sample runs but in addition to that
> the OF gets updated in real time.
>
> b. ramp up period. you start with
> a ramp up period and update your
> 1 and 2 functions as you go along
> your SE will start with 0% and will be
> improving as those  functions
> will be more and more accurate.
> the system like this will start trading
> real bad and then improve it's performance
> as it adapts and learns to  trade better and better.
> the performance will taper off and stabilize
> as those functions are saturated.
>
> c. multiple parallel models: you run
> multiple systems based on different
> parameters and find the best performing
> one under changing market footprint and trade
> that best one.
> this approach however does not guarantee
> that the best performing current model
> will continue to be the best tomorrow.
> John Clayburg implemented this approach
> by running parallel performance functions
> in TS. it showed a little bit of improvement
> but not much. the reason again that
> you are chasing the best performing model
> that will not necessarily continue to perform
> good tomorrow ( best fit today is not
> necessarily will be the best fit tomorrow )
>
> d. my approach. since i already went through all
> of the bs in paragraphs a through c  what i do
> is the direct analytical approach - a shortcut.
> i ask myself a question - how
> this specific market variable will affect
> my SE ( systems efficiency, performance ) or my
> P&L through direct math.  first i try to tie as many
> parameters to market footprint ( market variable )
> it allows me to make a shortcut and i don't have
> to find parameter = f ( market footprint ) function.
> market footprint becomes the parameter itself.
> next, i try to answer the question of how will
> this market variable affect my PL analytically -
> i try to find SE = f ( footprint ) function by
> studying how, say, volatility affects my PL in
> the signal generator. if market becomes noisy
> how will it affect my PL in the system.
> the answer is simple: more noise you got
> less money  you make.
> last step is to measure market variable ( market
> footprint ) and through those functions adjust
> your algorithm to pump up your SE.
> this is the right approach and the best one.
> in short, your adaptive techniques should be
> built right into your trading algorithm.
>
> - define market footprint ( which market variables hurt or
> improve your systems performance ) then
> - use those as your parameters so that the market will
> itself adjust those for you then
> - define your signal generating algorithm to include
> those parameters and specify how those will
> affect your systems performance.
> -specify how your trading algorithm should change
> based on that parameter.
> that's it. it becomes self adaptive.
> an example:
> market footprint  = noise level
> noise level = your parameter
> more noise -> less profit
> less noise -> more profit.
> if more noise then increase risk and lengthen
> time horizon to maximize profit and minimize
> loss.
> if less noise then decrease risk and
> shorten time horizon to maximize profit and minimize
> loss.
>
> a common parameter is lookback. in MA.
> well, going by what is said is MA lookback has anything
> to do with a market footprint market variable - nope.
> you can't differentiate markets by MA lookback - toss it.
> another common lookback variable - ATR ( lookback ) -defines
> a lookback in average true range calculation.
> can ATR be used as a market variable to define market
> footprint?  possibly can. that's why ATR often referred
> to as "adaptive" variable - changing. but even
> ATR can vary based on lookback used. so, it's semi
> adaptive, you still have the lookback to deal with.
>
> it is self evident that the first step in designing adaptive
> systems is to define market footprint
> in variables that require no parameters or
> or allow only parameters will not affect
> variable measurement itself.
> if you try to define noise through ATR then
> ATR is dependent on lookback unless the lookback
> value is high. but then if lookback value is high, ATR
> will not be sensitive to it's most recent change. :-)
> go figure.
> volatility also requires lookback.
> almost everything there needs a damn lookback or a factor.
> however if you  isolate the most recent swing ( current trade )
> in  the price and find pivot high and pivot low and find
> the duration of that swing and use that duration as a lookback
> then what your saying is that i only want to measure noise
> during the most current trade that i am in... this becomes
> adaptive lookback and ATR becomes adaptive.
> then your market variable can be called - ATR of last tradable
> swing... and not ATR of some arbitrary lookback that
> you think is suitable.
>
> at the end it all comes down to about 4-5 market variables
> that you need to define and most of them have to do with
> volatility in one form of the other. volatility is the main market
> variable!
> - untradable volatility = noise = risk = lag
> - min tradable volatility = vector deviation = min signal = reward =
profit
> or loss differential.
> - max tradable volatility = vector volatility = max signal = trend = sum
of
> all positive and negative
> profit differentials ( profitable and unprofitable trades - risk and
> reward )= your total P&L.
>
> find noise then you can find the signal,
> find the signal then you can find the trend.
> find the trend then you are done.
> just don't use any fixed lookbacks and factors :-)
>
> this is pretty much it without any hard math thrown in.
> bilo.
> ps. markets are dynamic, most systems are static
> that's why most systems don't work.
> and if you add irrational buy and sell rules on top of many
> input parameters, they don't work at all.
>
> ----- Original Message -----
> From: "rudolf stricker" <lists@xxxxxxxxxxx>
> To: <metastock@xxxxxxxxxxxxx>
> Sent: Wednesday, February 06, 2002 12:16 PM
> Subject: adaptive systems - how to define appropriate time windows ?
>
>
> >
> > List,
> >
> > using an adaptive system for day-to-day  trading of DAX options, I
> > wonder, which criteria might be helpful to define  "the best"  time
> > window to deal with ... Presently, I use a 5 years window, where the
> > rating criteria to select an appropriate system are weighted something
> > like exponentially over time.
> >
> > But at these rapidly changing markets, I get some unsatisfactory
> > results: While my system shows nice results e.g. for long puts over
> > the last year or so, this potential couldn't be used: my money
> > management (based on 5 years) nearly stops me out from trading these
> > system results, because the strategy working well for the last year
> > doesn't show good results for at least some of the years before.
> >
> > So my questions are:
> >
> > What time period may be appropriate to construct a(n adaptive) trading
> > system for a given equity?
> > What criterions (to read from the equity's historical data) could help
> > to define "the best" time period?
> > What other aspects may be important to define an appropriate time
> > window?
> >
> > Any hint is welcome ...
> >
> > mfg rudolf stricker
> > | Disclaimer: The views of this user are strictly his own.
> >
> >
>
>