-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathGalp.m
More file actions
71 lines (63 loc) · 2.41 KB
/
Copy pathGalp.m
File metadata and controls
71 lines (63 loc) · 2.41 KB
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
62
63
64
65
66
67
68
69
70
71
%% Main file for the Generic Algo Platform (Galp)
classdef Galp
methods (Static)
% optionalFileName should be something like 'xxx.mat'
function start(optionalFileName)
persistent runningFlag;
if isempty(runningFlag)
Galp_setup;
runningFlag = 1;
else
disp('Galp is already running!');
end
if nargin > 0 % If we are given a saved file name...
contextSingleton = EventContext.getInstance;
contextSingleton.mySaveLoadManager.loadPositions(optionalFileName);
end
GeneralUtils.logWrapper('Platform started.');
end
function download()
Galp_datacentre;
end
function pause()
contextSingleton = EventContext.getInstance;
contextSingleton.myStrategyManager.turnOnOffAllStrats(0);
GeneralUtils.logWrapper('Trading paused.');
end
function resume()
contextSingleton = EventContext.getInstance;
contextSingleton.myStrategyManager.turnOnOffAllStrats(1);
GeneralUtils.logWrapper('Trading resumed.');
end
function liquidateAll()
contextSingleton = EventContext.getInstance;
contextSingleton.myPortfolioManager.liqAll;
end
function verStr = version()
verStr = 'Galp 3.1, September 2016';
disp(verStr);
end
function stop()
delete(timerfind);
try
% Check if Galp is running by getting the EventContext
contextSingleton = EventContext.getInstance;
% Save before stopping
mySLMHandle = contextSingleton.mySaveLoadManager;
mySLMHandle.saveWorkspace;
GeneralUtils.logWrapper('Platform stopped.');
clear;
clear classes;
clc;
catch
return;
end
end
function report()
contextSingleton = EventContext.getInstance;
contextSingleton.myPortfolioManager.updateSecurityHoldings;
contextSingleton.myPortfolioManager.MTM;
disp(Courrier.MO2str);
end
end
end