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.

sendOrderQuickFIX(signal)
function sendOrderQuickFIX(signal)
%%SENDORDERQUICKFIX submits an order to Banzai application
global banzai
% Copyright 2010-2012, The MathWorks, Inc.

%% Load in the relevant pacakages
import quickfix.*
import quickfix.examples.banzai.*
import quickfix.examples.banzai.ui.*

%% Start or connect to Banzai
if isempty(banzai)
    startBanzai('banzai.cfg');
    pause(5);
end
%% Create order object
o = Order;
FIX = banzai.initiator.getSessions;
o.setSessionID(FIX.get(2));
o.setSymbol('MW');
o.setQuantity(100);
o.setOpen(o.getQuantity)

if signal > 0
    o.setSide(OrderSide.parse('Buy'));
else
    o.setSide(OrderSide.parse('Sell'));
end

banzai.orderTable.addOrder(o)
banzai.application.send(o);






Contact us