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

RE: [amibroker] Trends, random series



PureBytes Links

Trading Reference Links

Yes, it is about probabilities. Statistics governs all. And you are right about not being exactly correct all the time in predicting what will happen next with the price. But, don't forget, we are dealing with numbers that have a huge variance. The higher the variance, the less predictive power one has. Parametric statistics makes a fundamental assumption that the data are independent and normally distributed. Distributions can be log-transformed to become normal, but how truly independent are the numbers? When the 1987 crash occurred, the entire market collapsed. Everything was correlated, pork bellies and coffee and stocks and bonds, etc. Mass psychology often overcomes statistical probabilities, and how do you account for that objectively? Don't get me wrong; TA can be very helpful and valuable, and I'm not trying to denegrade it here, but I don't think it is entirly correct to rely on it to the degree that many technicians do. Al Venosa >From: "Ken Close" >Reply-To: amibroker@xxxxxxxxxxxxxxx >To: >Subject: RE: [amibroker] Trends, random series >Date: Thu, 20 Jun 2002 11:08:11 -0400 > >Al and Richard: > >Don't we use all of our "TA tricks" to try and gain the highest probability >of success in our placing the next trade?? > >To me it is not about predicting **exactly** the next price bar but in >concluding (my perception I guess) that the odds are better than 50:50 that >my trade will be profitable because my particular TA indicates a higher than >50:50 chance of a move in my desired direction. > >Isn't it about probabilities??? no exact correctness??? > >Ken >-----Original Message----- >From: Al Venosa [mailto:avcinci@xxxx] >Sent: Thursday, June 20, 2002 10:38 AM >To: amibroker@xxxxxxxxxxxxxxx >Subject: Re: [amibroker] Trends, random series > > >Well, Richard, I think your last paragraph said it all. We are all >implicitly assuming there is structure to the past that can help foretell >the future. What that means is that we don't really trade the markets; we >trade our perception of the markets. That being the case, if you construct a >short ma system and I construct a long ma system or if I go short and you go >long, who's to say which one of us is right a priori? No one. Why? Because >there is no underlying fundamental basis behind the price action of the >market. Everything is stricly empirical, with price data having infinite >variance, and therefore subject to change in a moment's time at the whims of >the suppliers and demanders. In my mind, there is no scientific, fundamental >basis behind price action (and therefore technical analysis). If there were, >people would have figured it all out by now and could make 100% accurate >predictions. So, my opinion is that synthetic data as described by Chande >are just as useful in simulating the market as real data and therefore just >as useful to test your system on. You can still use your indicators the same >way you do on real data, and they'll tell you the same thing. To answer your >question 'what the heck are we wasting our time messing with technical >data', I think we use technical analysis to help us formulate algorithms >that describe OUR PERCEPTION of the markets. If price is above the ma, we >think we are in an upward trend. Are we? Who's to say? It's all empirical. >Tomorrow the price could fall below the ma. Does that mean we are suddenly >in a down trend after just being in a 2-day up trend? No one can foretell >the future with any accuracy at all based on past market data. If you think >you can, I think you are kidding yourself. I think one should try to keep >trading systems as simple as possible. The more indicators one uses, the >more degrees of freedom are used up, and one's predictive power suffers >proportionately. > >In summary, I think you and I will have to respectfully agree to disagree on >this interesting topic. The scrambler is just another tool in our arsenal of >weapons that may help us establish our perceptions of the markets and >formulate our trading systems. This weekend, if I get a chance, I'll try to >do some system tests on synthetic data and compare the results to real data >to see how they compare. Maybe I'll eat crow (or maybe Markov monkey). Who >knows. > >P.S. Just before posting this, I read your message about the Markov monkey's >version of the King James version of the Bible. Pretty neat and entertaining >stuff. Thanks a lot. > >Al Venosa > > >From: "Richard Alford" > > >Reply-To: amibroker@xxxxxxxxxxxxxxx > >To: > >Subject: Re: [amibroker] Trends, random series > >Date: Thu, 20 Jun 2002 08:25:47 -0500 > > > >Thanks, Al, for describing Chande's methodology. I have no doubt that it >will generate a synthetic ohlc time series with the same delta distribution >as the original set. The question still remains: What use is it? > > > >I disagree that this is useful for "out of sample" testing! In fact I don't >see any use except for classroom discussions - which may also be useless . > > > >It gets back to the fundamental issue: If there is no information in the >previous data, the sequencing of the data, what the heck are we wasting our >time messing with technical data? This method of creating synthetic data MAY >contain a slight history by constraining the distribution to changes in >daily price - it will make it appear realistic and will offer some 4n! >possibilities ( don't quote me on the combinatorials ) - but it doesn't >change the result. > > > >As an aside, let me recall an interesting paper I ran across in the dark >ages - about the n-th order monkey. Basically it developed the fable that a >1000 monkeys at a 1000 typewriters (pre PCs) typing a 1000 years would >create -say Shakespeare... They began to change the distribution of the >keyboards to reflect the distribution of letters in Shakespeare (or >Hemmingway, Chaucer, the Bible, etc) and suddenly words began to appear more >frequently. Further enhancing the keyboards to reflect the distribution of >pairs of letters (u almost always follows q, h often follows t, etc.) and >many more words appeared - a 2nd order monkey (also related to a Markov >process of length 2, I believe). This continued onwards until buy the time >we had a 4th order money the results were absolutely amazing! Although the >paragraphs didn't make a lot of sense, they definitely had the style of >Shakespeare, Hemmingway, Chaucer etc. Words and word-like strings >predominated and the sound of the words reflected the model. The same could >be done with ohlc-time series - but the result would be no more useful than >the writings of the 4th order monkey. (btw: As the exception to the rule, a >second level monkey can replace most business consultants I have encountered >.) > > > >Now back to "trends". > > > >For any bar series, I suspect one can optimize a simple trend method, e.g. >ma-crossovers, which will identify periods in which the close is above the >ma - thus in a trend. Obviously, various length ma's will identify various >trends. (this will also be true for the Chande synthetics.) The interesting >issue is whether this optimization is useful for investing? Which gets us to >out of sample testing - use the values optimized over one period for another >period - if the trend characteristics are stationary, i.e. don't change, >between the two periods there is reason to hope that a hidden feature has >been discovered. More likely, the returns over the test period will differ >from the design period. > > > >I don't think I am saying anything particularly profound, simply >regurgitating basic analysis features. One can muddy the issue by throwing >in various money management procedures but the result is the same. We are >all implicitly assuming that there is a structure to the past that can be >extrapolated into the future - both the fundamentalists and the >technical-ists (???). That structure may be the general herd behavior of >investors or the phase of the moon. > > > >Cheers, > > > >Richard > > ----- Original Message ----- > > From: Avcinci > > To: amibroker@xxxxxxxxxxxxxxx > > Sent: Wednesday, June 19, 2002 7:12 PM > > Subject: Re: [amibroker] Trends, random series > > > > > > William (and Richard), > > > > > > > > Let me try to explain Leo's scrambler. It was developed by Tushar Chande >from his book Beyond Technical Analysis, 2nd ed. Chande randomly rearranges >the data of a ticker to create new sequences. He does this as follows: he >observes the relationship between the O, H, L, and C of the 2nd bar by using >the C of the 1st bar as reference. So, he writes the relationship as: > > > > > > > > DeltaO = O - ref(C,-1); > > > > DeltaH = H - ref(C,-1); > > > > DeltaL = L - ref(L,-1); > > > > DeltaC = C - ref(C,-1); > > > > > > > > He samples with replacement with these formulas and creates patterns that >bear the market's signature as defined by relative price relationships. The >next step is to use a random number generator to scramble the bars. When you >have a new sequence, you need a starting point, which is usually the prior >C. The new bar is derived from the prior C as follows (where the Syn prefix >stands for the new synthetic values): > > > > > > > > Syn-C = ref(C,-1) + deltaC; > > > > Syn-H = ref(C,-1) + deltaH; > > > > Syn-L = ref(C,-1) +deltaL; > > > > Syn-O=ref(C,-1) + deltaO; > > > > > > > > He calculates the interbar relationships as defined above for a ticker of >your choice. He uses a random number generator to pick a number from 1 to x >(x determined by the no. of bars you want to scramble). That number is the >next bar of the sequence. Suppose on the 10th pick, you pick bar 5. Then the >original bar 5 becomes bar 10 of the new sequence. The bars may repeat. You >can generate as long a sequence as desired. You use the synthetic values >determined by the equations above to establish the next bar's appearance. >Thus, what you wind up doing is encapsulating the market behavior in the >original bar 10 and reproducing it in another sequence to create new >synthetic data. You can generate a variety of chart patterns of any length >using data scrambling. According to Chande, you can generate 100 years of >data and test your system against a variety of market conditions. Since >these are the types of patterns you are likely to see in the future, this is >the most rigorous out-of-sample testing you can achieve. > > > > > > > > The above commentary was partly plagiarized from Chande's book, and it is >merely a synopsis. To get a clearer understanding of the methodology with >spreadsheet examples, you should read his chapter devoted to scrambling. > > > > > > > > I have attached 2 gifs showing what scrambled data look like on 2 >different tickers. Note that the patterns are not any more unusual than >those of normal chart patterns, and you can see definite trends developing. >In fact, if you look at recent real charts of the market indices, you will >see many instances of V-tops and V-bottoms, which is what William was >concerned about earlier today. Hope this helps. Many thanks to Leo >Timmermans for programming Chande's scrambler for Amibroker. I asked him >recently if he could program it in such a way to create synthetic data for >an entire watch list at one time. That might be tricky, but he said he would >look into it. > > > > > > > > Al V. > > > > > > >---------------------------------------------------------------------------- >---- >Join the world’s largest e-mail service with MSN Hotmail. Click Here > > Yahoo! Groups Sponsor > ADVERTISEMENT > > > > >Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > MSN Photos is the easiest way to share and print your photos: Click Here