This commit is contained in:
Conner Fromknecht
2017-06-21 11:43:52 -07:00
+2 -9
View File
@@ -100,15 +100,9 @@ def rebalance(context, data):
if data.can_trade(context.asset):
# adjust portfolio based on moving averages
if short_mavg > long_mavg:
order_target_percent(
context.asset,
TARGET_INVESTMENT_RATIO,
)
order_target_percent(context.asset, TARGET_INVESTMENT_RATIO)
elif short_mavg < long_mavg:
order_target_percent(
context.asset,
0.0,
)
order_target_percent(context.asset, 0.0)
record(
USDT_BTC=price,
@@ -180,7 +174,6 @@ def analyze(context=None, results=None):
]].plot(ax=ax5)
ax5.set_ylabel('Dollars (USD)')
plt.legend(loc=3)
# Show the plot.