Code covered by the BSD License  

Highlights from
Automated Trading with MATLAB - 2012

image thumbnail

Automated Trading with MATLAB - 2012


Stuart Kozola (view profile)


31 Aug 2012 (Updated )

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

function out = generateTradeSignal(signalData)
% GENERATETRADESIGNAL produces a buy/sell signal depending using parameters
% defined through backtesting.

% Copyright 2010-2012, The MathWorks, Inc.

% Load parameters from backtesting
productionParams = load('productionParams.mat');

% Use trading algorithms with the new data to generate signals
sma = leadlag(signalData(:,end),productionParams.N,productionParams.M,productionParams.annualScaling,productionParams.cost);
srs = rsi(signalData(:,end),[productionParams.P productionParams.Q],productionParams.thresh,productionParams.annualScaling,productionParams.cost);
swr = wpr(signalData,productionParams.param,productionParams.annualScaling,productionParams.cost);
signals = [sma(end) srs(end) swr(end)];

% Use the bitstring with our signal to determine the buy/sell signal from
% this data
out = tradeSignal(,signals);

Contact us