Outros sites Medialivre
Caldeirão da Bolsa

Previsão de séries temporais

Espaço dedicado a todo o tipo de troca de impressões sobre os mercados financeiros e ao que possa condicionar o desempenho dos mesmos.

simples

por u3lk5 » 19/3/2010 15:12

Godfather ps: se tentarmos combinar todas as perspectivas talvez tenhamos uma vantagem sobre o mercado... icon_wink.gif

Canguru Pois eu acho precisamente o contrário.
Quanto mais simples, melhor!


Também penso que simples é melhor, mas o difícil é faze-lo, porque o cerébro está habituado a ter "grandes" problemas para resolver, por isso o simples é estranho, ainda mais quando se fala em ganhar dinheiro usando estratégias simples.
 
Mensagens: 390
Registado: 20/8/2009 12:27
Localização: 4

por canguru » 18/3/2010 16:53

Godfather Escreveu:ps: se tentarmos combinar todas as perspectivas talvez tenhamos uma vantagem sobre o mercado... :wink:


Pois eu acho precisamente o contrário.
Quanto mais simples, melhor!
Avatar do Utilizador
 
Mensagens: 2240
Registado: 6/4/2008 22:41
Localização: lx

por Godfather » 18/3/2010 1:49

Caro Xitonhane,

Xitonhane Escreveu:e qual é o programa matemático que consegue prever a psicologia humana?se assim fosse era muito fácil....


não existe programa matemático que consiga prever a psicologia humana, que no fundo não é apenas mais do que uma variável deste puzzle.

Mas a AT ou a AF fazem-no com uma elevada precisão?

O que é uma linha de tendência? Será Y = m*X + b?

O que é um PER? Será preço da acção / lucros da empresa por acção?

Creio que todas estas perspectivas tentam fazer, sem o conseguirem na totalidade, uma aproximação da realidade.

Contudo há uma constante, a presença da Matemática.

Cumps,

ps: se tentarmos combinar todas as perspectivas talvez tenhamos uma vantagem sobre o mercado... :wink:
The simplest answer is usually the correct answer - Occam's razor
Experience is not what happens to a man; it is what a man does with what happens to him - Aldous Huxley
Avatar do Utilizador
 
Mensagens: 214
Registado: 19/1/2009 23:08

por Xitonhane » 16/3/2010 20:56

e qual é o programa matemático que consegue prever a psicologia humana?se assim fosse era muito fácil....
 
Mensagens: 130
Registado: 14/7/2008 16:47
Localização: 13

por LTCM » 16/3/2010 15:29

Applied Quantitative Methods For Trading And ...
Anexos
QF.jpg
QF.jpg (60.26 KiB) Visualizado 1809 vezes
Remember the Golden Rule: Those who have the gold make the rules.
***
"A soberania e o respeito de Portugal impõem que neste lugar se erga um Forte, e isso é obra e serviço dos homens de El-Rei nosso senhor e, como tal, por mais duro, por mais difícil e por mais trabalhoso que isso dê, (...) é serviço de Portugal. E tem que se cumprir."
Avatar do Utilizador
 
Mensagens: 3030
Registado: 28/2/2007 14:18

por yabadoo » 16/3/2010 9:19

Aqui vai um artigo que encontrei no fundo do meu baú sobre o tema:

This article will attempt to present some insight into using ARIMA or Box-Jenkins forecasting
techniques on the Standard & Poor (S&P) 500 index futures contract. First, I will recap ARIMA in
layman's terms.
ARIMA is translated as AutoRegressive Integrated Moving Average. AutoRegressive means that the
observations today depend on the previous observations. Moving Average means that the model includes
errors made in the previous forecasts. Integrated takes into account the trend of the observations. ARIMA
models (equations) are abbreviated as ARIMA (p,d,q) where p is the number of autoregressive terms, d
is the number of differences, and q is the number of moving average terms.
Forecasting futures prices with an ARIMA model make sense because the market is composed of buyers
and sellers whose equity is directly affected by each price fluctuation. Each price change represents a real
gain to one group and a real loss to the other. Rising prices instill confidence in the bull's camp and
provide them with extra ammunition to shoot bears. This means that successive observations in price are
not completely independent, (i.e., random). Margin calls certainly are not random. The ARIMA model
then is composed of a predicted value which is dependent on previous prices, a trend component, and an
error term. Prices exhibit trends; there are errors in forecasting; and noise or randomness lives in the
market . Hence, the ARIMA (p,d,q) model makes sense in trying to forecast the real world. In fact, an
ARIMA (0,1,1) model is equivalent to exponential smoothing with which every trader is more or less
familiar.
For an ARIMA (p,0,q) model (most time series can be well fitted with this type of model), the next
observation may be estimated by the following equation:
Xt = Constant + AR1 (Xt Actual) + AR2 (Xt-l Actual) +...+ ARP (Xt-p Actual) -MA1 (Xt Forecast - Xt
Actual) -MA2 (Xt-l Forecast - Xt-1 Actual) -. . .- MAP (Xt-p Forecast - Xt -p Actual) + Et
This equation merely states that the forecasted or expected price is equal to (=) a constant value plus (+)
the autoregressive (AR) terms minus (-) the moving average (MA) terms plus (+) the current error (E).
The equation permits one to update a forecast once the coefficients have been calculated from past
observation. Box and Jenkins maintain that the time series model needs no more than 2 autoregressive
terms and 2 moving average terms. Their book (see references) details the algorithms to do the
estimating, testing and forecasting.
In Table 1, I have used weighting parameters obtained with EASI/ARIMA - The 2% Solution (a software
package for Apple II or IBM microcomputers). Based on past daily highs of S&P futures, we have the
following:
The mean error is well within the 2%, tolerance range. My data used in the model estimate ended on 16
Aug 84. Notice in Chart 1 that, even with a huge runup, the prices could be satisfactorily modeled
without the need for differencing (i.e., using the differences between prices rather the prices themselves).
This price data is modeled as a stationary time series (one with a constant mean). A similar set of
coefficients was developed for the lows.
ARIMA Model Results
Using the Programming Subsystem within CompuTrac, I programmed a User Study to do the forecasting,
testing, and plotting of the equation noted above. Chart 1 shows the High, Low, and Close in relation to
the expected extreme 50% probability boundary of the High (upper long dash line) and Low (lower short
dash line). The ARIMA Model highs and lows establish an envelope within which the price activity can
be expected to be contained within a statistically significant boundary.
This is what I really like about ARIMA: The ability to derive a forecasted number plus a boundary which
will contain the forecast X% of the time. There are some differences in the forecast values between my
User Study program and the values forecasted by EASI/ARIMA due to rounding. In EASI/ARIMA, the
coefficients and computations are carried out to 10 decimal places. An Apple II+ running under
CompuTrac does not have this accuracy nor is a forecast to ten decimal places really necessary. The
differences are noticeable only with big price swings out of the confidence range and large error terms as
a result of these swings. Table 2 shows the values of the coefficients used by my program and those used
by EASI/ARIMA.
In all cases, my numbers were well within the 50% confidence level and usually within 4 tics (0.20 points
or $100).
This may seem nit-picky to some, but when there is money on the line, I want to be the best that I can be.
In the past I have been thoroughly disappointed by the claims of others. I want my work to reflect only
things which can be proven to my satisfaction.
Upon inspection of numerous forecasts, it is evident that the forecast errors are generally in the direction
of the trend in force at the time (even though that trend may be very short and considered random by most
observers, especially those on the 10 o'clock news). These prices can become action points. One possible
use for ARIMA would be placing stop loss orders for a trend following system.
ARIMA System Testing
I have taken a slightly different approach. By using the S&P ARIMA Model and the data base, I have
attempted to define and illustrate strategies using a 50% probability band in conjunction with the
expected highs and lows. This testing is 100's, hindsight. Its purpose is to determine if these action points
provide trading opportunities. The strategies are as follows:
System 1. Buy the penetration of the upper 50%, boundary level (HI HI) and hold the position without a
stop loss until a reversal signal is generated by a penetration of the lower 50% boundary level (LO LO).
This strategy will always be in the market.
System 2, Buy a close above the HI HI. Sell and reverse a close below LO LO. This strategy will always
be in the market with no stop loss.
System 3. Buy a 0.20 point (4 tick) penetration of AR HI (the expected high) and liquidate on the market
close. Sell a 20 point (4 tick) penetration of AR LO and liquidate on the market close. Allowance is made
for a slightly worse entry as well as gap openings through the price.
System 3A. System 3 with a 1.00 point stop loss on both long and short positions.
System 4. Buy penetration of AR HI and liquidate on the close. Sell penetration of AR LO and liquidate
on the close.
System 4A. System 4 with a 1.00 stop loss on both long and short positions.
System 5. Buy open above AR HI and liquidate on the close. Sell OPEN below AR LO and liquidate on
the close.
System 5A. System 5 with a 1.00 point stop loss on both long and short positions.
System 6. Buy penetration of HI HI and liquidate on the close. Sell a penetration of LO LO and liquidate
on the close.
System 6A. System 6 with a 1.00 point stop loss.
No commission costs are computed in the results. 1.00 point = $500.00. The results are shown in Table 3.
The maximum number of points traveled after the signal is included as Total Points Possible.
Unlike an actual performance record, simulated results do not represent actual trading. Also, since the
trades have not actually been executed, the results may have under-or-over compensated for the impact, if
any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also
subject to the fact that they are designed with the benefit of hindsight.
It is interesting that there are a lot of available points to be captured using any of the entry signals, but the
majority are left on the table. System (1) recovers almost 30%, ($7375) of the potential gains and is the
best in this respect. There seems to be room for improvement. Stop loss levels do improve the overall
results. Both long and short positions have approximately the same potential gains. This is a function of
the way the model is constructed. I have the details of Table 3 available for anyone who would like them
for closer inspection.
Penetration of any of these points is significant and is indicative of additional strength or weakness. Only
in a few instances were the action points the same as the actual high or low. These action points can be
used as risk control points for other technical systems or as viable entry points for new short term trades.
 
Mensagens: 535
Registado: 5/3/2010 17:06
Localização: 16

por canguru » 15/3/2010 23:11

Xitonhane Escreveu:Usa o GRETL um pequeno programa estatistico, uso livre, faz umas boas estimações....


Ópa isso é muito bonito mas como é que simulas/modelas o comportamento humano?

Eu agarro numa série temporal de um ano de temperatura e consigo arranjar uma função (ex. polinomial, trignométrica (sin (f(x)) ou cos(f(x))) ou uma ciclóide) que se ajuste q.b.

E depois? Onde é que entra o crash da crise asiática? E o da crise russa? E a falência do LB? e uma passagem bear-bull como aquela que assistimos no último ano?
Avatar do Utilizador
 
Mensagens: 2240
Registado: 6/4/2008 22:41
Localização: lx

por Xitonhane » 15/3/2010 18:32

Usa o GRETL um pequeno programa estatistico, uso livre, faz umas boas estimações....
 
Mensagens: 130
Registado: 14/7/2008 16:47
Localização: 13

por yabadoo » 15/3/2010 16:57

Eu tive uma breve experiencia com modelos ARCH e GARCH que vinham implementados em excel num livro de econometria da Carol Alexander.
Não experimentei o suficiente para ter uma opinião fundada, pois acabei por desistir por não me sentir à vontade com aquilo.
No entanto, lembro-me agora, exitem uns artigos da revista Stocks & Commodities onde o tema ARIMA é abordado numa perpectiva de trading.
 
Mensagens: 535
Registado: 5/3/2010 17:06
Localização: 16

por Godfather » 14/3/2010 18:07

Caro Luis39,

a previsão de séries temporais é um tema bastante interessante mas simultaneamente complexo.

A pesquisa de time series forecasting indica 22,8 milhões de resultados, contudo ainda existe muito estudo e trabalho até obter soluções eficientes de aplicar a múltiplos domínios de conhecimento.

Existe um software da investigadora portuguesa Cândida Ferreira que inventou uma nova técnica (podes considear como um novo sub set) de algoritmos genéticos.

O algoritmo em questão é o GEP que consiste na capacidade de transformar por exemplo uma folha de Excel cheia de números (colunas com histórico e indicadores de uma acção, dados meteorológicos de um país... os domínios são imensos!) e representar essa sequência de números por expressões matemáticas que são descobertas pelo algoritmo (em que cada coluna representa uma das variáveis x, y, z... que compõem a expressão matemática.)

Este sistema é apenas uma hipótese na panóplia de diferentes soluções que encontramos para resolver este jogo que é a bolsa seja através de AT, AF ou programas informáticos que desenvolvemos como hobbie :)

Imagem

Os artigos que referiste são de que tipo de algoritmos, Rede Neuronais?
The simplest answer is usually the correct answer - Occam's razor
Experience is not what happens to a man; it is what a man does with what happens to him - Aldous Huxley
Avatar do Utilizador
 
Mensagens: 214
Registado: 19/1/2009 23:08

Re: Previsão de séries temporais

por Luis39 » 14/3/2010 17:21

Só para puxar o tópico para cima!
 
Mensagens: 181
Registado: 11/1/2008 11:56

Previsão de séries temporais

por Luis39 » 14/3/2010 0:28

Olá caros forenses, no meio de um estudo que ando a fazer relativamente à abordagem da bolsa, deparei-me com vários artigos relativos a esta questão que são as previsões de séries temporais. Basicamente consiste na previsão de valores futuros com base em valores passados, existindo até ja´sistemas, penso que o ARIMA, que nem se baseia em valores do passado...Embora a matemática seja um dos meus fascínios, admito que me faltam algumas bases para chegar a conclusões fiáveis. Parece ser uma ferramenta bastante potente e interessante, para apoio à decisão. Assim, gostaria de saber se alguém aqui no forum utiliza esta "ferramenta matemática" como apoio ao investimento bolsista.

BN
 
Mensagens: 181
Registado: 11/1/2008 11:56


Quem está ligado: