Commit Graph

2109 Commits

Author SHA1 Message Date
creslinux
95ba016558 rpc.py
Added RPCExcpetion if trades is empty on trade.query

api_server
Return e on exception created server 500 error.
Returned text for client, and sent e to logger

Added profit and status table functions.

Will look to add unit tests for these two
2018-06-25 19:55:28 +00:00
creslinux
63c16b7f83 Moved routes that do not need access to rpc.rpc self into their own
common file.

This is to reduce file size and separate api server routes with
privilege to access rpc.rpc defs and those that do not need access,
so should not.
2018-06-25 14:03:34 +00:00
creslinux
0b061fda97 removed change to cleanup() in api_server.py 2018-06-25 14:03:34 +00:00
creslinux
60b24a8aa7 Added api server shutdown function, and exposed on HTTP as /stop_api url
This will stop the running app gracefully - processing current api calls
then shutting the werkzueg (run) listening server.

Have also called this from the cleanup placeholder.
I'm not sure this is what is intended by cleanup def.
By which I mean there may be a thread left running with no app within -
not sure how to check this just yet.

tidied excessive logging.
2018-06-25 14:03:34 +00:00
creslinux
ab2cf1bbfe Added api server shutdown function, and exposed on HTTP as /stop_api url
This will stop the running app gracefully - processing current api calls
then shutting the werkzueg (run) listening server.

Have also called this from the cleanup placeholder.
I'm not sure this is what is intended by cleanup def.
By which I mean there may be a thread left running with no app within -
not sure how to check this just yet.

tidied excessive logging.
2018-06-25 14:03:34 +00:00
creslinux
dc1aebf391 Updated def comments to be __docstring__ compatible 2018-06-25 14:03:34 +00:00
creslinux
2ac6a225be flake 8 fix 2018-06-25 14:03:34 +00:00
creslinux
f590f514f3 moved default page "/" index into self_register_other()
out of the block of URLs that call rpc.rcp functionality.
2018-06-25 14:03:34 +00:00
creslinux
ce251a965e Moved registering application urls out of the run def
and into their own

Added 404 handling

Split registration of URLs that use rpc.rpc and others into
own def. Seems logical to be able to register separately for later use.
2018-06-25 14:03:34 +00:00
gcarq
4abfcd2462 remove _rpc_status_table and reuse _rpc_status instead 2018-06-25 14:03:31 +00:00
gcarq
a92f0c2125 api_server: fix flake8 warnings and implement missing methods 2018-06-25 14:03:28 +00:00
gcarq
2df0377832 refactor _rpc_balance 2018-06-25 14:03:28 +00:00
gcarq
37c70d2d3e return dict from _rpc_status and handle rendering in module impl 2018-06-25 14:03:28 +00:00
gcarq
62afba1beb remove markdown formatting from exception string 2018-06-25 14:03:25 +00:00
gcarq
913cb80a33 convert start, stop and reload_conf to return a dict 2018-06-25 14:03:25 +00:00
gcarq
446c621006 move endpoint definitions to class scope 2018-06-25 14:03:25 +00:00
gcarq
75de61843b fix flake8 warnings 2018-06-25 14:03:22 +00:00
creslinux
d7dfa00cb3 Moved from decorators to app.add_url_rule
This has the benefit of creating a label which may be helpful if later
refactoring.

This change misses the main thrust of requests from both Gcarq and Shusso to
better layout the code

Im running into a challenge with 'self' not being available, or able to be
passed in either to decorators or view_func

This may simply be how I've instantiated an RPC in the wuperwrap or im within a thread
 - my very limited exposure to programming is at play! After moving code around
 lots of ways to no success and google not being helpful im committing for further feeback
2018-06-25 14:03:22 +00:00
creslinux
9aa08ec3c1 Added json validation of formats to check IPv4
refactored files and calls to be api_server
worked down satisfying review comments of last commit
2018-06-25 14:03:22 +00:00
creslinux
b101a2608a Updated
Stop and start calls added
Along with refactoring to base line and use decorators.
Also modules loaded optionally if enabled in config or not
binds to ip / port set from config.json with warning if not localhost

TODO:
 - use argparse in client, and generally clean client up
 - create unit test
 - documentation
 - extend to other RCP commands, after feedback
2018-06-25 14:03:17 +00:00
creslinux
cbfa9e8355 Updated
Stop and start calls added
Along with refactoring to base line and use decorators.
Also modules loaded optionally if enabled in config or not
binds to ip / port set from config.json with warning if not localhost

TODO:
 - use argparse in client, and generally clean client up
 - create unit test
 - documentation
 - extend to other RCP commands, after feedback
2018-06-25 14:03:17 +00:00
creslin
6cd4414874 Update rest_client.py 2018-06-25 14:03:15 +00:00
creslinux
ec252ff774 Implemented local restful flask service and provided cmdline client
Added only the "Daily" call so far, submitting for early review/feedback

Called as example "./rest_client.py daily 3"

This depends on listed as requirements.
Flask==1.0.2
flask-jsonpify==1.5.0 (will do later)
flask-restful==0.3.6
TODO: make loading optional, cleanly unload on close
      unit tests, take feedback, tidy output,
      add other Telegram functions, onwards

local rest server is enabled/disabled from within config.json. E.g

     "localrest": {
        "enabled": true
    },

The server is enabled from within existing rpc manager
and makes use of the existing superclass (RPC)

Through making use of the existing hard work done in rpc.py
It *should be easy to add the other Telegram calls into local_rpc_server.py

The server is wrapped in a thread to be non-blocking
The server and client accept serialised calls or not, used in daily to return json
The client can be used from command line or in a python client script

As example, from cmdline for last 3 days Daily

DannyMBP:rpc creslin$ ./rest_client.py daily 3
[
    [
        "2018-06-13",
        "0.00000000 USDT",
        "0.000 USD",
        "0 trade"
    ],
    [
        "2018-06-12",
        "0.00000000 USDT",
        "0.000 USD",
        "0 trade"
    ],
    [
        "2018-06-11",
        "0.00000000 USDT",
        "0.000 USD",
        "0 trade"
    ]
]
2018-06-25 14:03:15 +00:00
creslinux
dcbdbecae0 Implemented local restful flask service and provided cmdline client
Added only the "Daily" call so far, submitting for early review/feedback

Called as example "./rest_client.py daily 3"

This depends on listed as requirements.
Flask==1.0.2
flask-jsonpify==1.5.0 (will do later)
flask-restful==0.3.6
TODO: make loading optional, cleanly unload on close
      unit tests, take feedback, tidy output,
      add other Telegram functions, onwards

local rest server is enabled/disabled from within config.json. E.g

     "localrest": {
        "enabled": true
    },

The server is enabled from within existing rpc manager
and makes use of the existing superclass (RPC)

Through making use of the existing hard work done in rpc.py
It *should be easy to add the other Telegram calls into local_rpc_server.py

The server is wrapped in a thread to be non-blocking
The server and client accept serialised calls or not, used in daily to return json
The client can be used from command line or in a python client script

As example, from cmdline for last 3 days Daily

DannyMBP:rpc creslin$ ./rest_client.py daily 3
[
    [
        "2018-06-13",
        "0.00000000 USDT",
        "0.000 USD",
        "0 trade"
    ],
    [
        "2018-06-12",
        "0.00000000 USDT",
        "0.000 USD",
        "0 trade"
    ],
    [
        "2018-06-11",
        "0.00000000 USDT",
        "0.000 USD",
        "0 trade"
    ]
]
2018-06-25 14:03:14 +00:00
creslinux
5fdb7612d0 Added Local RPC client
- added only "Daily" call so far, submitting for early review/feedback

This depends on zerorpc as a requirement.
simple examples here:
http://www.zerorpc.io/

Installed with pip3 install zerorpc

localRCP is enabled/disabled from within config.json
e.g
    "localrpc": {
        "enabled": true
       },

The server is enabled from within existing rpc manager
and makes use of the existing superclass (RPC)

Though making use of the existing hardwork done in rpc.py
It *should be easy to add the other Telegram calls into local_rpy_server.py

The server is wrapped in a thread to be non-blocking
The server and client accept serialised calls or not, used in daily to return json
The client can be used from command line or in a python script

As example, from cmdline for last 3 days Daily

/Users/creslin/PycharmProjects/freqtrade_new/.env/bin/zerorpc tcp://127.0.0.1:4242 daily 3
connecting to "tcp://127.0.0.1:4242"
False
('[\n'
 '    [\n'
 '        "2018-06-08",\n'
 '        "0.00000000 BTC",\n'
 '        "0.000 USDT",\n'
 '        "0 trade"\n'
 '    ],\n'
 '    [\n'
 '        "2018-06-07",\n'
 '        "0.00000000 BTC",\n'
 '        "0.000 USDT",\n'
 '        "0 trade"\n'
 '    ],\n'
 '    [\n'
 '        "2018-06-06",\n'
 '        "0.00000000 BTC",\n'
 '        "0.000 USDT",\n'
 '        "0 trade"\n'
 '    ]\n'
 ']')

Programitcally this would be:
import zerorpc

c = zerorpc.Client()
c.connect("tcp://127.0.0.1:4242")

for item in c.daily(3):
    print item
2018-06-25 14:03:10 +00:00
Samuel Husso
2bb63ba33d
Merge pull request #953 from freqtrade/release-0.17.0
Release 0.17.0
2018-06-23 16:22:51 -05:00
Samuel Husso
46a062d5fb Drafting freqtrade 0.17.0 release 2018-06-23 09:35:52 -05:00
Samuel Husso
8b7183cdbc
Merge pull request #951 from freqtrade/readme-update
README: note to open an issue before starting major feature work
2018-06-23 09:32:56 -05:00
Michael Egger
beb15532f7
Merge pull request #950 from freqtrade/fix-filenotfounderror
StrategyResolver: Don't fail if user_data isn't present
2018-06-23 16:07:52 +02:00
Michael Egger
107f3ed35b
Merge pull request #760 from arudov/feature-unlimited-stake_amount
Feature unlimited stake amount
2018-06-23 16:07:38 +02:00
Anton
f82b809fcf Merge with develop 2018-06-23 16:50:27 +03:00
Samuel Husso
9bad75f37d README: note to open an issue before starting major feature work 2018-06-23 08:36:32 -05:00
Samuel Husso
864bbc441a
Merge pull request #882 from freqtrade/feature/revamp_readme
Update the README structure
2018-06-23 08:21:56 -05:00
Michael Egger
e2df908304
Merge pull request #949 from freqtrade/pyup-scheduled-update-2018-06-23
Scheduled daily dependency update on saturday
2018-06-23 14:56:52 +02:00
gcarq
4ea5fcc661 resolver: don't fail if user_data can't be found 2018-06-23 14:42:22 +02:00
gcarq
9c66c25890 resolver: use current folder instead of script folder to find user_data 2018-06-23 14:34:36 +02:00
pyup-bot
925b9b0c19 Update ccxt from 1.14.253 to 1.14.256 2018-06-23 14:23:07 +02:00
Matthias
e25d8f9435
Merge pull request #947 from freqtrade/code-cleanup
Remove global config from persistence module
2018-06-23 14:21:42 +02:00
gcarq
0b3e4f6bcd remove dead code 2018-06-23 13:50:49 +02:00
gcarq
295dfe2652 persistence: remove obsolete global _CONF variable 2018-06-23 13:50:22 +02:00
Michael Egger
df9015a7f1
Merge pull request #942 from xmatthias/feat/buy_on_sell_first
Introduce ignore_roi_if_buy_signal parameter to avoid sell/buy scenarios
2018-06-23 13:42:03 +02:00
Janne Sinivirta
90caa09ae0
Merge pull request #944 from freqtrade/improve-strategy-handling
Improve strategy handling
2018-06-23 14:32:39 +03:00
Michael Egger
909fd39b80
Merge pull request #945 from freqtrade/update_plotly
update plotly
2018-06-23 13:15:15 +02:00
xmatthias
d23cd73ba8 update plotly 2018-06-23 13:12:36 +02:00
xmatthias
fc219b4e94 move experimental eval below stop_loss_reached to improve performance 2018-06-23 13:10:08 +02:00
gcarq
818a6b12ed tests: add dir() assertion 2018-06-23 11:57:26 +02:00
gcarq
4bd61df3a7 implement test for import_strategy 2018-06-23 11:14:31 +02:00
gcarq
c40e6a12d1 move logic from hyperopt to freqtrade.strategy 2018-06-23 11:13:49 +02:00
gcarq
3360bf4001 wrap strategies with HyperoptStrategy for module lookups with pickle 2018-06-23 10:42:33 +02:00
Michael Egger
168ed91fe1
Merge pull request #941 from freqtrade/avoid-fee-calls-backtesting
avoid calling exchange.get_fee inside loop
2018-06-23 08:17:25 +02:00