Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
fredfortier
2017-10-25 19:44:05 -04:00
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -221,7 +221,7 @@ class PoloniexCurator(object):
df['date'] = pd.to_datetime(df['date'], infer_datetime_format=True)
ohlcv = self.generate_ohlcv(df)
try:
with open(csv_1min, 'ab') as csvfile:
with open(csv_1min, 'w') as csvfile:
csvwriter = csv.writer(csvfile)
for item in ohlcv.itertuples():
if item.Index == 0:
+4 -4
View File
@@ -24,7 +24,7 @@ from catalyst.api import (
)
def initialize(context):
context.ASSET_NAME = 'USDT_BTC'
context.ASSET_NAME = 'BTC_USDT'
context.TARGET_HODL_RATIO = 0.8
context.RESERVE_RATIO = 1.0 - context.TARGET_HODL_RATIO
@@ -49,14 +49,14 @@ def handle_data(context, data):
orders = get_open_orders(context.asset) or []
for order in orders:
cancel_order(order)
# Stop buying after passing the reserve threshold
cash = context.portfolio.cash
if cash <= reserve_value:
context.is_buying = False
# Retrieve current asset price from pricing data
price = data[context.asset].price
price = data.current(context.asset, 'price')
# Check if still buying and could (approximately) afford another purchase
if context.is_buying and cash > price:
@@ -70,7 +70,7 @@ def handle_data(context, data):
record(
price=price,
volume=data[context.asset].volume,
volume=data.current(context.asset, 'volume'),
cash=cash,
starting_cash=context.portfolio.starting_cash,
leverage=context.account.leverage,
+1 -1
View File
@@ -27,7 +27,7 @@ log = Logger(algo_namespace)
def initialize(context):
log.info('initializing algo')
context.ASSET_NAME = 'XRP_USD'
context.ASSET_NAME = 'XRP_USDT'
context.asset = symbol(context.ASSET_NAME)
context.TARGET_POSITIONS = 5000