Merge pull request #148 from treethought/tutorial-fixes

DOC: fix import and support python3 for beginner tutorial
This commit is contained in:
Victor
2018-01-12 14:03:03 -07:00
committed by GitHub
2 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -84,7 +84,8 @@ def handle_data(context, data):
def analyze(context, perf):
# Get the base_currency that was passed as a parameter to the simulation
base_currency = list(context.exchanges.values())[0].base_currency.upper()
exchange = list(context.exchanges.values())[0]
base_currency = exchange.base_currency.upper()
# First chart: Plot portfolio value using base_currency
ax1 = plt.subplot(411)
+3 -2
View File
@@ -589,7 +589,7 @@ the ``examples`` directory:
from catalyst import run_algorithm
from catalyst.api import (order, record, symbol, order_target_percent,
get_open_orders)
from catalyst.exchange.stats_utils import extract_transactions
from catalyst.exchange.utils.stats_utils import extract_transactions
NAMESPACE = 'dual_moving_average'
log = Logger(NAMESPACE)
@@ -660,7 +660,8 @@ the ``examples`` directory:
def analyze(context, perf):
# Get the base_currency that was passed as a parameter to the simulation
base_currency = context.exchanges.values()[0].base_currency.upper()
exchange = list(context.exchanges.values())[0]
base_currency = exchange.base_currency.upper()
# First chart: Plot portfolio value using base_currency
ax1 = plt.subplot(411)