10 |
11 |
12 |
13 |
Login My Strategy
14 |
15 |
16 |
23 |
24 | {% endblock %}
25 |
26 |
27 |
--------------------------------------------------------------------------------
/templates/new_strategy.html:
--------------------------------------------------------------------------------
1 | {% load staticfiles %}
2 |
3 |
4 |
5 |
ACE in Action
6 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
Strategy Editor
25 |
26 |
from qstrader.strategy.base import AbstractStrategy
27 |
28 | from qstrader.event import (SignalEvent, EventType)
29 |
30 |
31 | class CustomStrategy(AbstractStrategy):
32 | """
33 | A testing strategy that simply purchases (longs) a set of
34 | assets upon first receipt of the relevant bar event and
35 | then holds until the completion of a backtest.
36 | """
37 | def __init__(self, tickers, events_queue):
38 | self.tickers = tickers
39 | self.events_queue = events_queue
40 | self.ticks = 0
41 | self.invested = False
42 |
43 | def calculate_signals(self, event):
44 | ticker = self.tickers[0]
45 | if event.type in [EventType.BAR, EventType.TICK] and event.ticker == ticker:
46 | if not self.invested and self.ticks == 0:
47 | signal = SignalEvent(ticker, "BOT")
48 | self.events_queue.put(signal)
49 | self.invested = True
50 | self.ticks += 1
51 |
52 |
53 |
54 |
Position Editor
55 |
from qstrader.position_sizer.base import AbstractPositionSizer
56 |
57 |
58 | class CustomPositionSizer(AbstractPositionSizer):
59 | def __init__(self, default_quantity=100):
60 | self.default_quantity = default_quantity
61 |
62 | def size_order(self, portfolio, initial_order):
63 | """
64 | This FixedPositionSizer object simply modifies
65 | the quantity to be 100 of any share transacted.
66 | """
67 | initial_order.quantity = self.default_quantity
68 | return initial_order
69 |
70 |
71 |
72 |
73 | Select a begin date:
74 |
75 |
76 | Select a end date:
77 |
78 |
79 | Please input tickers:
80 |
81 |

Running the backtest,please waiting.
82 |
83 |
84 |
--------------------------------------------------------------------------------
/templates/running_jobs.html:
--------------------------------------------------------------------------------
1 |
2 | {% extends "base.html" %}
3 | {% block title %}分享日記{% endblock %}
4 | {% block content %}
5 |
6 | {% for message in messages %}
7 |
{{ message }}
8 | {% endfor %}
9 |
10 |
11 |
12 |
13 |
My Strategy
14 |
15 |
16 | {% load staticfiles %}
17 |
18 |
19 |
20 |
21 |
22 |
23 | NOW: {{today}}
24 |
25 |
26 |
27 |
47 |
48 |
49 | {% endblock %}
50 |
51 |
--------------------------------------------------------------------------------
/templates/strategy.html:
--------------------------------------------------------------------------------
1 |
2 | {% extends "base.html" %}
3 | {% block title %}分享日記{% endblock %}
4 | {% block content %}
5 |
6 | {% for message in messages %}
7 |
{{ message }}
8 | {% endfor %}
9 |
10 |
11 |
12 |
13 |
My Strategy
14 |
15 |
16 |
17 |
18 |
19 | {% for strategy in Strategies %}
20 |
21 |
22 |
{{strategy.strategy_name}}
23 |
24 | {% endfor %}
25 |
26 |
27 | {% endblock %}
28 |
29 |
--------------------------------------------------------------------------------
/templates/strategy_page.html:
--------------------------------------------------------------------------------
1 | {% load staticfiles %}
2 |
3 |
4 |
5 |
ACE in Action
6 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
Strategy Editor
27 |
{{strategy.strategy_name}}
28 |
{{strategy.strategy}}
29 |
30 |
31 |
32 |
33 |
Position Editor
34 |
{{strategy.position}}
35 |
36 |
37 |
38 |
39 | Select a begin date:
40 |
41 |
42 | Select a end date:
43 |
44 |
45 | Please input tickers:
46 |
47 |

Running the backtest,please waiting.
48 |
49 |
62 |
63 |
--------------------------------------------------------------------------------
/templates/strategy_run.html:
--------------------------------------------------------------------------------
1 |
2 | {% extends "base.html" %}
3 | {% block title %}分享日記{% endblock %}
4 | {% block content %}
5 |
6 | {% for message in messages %}
7 |
{{ message }}
8 | {% endfor %}
9 |
10 |
11 |
12 |
13 |
Strategy Report
14 |
15 |
16 | {% load staticfiles %}
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |

25 |
26 |
Output
27 |
28 |
29 | {{output|linebreaksbr}}
30 |
31 |
32 |
Error
33 |
34 | {{err|linebreaksbr}}
35 |
36 |
37 | {% endblock %}
38 |
39 |
--------------------------------------------------------------------------------
/website_backtest_result.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/easytrader/StrategyCeleryWebsite/08b75404b035f60e5b46be897a2e791afbd455d4/website_backtest_result.png
--------------------------------------------------------------------------------