0% found this document useful (0 votes)
248 views

Technical Analysis Using MATLAB Using Financial Time Series v3

This document provides an overview of using MATLAB for technical analysis of financial time series data. It discusses importing stock price data from CSV files and other formats into MATLAB, then performing analyses like moving averages and Bollinger Bands on the time series data. The document also briefly mentions candlestick chart patterns, matrix operations, and 3D visualizations that can be done with the data.

Uploaded by

Shivgan Joshi
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
248 views

Technical Analysis Using MATLAB Using Financial Time Series v3

This document provides an overview of using MATLAB for technical analysis of financial time series data. It discusses importing stock price data from CSV files and other formats into MATLAB, then performing analyses like moving averages and Bollinger Bands on the time series data. The document also briefly mentions candlestick chart patterns, matrix operations, and 3D visualizations that can be done with the data.

Uploaded by

Shivgan Joshi
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Technical Analysis using MATLAB

using Financial Time Series


Focus on Moving average and
Bollinger Bands
By Shivgan Joshi
Qcfinance.in

Caution
MATLAB is case sensitive

Difference formats to get data in the FTS


Object
1. From CSV
2. From file directly
3. From the .dat file
. Using ascii2fints carefully by specifying the right
parameters

Input CSV Method 1


filename = 'csvlist.dat'; M = csvread(filename)
Make sure it is numeric format
Then create fts object from matrices

http://in.mathworks.com/help/matlab/ref/csvr
ead.html

Inputting Data
.dat are tab delimited data which can be saved using
excel txt save
myinc = ascii2fts('input.dat');
An alternative is the load command to bring all
variables from a file into the current variables
ASCII2FTS is an important conversion function
http://in.mathworks.com/help/finance/ascii2fts.ht
ml
http://in.mathworks.com/help/finance/technical-an

Code Part 1
Use GUI to import the FTS

Things work with the close price so all other


prices dont matter
macd_input = macd(input);

Code for Moving average of the data


subplot(2, 1, 1);
plot(macd_input);
title('MACD of Input Close Stock Prices,
10/01/95-12/31/95');
datetick('x', 'mm/dd/yy');
subplot(2, 1, 2);
highlow(part_input);
title('IBM Stock Prices, 10/01/95-12/31/95');
datetick('x', 'mm/dd/yy')

Bollinger Band on the Data


[input_Mid,input_Uppr,input_Lowr]=
bollinger(myinc);
input_CloseBolling = [input_Mid.CLOSE,
input_Uppr.CLOSE,...
input_Lowr.CLOSE];
plot(input_CloseBolling)
title('Bollinger Bands for inputney Closing
Prices')

Cleaning and Exporting Data


Count rows and columns of matrix
[rows columns] = size(input)
for a = 1:rows
Input(a,2)
end
if input(2,a)>100
disp('Value within specified range.')
end

csvwrite('csvlist.dat',input)
http://in.mathworks.com/help/matlab/ref/if.html

Saving output

http://in.mathworks.com/help/matlab/ref/csvw
rite.html

Playing with matrix


Logic including count, for and if to extract the
data

[input_Mid,input_Uppr,input_Lowr]=
bollinger(candle);
tsmat = fts2mat(tsobj)

Tasks
candle excel sheet
Bollinger code
3d plotting

Candle Sticks

Body nature
DOJI
HAMMER
HANGING MAN
Inverted Hammer
Shooting star

http://in.mathworks.com/help/finance/candle.
html;jsessionid=12076760ee3791f11ef00890ed8e

Matrix of Strings in MATLAB


http://stackoverflow.com/questions/15643119/
how-can-i-fill-a-matrix-dynamically-withstrings-in-matlab

3D Charts

Heatmaps and 3D charts


Charting fundamentals
Matrix format
http://in.mathworks.com/help/bioinfo/ref/hea
tmap.html
http://in.mathworks.com/help/bioinfo/ref/data
matrix.html

Revising Financial Toolbox

PV FV
Portfolio Toolboxx
Regression
Fixed income standards

Mesh

You might also like