technical analysis using matlab using financial time series v3

20
Technical Analysis using MATLAB using Financial Time Series Focus on Moving average and Bollinger Bands By Shivgan Joshi Qcfinance.in

Upload: shivgan-joshi

Post on 28-Sep-2015

230 views

Category:

Documents


5 download

DESCRIPTION

File by Qcfinance.in

TRANSCRIPT

Technical Analysis using MATLAB using Financial Time Series

Technical Analysis using MATLAB using Financial Time SeriesFocus on Moving average and Bollinger BandsBy Shivgan JoshiQcfinance.inCautionMATLAB is case sensitive Difference formats to get data in the FTS ObjectFrom CSVFrom file directlyFrom the .dat fileUsing ascii2fints carefully by specifying the right parametersInput CSV Method 1filename = 'csvlist.dat'; M = csvread(filename)Make sure it is numeric formatThen create fts object from matrices

http://in.mathworks.com/help/matlab/ref/csvread.htmlInputting Data.dat are tab delimited data which can be saved using excel txt savemyinc = 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 functionhttp://in.mathworks.com/help/finance/ascii2fts.htmlhttp://in.mathworks.com/help/finance/technical-analysis-examples.html

Code Part 1Use GUI to import the FTS

Things work with the close price so all other prices dont mattermacd_input = macd(input);Code for Moving average of the datasubplot(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 DataCount rows and columns of matrix[rows columns] = size(input)

for a = 1:rowsInput(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 outputhttp://in.mathworks.com/help/matlab/ref/csvwrite.htmlPlaying 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 SticksBody natureDOJIHAMMERHANGING MANInverted HammerShooting star

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

Matrix of Strings in MATLABhttp://stackoverflow.com/questions/15643119/how-can-i-fill-a-matrix-dynamically-with-strings-in-matlab3D Charts Heatmaps and 3D charts Charting fundamentalsMatrix formathttp://in.mathworks.com/help/bioinfo/ref/heatmap.htmlhttp://in.mathworks.com/help/bioinfo/ref/datamatrix.html

Revising Financial ToolboxPV FVPortfolio ToolboxxRegressionFixed income standards

Mesh