Skip to content

Commit 6b9625e

Browse files
Open TradingOpen Trading
authored andcommitted
Fixed broken url links
1 parent a35f7ae commit 6b9625e

30 files changed

Lines changed: 817 additions & 749 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ __pycache__/
44

55
# visual studio
66
*.sdf
7+
*.iss
8+
*.msys
9+
*.bat
710

811
# C extensions
912
*.so

CHANGELOG.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
commit a35f7ae4e728925084d5cc492104d7954a023e48
2+
Date: Sat Aug 22 06:32:15 2015 +0300
3+
4+
Github creole bugs workaround
5+
16
commit 3f198812d5d8f2fe9b0425d09369aa9de8bdf776
27
Date: Sat Aug 22 02:25:54 2015 +0300
38

OpenTrader/BacktestCmd.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def vDoBacktestCmd(self, oArgs, oOpts=None):
258258
#? rename delete
259259
_lCmds = ['dir', 'list', 'get', 'set',
260260
'read_mt4_csv', 'read_yahoo_csv', 'info', 'plot', 'to_hdf']
261-
assert len(lArgs) > 1, "ERROR: " +sDo +" " +str(_lCmds)
261+
assert len(lArgs) > 1, "ERROR: " +sDo +" command required: " +str(_lCmds)
262262
sCmd = lArgs[1]
263263
assert lArgs[1] in _lCmds, "ERROR: " +sDo +" " +str(_lCmds)
264264

@@ -351,6 +351,9 @@ def vDoBacktestCmd(self, oArgs, oOpts=None):
351351
return
352352

353353
# The following all require that a feed has been loaded
354+
if not sFEED_CACHE_KEY or sFEED_CACHE_KEY not in dFEED_CACHE:
355+
self.vError("Run \"back read_*\" first to read a DataFrame")
356+
return
354357
_dCurrentFeedFrame = dFEED_CACHE[sFEED_CACHE_KEY]
355358

356359
if _dCurrentFeedFrame is None:
@@ -405,11 +408,11 @@ def vDoBacktestCmd(self, oArgs, oOpts=None):
405408
# 'download_hst_zip'
406409
if sCmd == 'plot':
407410
import matplotlib
408-
import numpy as np
409-
from OTPpnAmgc import vGraphData
410411
if 'matplotlib.rcParams' in self.oConfig:
411412
for sKey, gVal in self.oConfig['matplotlib.rcParams'].items():
412413
matplotlib.rcParams[sKey] = gVal
414+
import numpy as np
415+
from OTPpnAmgc import vGraphData
413416

414417
from OTBackTest import oPreprocessOhlc
415418
mFeedOhlc = oPreprocessOhlc(mFeedOhlc)

OpenTrader/OTCmd2.ini

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,14 @@ iMacdEma = 9
9090
# axes.xmargin =
9191
# axes.ymargin =
9292
# axes3d.grid =
93-
# backend =
94-
# backend.qt4 =
95-
# backend_fallback =
93+
# valid strings are ['pdf', 'pgf', 'Qt4Agg', 'GTK', 'GTKAgg',
94+
# 'ps', 'agg', 'cairo', 'MacOSX', 'GTKCairo', 'WXAgg',
95+
# 'TkAgg', 'GTK3Cairo', 'GTK3Agg', 'svg',
96+
# 'WebAgg', 'CocoaAgg', 'emf', 'gdk', 'WX']
97+
# we freeze support for: 'Qt4Agg', 'TkAgg', 'WX', 'WXAgg', 'agg',
98+
backend = 'Qt4Agg'
99+
backend.qt4 = 'PyQt4'
100+
backend_fallback = 'TkAgg'
96101
# contour.negative_linestyle =
97102
# datapath =
98103
# docstring.hardcopy =

OpenTrader/OTCmd2.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,17 @@
169169
import time
170170
import unittest
171171

172-
try:
173-
import OpenTrader
174-
except ImportError:
175-
# support running from source
176-
sDIR = os.path.dirname(os.path.dirname(__file__))
177-
if sDIR not in sys.path:
178-
sys.path.insert(0, sDIR)
179-
del sDIR
172+
if hasattr(sys, 'frozen') and sys.frozen:
173+
__file__ = sys.executable
174+
else:
175+
try:
176+
import OpenTrader
177+
except ImportError:
178+
# support running from source
179+
sDIR = os.path.dirname(os.path.dirname(__file__))
180+
if sDIR not in sys.path:
181+
sys.path.insert(0, sDIR)
182+
del sDIR
180183
from OpenTrader.cmd2plus import Cmd, options, make_option, Cmd2TestCase
181184

182185
try:

OpenTrader/OTPpnAmgc.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@
2020
from collections import OrderedDict
2121
import numpy as np
2222
import matplotlib
23+
# Problems when frozen: only matplotlib.backends._backend_agg.pyd is bundled
24+
25+
# File "OpenTrader\OTPpnAmgc.py", line 23, in <module>
26+
# File "c:\Python27\lib\site-packages\matplotlib\pyplot.py", line 98, in <module
27+
# >
28+
# _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
29+
#
30+
# File "c:\Python27\lib\site-packages\matplotlib\backends\__init__.py", line 28,
31+
# in pylab_setup
32+
# globals(),locals(),[backend_name],0)
33+
# ImportError: No module named backend_qt4agg
2334
import matplotlib.pyplot as plt
2435
import matplotlib.ticker as mticker
2536
from matplotlib.finance import candlestick

README.creole

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@ This ia a work in progress but it has quite a lot in there already:
1919
better MQL4 trading library (https://github.com/OpenTrading/OTMql4Lib),
2020
* there's a backtester for trading recipes based on
2121
pybacktest (https://github.com/ematvey/pybacktest/),
22-
using pandas with TaLib (https://github.com/OpenTrading/wiki/TaLib),
22+
using pandas with TaLib (https://github.com/OpenTrading/OpenTrader/wiki/TaLib),
2323
so it's quite fast.
2424
* reads CSV history files and treats everything internally in
2525
pandas DataFrames or Series,
2626
* there's simple plotting of the CSV files and results using
2727
matplotlib (http://matplotlib.org),
2828
* you can save recipes and backtest results as an HDF5 file,
29-
viewable by ViTables (https://github.com/OpenTrading/wiki/ViTables)
29+
viewable by ViTables (https://github.com/OpenTrading/OpenTrader/wiki/ViTables)
3030
* if you have pyrabbit (http://pypi.python.org/packages/source/p/pyrabbit)
3131
installed, you can query the AMQP server.
3232
3333
Coming **Real Soon Now(TM)** is:
3434
* wiring up the backtester so that it should soon support Recipes for
3535
live-trading on Metatrader from Recipes and Chefs.
3636
* there's an optimizer in the backtester, but it's not yet wired up.
37-
For our future directions, see the RoadMap (https://github.com/OpenTrading/wiki/RoadMap) .
37+
For our future directions, see the RoadMap (https://github.com/OpenTrading/OpenTrader/wiki/RoadMap) .
3838
3939
=== Messaging Protocols
4040

share/doc/07Tests.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
# These tests will only work if you have pybacktest installed:
2-
# https://github.com/ematvey/pybacktest
3-
# You dont need to have a listener thread running
4-
set echo True
5-
# read a CSV file from Mt4
6-
back feed read_mt4_csv tmp/EURUSD60-2014.csv EURUSD 60 2014
7-
# list the feeds we have read
8-
back feed list
9-
py assert len(self._G) > 0
10-
# get the key name of the current feed
11-
back feed get
12-
# set the current recipe
13-
back recipe set SMARecipe
14-
# show the current recipe config
15-
back recipe config
16-
# list the known chefs
17-
back chef list
18-
# show the current chef
19-
back chef set
20-
# set the current chef
21-
back chef set PybacktestChef
22-
# make the ingredients
23-
back recipe ingredients
24-
# cook the recipe by the chef
25-
back chef cook
26-
# This should be done in this order
27-
back servings list
28-
back servings signals
29-
back servings trades
30-
back servings positions
31-
back servings equity
32-
back servings trade_price
33-
back servings reviews
34-
# FixMe: cant test tabview
35-
exit
1+
# These tests will only work if you have pybacktest installed:
2+
# https://github.com/ematvey/pybacktest
3+
# You dont need to have a listener thread running
4+
set echo True
5+
# read a CSV file from Mt4
6+
back feed read_mt4_csv tmp/EURUSD60-2014.csv EURUSD 60 2014
7+
# list the feeds we have read
8+
back feed list
9+
py assert len(self._G) > 0
10+
# get the key name of the current feed
11+
back feed get
12+
# set the current recipe
13+
back recipe set SMARecipe
14+
# show the current recipe config
15+
back recipe config
16+
# list the known chefs
17+
back chef list
18+
# show the current chef
19+
back chef set
20+
# set the current chef
21+
back chef set PybacktestChef
22+
# make the ingredients
23+
back recipe ingredients
24+
# cook the recipe by the chef
25+
back chef cook
26+
# This should be done in this order
27+
back servings list
28+
back servings signals
29+
back servings trades
30+
back servings positions
31+
back servings equity
32+
back servings trade_price
33+
back servings reviews
34+
# FixMe: cant test tabview
35+
exit
Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
# These tests will only work if you have pybacktest installed:
2-
# https://github.com/ematvey/pybacktest
3-
# You dont need to have a listener thread running
4-
set echo True
5-
# read a CSV file from Mt4
6-
back feed read_mt4_csv tmp/EURUSD60-2014.csv EURUSD 60 2014
7-
# list the feeds we have read
8-
back feed list
9-
# get the key name of the current feed
10-
back feed get
11-
# set the current recipe
12-
back recipe set SMARecipe
13-
# show the current recipe config
14-
back recipe config
15-
# list the known chefs
16-
back chef list
17-
# show the current chef
18-
back chef set
19-
# set the current chef
20-
back chef set PybacktestChef
21-
# make the ingredients
22-
back recipe ingredients
23-
# cook the recipe by the chef
24-
back chef cook
25-
# This should be done in this order
26-
back servings list
27-
back servings signals
28-
back servings trades
29-
back servings positions
30-
back servings equity
31-
back servings trade_price
32-
back servings reviews
33-
# FixMe: cant test tabview
34-
back plot trades
35-
back plot equity
36-
exit
1+
# These tests will only work if you have pybacktest installed:
2+
# https://github.com/ematvey/pybacktest
3+
# You dont need to have a listener thread running
4+
set echo True
5+
# read a CSV file from Mt4
6+
back feed read_mt4_csv tmp/EURUSD60-2014.csv EURUSD 60 2014
7+
# list the feeds we have read
8+
back feed list
9+
# get the key name of the current feed
10+
back feed get
11+
# set the current recipe
12+
back recipe set SMARecipe
13+
# show the current recipe config
14+
back recipe config
15+
# list the known chefs
16+
back chef list
17+
# show the current chef
18+
back chef set
19+
# set the current chef
20+
back chef set PybacktestChef
21+
# make the ingredients
22+
back recipe ingredients
23+
# cook the recipe by the chef
24+
back chef cook
25+
# This should be done in this order
26+
back servings list
27+
back servings signals
28+
back servings trades
29+
back servings positions
30+
back servings equity
31+
back servings trade_price
32+
back servings reviews
33+
# FixMe: cant test tabview
34+
back plot trades
35+
back plot equity
36+
exit

0 commit comments

Comments
 (0)