Wednesday, August 22, 2012

Book 3: Applied Quantitative Methods for Trading and Investment Applied Quantitative

Chapter 1:Applications of Advanced Regression Analysis for Trading and Investment

The prediction of Forex time series is one of the most challenging problems in forecasting.

a parametric model in statistics is a family of distributions that can be described using a finite number of parameters.

a model is considered non-parametric if all the parameters are in infinite dimensional parameter space.

Essentially, he concludes that non-parametric models dominate parametric ones. Of the non-parametric models, nearest neighbours dominate NNR models.

the data is obtained from Datastream for the historical forex.

FX price movements are generally non-stationary and quite random in nature, not suitable for learning purposes. To overcome this problem the series is transformed into rates of return given a formula:
Rt=( Pt/pt-1) -1

The advantage of using a return series is that it helps making the time series stationary (use statistical property)

To confirm that a series is stationary we perform the Augmented Dickey-fuller and Phillips-Perron test statistics to show  1% significance level.

ADF and PP from the above mentioned is a test for a unit root in a time series sample.
a unit root is a feature of processes that evolve through time that can cause problems in statistical inference if its not adequately dealt with.

Augmented Dickey-Fuller
Uses a negative number, the more negative it is, the stronger the rejection of the hypothesis that there is a unit root at some level of confidence
Phillips-perron
it is used in time series analysis to test the null hypothesis that a time series is integrated of order 1.
the Phillips–Perron test makes a non-parametric correction to the t-test statistic

The benchmark models used:
Naive strategy:
Assumes that the most recent period change is the best predictor of the future.

MACD Strategy:
a moving average is obtained by finding the mean for a specified set of values and then using it to forecast the next period

ARMA Methodology:
useful to a single stationary series or when economic theory is not useful. a highly refined curve fitting device that uses current and past valuesof the dependent variables to produce accurate short term forecast.
Does not assume any particular pattern in a time series,but uses an iterative approach to identify a possible model from a general class of models.
Tests of adequacy determines a satisfactory model. The general class of ARMA models is for stationary time series, if the series is not stationary an appropriate transformation is required.

Likelihood ratio(LR) is used for redundant or omitted variables
    *used to compare the fit of two models, one the null model is a special case of the other alternative model
   
Ramseys RESET test was used for model miss-specification.
    *a general specification test for the linear regression model.it tests whether nonlinear combinations of the fitted values help explain the response variable.   

significance of the model is tested via F-Test
    *a statistical test in which the test statistics has an F-distribution under the null hypothesis. its used to compare statistical models that have been for to a data set, in order to identity the model that best fits the population from which the data were sampled.

serial correlation LM test(Breusch–Godfrey test) shows further confirmation of the model at 99% confidence interval.
    *used to assess the validity of some of the modelling assumptions inherent in applying regression-like models to observed data series

Logit estimation:
logit model belongs to a group of models termed "Classification models"
a multivariate statistical technique used to estimate the probability of an upward or downward movement in a variable.


Neural Network are universal appropriators capable of approximating any continuous function.
The advantage of NNR models over traditional forecasting methods is that the model best adapted to a particular problem cannot be identified. therefore its better to resort to a method that is a generalization of the many models that rely on an a priori model.

The problem of NNR models is because of their Black-box nature. excessive training times, overfitting, large number of parameters required for training are some of the problems.
Therefore deciding on the appropriate network involves much TRIAL AND ERROR.

financial applications time series may well be quasi-random or at least contain noise.
quasi-random: n-tuple to fill n-space uniformly.

Occam's Razor: selecting among competing hypothesis which makes the fewest assumptions.
unnecessary complex models should not be preferred to simpler ones.

the objective is to find a model with the smallest possible complexity and yet still describe the dataset without overfitting

a reasonable strategy in desigining NNR models is to start with one later containing a few hidden nodes and increase the complexity while monitoring the generalisation ability. a crucial factor is determining the number of layers and hidden nodes.

Backpropagation networks are the most common multilayer network and are the most used type in financial time series forecasting (Kaastra and Boyd, 1996).

Because of the pattern matching of NNR models the representation of data is critical for a successful network design.raw data is rarely fed into the network. they are scaled between the upper and lower bounds of the activation function.

another crucial parameter of the network is the learning rate. smaller learning rate slows the learning process. while larger rates cause the rror function to change wildly without continuously improving.

linear cross-correlation analysis: give some indication of which variables to include in a model, or atleast a starting point to the analysis

How to perform Linear-Cross-Correlation?

explained variance:how much variation in that model given a dataset

post training weight analysis helps establish the importance of the explanatory variables  because of no standard statistical tests for NNR models. the idea is to find a measure of contribution a given weight has to the overall output of the network. Such analysis includes examination of a Hinton Graph.

Hinton Graph represents graphically the weight matrix within a network

The MAE and RMSE statistics are scale-dependent measures but allow a comparison between the actual and forecast values, the lower the values the better the forecasting accuracy.
When it is more important to evaluate the forecast errors independently of the scale of the variables, the MAPE and Theil-U are used. They are constructed to lie within [0,1], zero indicating a perfect fit.

The study used rates of return. Mehta 1995 suggests the use of first difference as a way to generate data sets for neural networks.

CONCLUSION
in order to use a NNR model we need to process the time series to a stable non moving series and arrange the input of the network based on the activation function available to the network. Everything else about the NNR remains the same, the regular network parameters should be tested via trial and error to find the best number of hidden nodes or hidden layers.



Saturday, August 11, 2012

Online Trading Academy DVD- Professional Trader Summary


EPS. EPS of a company is measured against its industry, if its lower than the industry EPS then its undervalued. if its higher then its overpriced
http://biz.yahoo.com/p/industries.html

the higher the spread the more the volatility and much more risky

concentrate with a spread of 0.5

buy low, sell high
buy near support, sell near resistant
 everything known or knowable is reflect in its price and volume 60 to 80% correlation
there is no real tool just a series of tools

intraday (5 min, 3 min, 1 min, tick)
Daily (1 year, 180, 90, 60 days)
Weekly/monthly (long term-decade charts)
 what chart to use in a situation?

OpenHighLowClose (OHLC)
Close most important. determines who won
trend line at 67% is as much as you can go. slope of the line

double top- upward trend just before the second top you will see longer candles and trend changes after

 be a defensive trader.

when you see the gap on a weenkend. wait 1 hour to see if there are any changes before trading.a gap down fills up 32% from the closing on friday.

if after gap down, within the house if you see goes up at 60% of the original price, the 60% chnage will close higher

while below 32% might close lower than the opening 70% of the time the percentage is based on fibonnacci

scalping-timeframe is seconds to minutes (need level 2)
very quick when you have alot of tickets.
objective is not to loose, if you do, loose very little
speed is everything-high cost of commissions-high buy power or many trades.

3 rewards to 1 risk
you need to have alot of cash because 100 shares is not worth it. you do 1000 plus shares

momentum trade.immediate momentum swing (need level 2)get out when you can not when you have to.
1 to 10 minute trader
if momentum is slow : GET OUT

swing trade: based on technical analysis. 10 minutes to 2 weeks(2 to 3 days to develop)
look for distinct trend or pattern trade and stick with it

position trader: weeks to months. uses technical anaylsis, stop loss at support lines. Larger risk.
alert to major changes in the market.ties up capital for long periods.

buy on a winner. if you want to buy 1000 stocks of a certain sector, try to find the top dog in an industry. 300 share of microsoft, 300 share of apple, 300 share of quest technology,which ever goes down the most, sell and buy on the one that goes up the most. when left with 2, sell the loss and add to the winner.

dont play mind games, STICK to your PLAN.maintain accuntability.
have an overall strategy (FUNDING, initial capital)
have an each trading day strategy. (think of loss and win on trading)

dont focus on the money, focus on the trade.
if you trade with less than 50% probability, your a fool. anything less, your a gambler.
dont count your chips when your sitting at the table. do that after your out of the game.

discipline is knowing you will follow your rules.
be consistent and repeatability. dont try to do home runs. if you can be profitable with a very small amount its only a matter of volume.

review your plan every day, dont change during trading.
if the plan of trading doesnt work a couple of times, then change or tweek it.
create a worksheet, when did you buy,what did you buy, why did you buy, what prices are there,what stop signs did you put, what is the profit margin.

your in and out according to rule, not anything else.Investors Business Daily.(Check this as a NEWS, they tell you why they think it

will go up through analytical technique. "PAY")
learn from the loosers.very important to learn if you loose, you cant always

win.

85-85-B-B-B is a rating.
85-85:EPS and Relative price strength rating is better than 85% its highly good.
1 - 99 pecrcent rating
B-B-B:Industry Relative price strength rating - sales+profit+return equity -

Accumulation distribution rating
"A" Best to "E" worst

SmartMoney.com - shows you the lead dog
Avg Volume: Average Daily Volume
Share outstanding??

beta - measure the volatilty relative to S&P(1.5 means 50% more)
PPG - price to earning to growth
open up the definitions if you dont answer in the website.

insider trading- legal stuff--shows you the buyer and sellers that are director.big stock move

play with real stocks.dont go for small penny.100$ buys alot of small

stocks.Price 15$-80$
pick the stock with an average volume of 1Million
average trading range:atleast 1$ movement but less that 8%
go to the industy you know about. so when you see the news you know whats going on.

to loose professionaly:
analyze, once you open a trade, only do risk management
be systematic, do not let your emotions change your trading behavior. follow plan and rules.

if there is a significant spread from the buying and selling(Buy:30 - Sell 35).
we sell short at 35 and buy at 30. we gain 5$. we should look at the number of stocks available also.


bid=buy
ask=offer=sell
Take the offer (lift the offer from ask) = Hit the Bid(selling to willing buyer)
demand=support=buyer=bid
supply=resistance=seller=ask

In Level 2
GO short if the number of sell is higher than buy
Go Long if the number of buyer is higher than seller

Look at the economy,then the market then the sector then the stock.
if economy is high, then market is good, and a sector will boom so the stocks should look good.

Know your tool and how to use it.(trading execution)
a float is whats left of the stock. big names always have floats. so you cant

short if the float is low.you cant short if your brokerage doesnt have inventory in a bull market things go down twice as much is it goes up. sell short in a bull market when its up incase it does down.

you can only short on an upstick waiting costs money.sell if you have stocks

10 laws of day trading:

Use Small Shares (dont take large risks until you build a buffer)
When in doubt, get out! (if it doesnt behave like expected, GET OUT)
Learn the difference between gambling and day trading (no overnites)
Dont add to losers(average UP, add to winning position)
dont overtrade (trade more only as you get experience and only if winning,not opposite)9-11.215-330/time
You must use stop loss points
Have a daily limit loss ( 1 to 2% risk capital) capital 25000$ = 250$-500$ limit
be logical not emotional ( control your temper)
dont trade if there are computer problems or slow quotes from the market
be disciplined (hearing is one thing,doing is something else)

OLD KOREAN TRADING PRINCIPLE
Dont lose money, if you do lose money, lose very little money

Monday, August 6, 2012

Summary Book 1 - Chapter 6: Optimizing Parameters and Filtering Trading Signals

Quantitative trading strategies harnessing the power of quantitative techniques to create a winning trading program:


Optimization allows the trader to fine tune a strategy. however many believe fitting strategies to past data yields unrealistic expectations.

parameters are tweaked once a successful strategy is found. ex. Length of the moving average, the volatility multiplier.

to simplify the number of parameters we can use more than one unit per test. for example increment by five insread of one.

optimization is a technique to maximize the expected value of a trading strategy.

The first would use parameters for the current period that had performed best in the prior period. The idea behind this strategy is that strings of past performance are likely to continue, and that as traders we want to stay with parameter sets that are performing the best. The second test selected parameter sets for the current period that performed the worst in the prior period. The idea behind this strategy is that performance is likely to mean revert over time. Parameter sets that have been “cold” and performing poorly are likely to revert and perform well in the future.

avoid trend-following signals when futures are caught in trading ranges but to take trend-following signals when stocks are in trading ranges.

based on the ADX indicator we can select a specific strategy
ADX<15 RSI osscillator
ADX>25 Channel Breakout

Positive autocorrelation exists when greater than average values tend to lead to greater than average values in the next period, and vice versa. Negative autocorrelation exists when greater than average values lead to less than average values.

markets trend roughly 60 percent of the time. The fact that the average falls greater than 50 percent suggests that markets do in fact trend, and we can apply trend-following strategies to exploit this inefficiency.



Summary Book 1 - Chapter 5 - Performance of Portfolios

Quantitative trading strategies harnessing the power of quantitative techniques to create a winning trading program:
 
DON’T PUT ALL YOUR EGGS IN ONE BASKET
Employed by Casino and betting houses for thousands of years.

diversification is spreading your money in a variety of investments.its a risk management strategy

goal help protect the overall value of the portfolio against loss.

Investment that gain value could potentially compensate for those that lose value.

NOTE: diversification only helps when combining non-correlated returns.

Diversification is based on mathematical principles—its advantages are not subject to debate.

Several Diversification Strategies:
Trade ACROSS MARKETS
    Oil, Forex, Sugar Market
Trade ACROSS UNCORRELATED STRATEGIES
    Moving Average, Channel Breakout
Trade ACROSS PARAMETERS WITHIN STRATEGIES
    20/40 of Channel breakout and 40/80 of channel breakout

There is not holy grail. because performance DECAYs over time to zero profitability.