Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions tradervue/tradervue.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
#
# Copyright (c) 2015, Jon Nall
# All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
#
# * Neither the name of tradervue-utils nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Expand Down Expand Up @@ -88,7 +88,7 @@ class Tradervue:
"""
MAX_ALLOWED_OBJECT_REQUEST = 500

def __init__(self, username, password, user_agent, target_user = None, baseurl = 'https://www.tradervue.com', verbose_http = False):
def __init__(self, username, password, user_agent, target_user = None, baseurl = 'https://app.tradervue.com', verbose_http = False):
"""Construct a Tradervue instance.

:param str username: the Tradervue username
Expand Down Expand Up @@ -164,7 +164,7 @@ def __handle_bad_http_response(self, r, msg, show_url = False):
server_error = r.text
except ValueError as e:
server_error = r.text

self.log.error(msg)
self.log.error(status)
self.log.error("Server error: %s" % (server_error))
Expand Down Expand Up @@ -341,7 +341,7 @@ def delete_trade(self, trade_id):
def get_trades(self, symbol = None, tag_expr = None, side = None, duration = None, startdate = None, enddate = None, winners = None, include_comments = False, include_executions = False, max_trades = 25, offset = 0):
"""Query for trades matching the specified criteria.

All arguments to this method are optional. If not specified, they are not part of the query.
All arguments to this method are optional. If not specified, they are not part of the query.

The list returned from this method contains dict objects which have fields as defined in the `Tradervue Trade Documentation <https://github.com/tradervue/api-docs/blob/master/trades.md>`_.

Expand Down Expand Up @@ -468,7 +468,7 @@ def import_status(self):
result = self.__get_object('imports', None, None)
if not 'status' in result:
self.log.error("Unable to find 'status' key in result: %s" % (result))
return None
return None
elif not result['status'] in ['ready', 'queued', 'processing', 'succeeded', 'failed' ]:
self.log.error("Unexpected status '%s' for import status. Check API and update library. Result = %s" % (status, result))
return None
Expand Down Expand Up @@ -500,7 +500,7 @@ def import_executions(self, executions, account_tag = None, tags = None, allow_d
if tags is not None:
if not isinstance(tags, list):
raise TypeError("The tags argument (if specified) to import_executions must be a list, but found %s" % (type(tags)))

data = { 'executions': copy.deepcopy(executions), 'allow_duplicates': allow_duplicates, 'overlay_commissions': overlay_commissions }

# TV doesn't automatically add the account_tag. It must be explicitly added to the tags list
Expand Down Expand Up @@ -540,7 +540,7 @@ def __import_executions(self, data, import_retries, wait_for_completion, wait_re

if not import_posted:
self.log.error("Unable to import executions after %d attempts. Giving up." % (import_retries))
return False
return False
elif wait_for_completion:
self.log.debug("Waiting for import to complete...")

Expand Down Expand Up @@ -649,7 +649,7 @@ def create_user(self, username, email, plan, password, trial_end = None, return_
def get_journals(self, date = None, startdate = None, enddate = None, include_comments = False, max_journals = 25, offset = 0):
"""Query for journal entries matching the specified criteria.

All arguments to this method are optional. If not specified, they are not part of the query.
All arguments to this method are optional. If not specified, they are not part of the query.

The list returned from this method contains dict objects which have fields as defined in the `Tradervue Journal Documentation <https://github.com/tradervue/api-docs/blob/master/journal.md>`_.

Expand Down