Code covered by the BSD License  

Highlights from
Automated Trading with MATLAB - 2012

image thumbnail

Automated Trading with MATLAB - 2012

by

 

31 Aug 2012 (Updated )

Files from the Automated Trading webinar showing X_Trader and QuickFIX/J integration.

dsample(HLC, factor)
function out = dsample(HLC, factor)
% Downsamples our time series by a given factor, preserving the HIGH and
% LOW fields' definition.  The input HLC is a numTicks-by-3 matrix, where
% each column corresponds to high prices, low prices, and closing prices,
% respectively.

% Copyright 2010-2012, The MathWorks, Inc.

HLC(:,1) = hhigh(HLC(:,1), factor);
HLC(:,2) =  llow(HLC(:,2), factor);

out = HLC(1:factor:end,:);

Contact us