-
Notifications
You must be signed in to change notification settings - Fork 2
/
marketmaking.m
61 lines (50 loc) · 1.91 KB
/
marketmaking.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
%Author: Steven Date: 20150214
function [ b,s ] = marketmaking( rit )
id = getOrders(rit);
if size(id,2)>2
rit.cancelOrder(id);
rit.clearQueuedOrders;
end
if rit.tigr_position > 0
sell(rit,'tigr',500);
elseif rit.tigr_position == 0
1;
else
buy(rit,'tigr',500);
end
if rit.eyor_position > 0
sell(rit,'eyor',500);
elseif rit.eyor_position == 0
1;
else
buy(rit,'eyor',500);
end
if rit.huny_position > 0
sell(rit,'huny',500);
elseif rit.huny_position == 0
1;
else
buy(rit,'huny',500);
end
if rit.pooh_position > 5000
s = limitOrder(rit, 'pooh', -600, rit.pooh_ask - 0.01);
b = limitOrder(rit, 'pooh', 400, rit.pooh_bid + 0.01);
s = limitOrder(rit, 'pooh', -1000, rit.pooh_ask - 0.02);
b = limitOrder(rit, 'pooh', 600, rit.pooh_bid + 0.02);
elseif rit.pooh_position > 0 && rit.pooh_position < 5000
s = limitOrder(rit, 'pooh', -600, rit.pooh_ask - 0.01);
b = limitOrder(rit, 'pooh', 600, rit.pooh_bid + 0.01);
s = limitOrder(rit, 'pooh', -1000, rit.pooh_ask - 0.02);
b = limitOrder(rit, 'pooh', 1000, rit.pooh_bid + 0.02);
elseif rit.pooh_position > -5000 && rit.pooh_position < 0
b = limitOrder(rit, 'pooh', 500, rit.pooh_bid + 0.01);
s = limitOrder(rit, 'pooh', -500, rit.pooh_ask - 0.01);
b = limitOrder(rit, 'pooh', 1000, rit.pooh_bid + 0.02);
s = limitOrder(rit, 'pooh', -1000, rit.pooh_ask - 0.02);
else
b = limitOrder(rit, 'pooh', 600, rit.pooh_bid + 0.01);
s = limitOrder(rit, 'pooh', -400, rit.pooh_ask - 0.01);
b = limitOrder(rit, 'pooh', 1000, rit.pooh_bid + 0.02);
s = limitOrder(rit, 'pooh', -600, rit.pooh_ask - 0.02);
end
end