Code covered by the BSD License  

Highlights from
Trading strategy back tester

image thumbnail

Trading strategy back tester

by

 

09 Mar 2011 (Updated )

This program shows the profit and lost of using different trading strategies on Singapore stocks.

min2time(time,add)
% Function to add minutes to a time.
% To facilitate calculations with the one minute data.

function restime = min2time(time,add)

clear resttime;
% First convert time to minutes.
hr = time - rem(time,100);

min = rem(time, 100);

resmin = (hr / 100) * 60 + min;
restime = resmin + add;

% Convert back to 24-hour clock format.

restime = (floor (restime/60)) * 100 + rem(restime,60);


end

Contact us