mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-01 01:07:50 +08:00
Merge branch 'master' of https://github.com/enigmampc/catalyst
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user