BUG: fixed some issues with capital_base

This commit is contained in:
fredfortier
2017-12-08 20:29:55 -05:00
parent 48f4d01c70
commit e41eca0d8a
6 changed files with 123 additions and 92 deletions
+3 -3
View File
@@ -34,7 +34,7 @@ def initialize(context):
# parameters or values you're going to use.
# In our example, we're looking at Neo in Ether.
context.market = symbol('rdn_eth')
context.market = symbol('neo_eth')
context.base_price = None
context.current_day = None
@@ -240,7 +240,7 @@ def analyze(context=None, perf=None):
if __name__ == '__main__':
# The execution mode: backtest or live
MODE = 'live'
MODE = 'backtest'
if MODE == 'backtest':
folder = os.path.join(
@@ -259,7 +259,7 @@ if __name__ == '__main__':
initialize=initialize,
handle_data=handle_data,
analyze=analyze,
exchange_name='bittrex',
exchange_name='bitfinex',
algo_namespace=NAMESPACE,
base_currency='eth',
start=pd.to_datetime('2017-10-01', utc=True),
+2 -2
View File
@@ -109,9 +109,9 @@ def analyze(context, perf):
run_algorithm(
capital_base=250,
start=pd.to_datetime('2017-11-1 0:00', utc=True),
start=pd.to_datetime('2017-11-9 0:00', utc=True),
end=pd.to_datetime('2017-11-10 23:59', utc=True),
data_frequency='daily',
data_frequency='minute',
initialize=initialize,
handle_data=handle_data,
analyze=analyze,