DOC: fix import and support python3 for beginner tutorial

The beginner tutorial Dual Moving Average example attempted to import
extract_transactions from the wrong location.

The tutorial and corresponding example also would fail using python3
due to indexing the view object returned via context.exchange.values()
This commit is contained in:
Cam Sweeney
2018-01-09 18:25:59 -08:00
parent 790ac22f8d
commit 93ebbf8b1f
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 = 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)