Skip to content

Commit 5572e0a

Browse files
authored
Merge pull request #35 from hANSIc99/dev
Release v0.19 rdy
2 parents 240e0ee + e89df53 commit 5572e0a

File tree

11 files changed

+80
-150
lines changed

11 files changed

+80
-150
lines changed

CHANGES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
0.19
2+
3+
Pythonic: CCXT library implemented
4+
PythonicDaemon: Uptime clock added
5+
16
0.18
27

38
PythonicDaemon: tty bug fixed: can be run as cronjob now

dist/Pythonic-0.19.tar.gz

367 KB
Binary file not shown.

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
'pandas>=0.20.3',
2929
'pythonic-binance>=0.7.2',
3030
'requests>=2.21.0',
31-
'scikit-learn>=0.21.3'],
31+
'scikit-learn>=0.21.3',
32+
'ccxt>=1.37.38'],
3233
classifiers = [
3334
'Programming Language :: Python :: 3 :: Only',
3435
'Programming Language :: Python :: 3.6',

src/Pythonic/elements/ccxt.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
from Pythonic.elementeditor import ElementEditor
88
from Pythonic.elementmaster import ElementMaster
99
import ccxt, inspect
10-
#from Pythonic.elements.ccxt_func import CCXTFunction
11-
from elements.ccxt_func import CCXTFunction
10+
from Pythonic.elements.ccxt_func import CCXTFunction
11+
12+
# uncomment this during development
13+
#from elements.ccxt_func import CCXTFunction
1214

1315

1416
class VarArgBase:

src/Pythonic/elements/ccxt_func.py

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import ccxt, inspect
2+
from Pythonic.record_function import Record, Function
23

3-
from record_function import Record, Function
4-
#from Pythonic.record_function import Record, Function
4+
# uncomment this during development
5+
#from record_function import Record, Function
56

67
class CCXTFunction(Function):
78

@@ -10,6 +11,7 @@ def __init(self, config, b_debug, row, column):
1011
super().__init__(config, b_debug, row, column)
1112
#logging.debug('__init__() called BinanceOHLCFUnction')
1213

14+
1315
def execute(self, record):
1416

1517

@@ -24,13 +26,27 @@ def execute(self, record):
2426

2527
method = getattr(exchange, current_method)
2628

27-
method_kwargs = {}
2829
method_args = []
2930

3031
for key in params:
3132
if key == 'args':
3233
varArgs = params['args']
3334
for varKey in varArgs:
35+
36+
# first check if argument can be converted to int
37+
try:
38+
method_args.append(int(varArgs[varKey]))
39+
continue
40+
except Exception:
41+
pass
42+
43+
# second check if value can be converted to float
44+
try:
45+
method_args.append(float(varArgs[varKey]))
46+
continue
47+
except Exception:
48+
pass
49+
3450
method_args.append(varArgs[varKey])
3551

3652
else:
@@ -53,29 +69,12 @@ def execute(self, record):
5369
# append argument as it is (string)
5470
method_args.append(params[key])
5571

56-
#signature = inspect.signature(method)
57-
#arguments = signature.parameters.values()
58-
"""
59-
if method_args:
60-
res = method(*method_args, **method_kwargs)
61-
else:
62-
res = method(**method_kwargs)
63-
"""
64-
#res = method('BTC/USDT', '1h', 1604929467, 100)
72+
6573
res = method(*method_args)
6674

67-
"""
68-
logging.error('Order: {}'.format(order))
69-
logging.error('symbol = {}'.format(symbol_txt))
70-
logging.error('side = {}'.format(side_txt))
71-
logging.error('type = {}'.format(order_string))
72-
logging.error('quantity = {}'.format(quantity))
73-
logging.error('timeInForce = {}'.format(timeInForce))
74-
logging.error('price = {}'.format(price))
75-
logging.error('stopPrice = {}'.format(stopPrice))
76-
"""
77-
78-
log_txt = '{{CCXT}} EXECUTED'
75+
76+
77+
log_txt = '{{CCXT}} {}::{} CALLED'.format(current_exchange, current_method)
7978
result = Record(self.getPos(), (self.row +1, self.column), res,
8079
log=log_state, log_txt=log_txt)
8180

src/Pythonic/elements/test/.vscode/launch.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/Pythonic/elements/test/ccxtTest.py

Lines changed: 0 additions & 65 deletions
This file was deleted.

src/Pythonic/elements/test/testflow

-1.8 KB
Binary file not shown.

src/Pythonic/executor.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,17 @@
44
import logging, sys, time, traceback, os, signal
55
from datetime import datetime
66

7+
from Pythonic.record_function import Record, PipeRecord
8+
from Pythonic.elementeditor import ElementEditor
9+
from Pythonic.record_function import alphabet
10+
from Pythonic.exceptwindow import ExceptWindow
11+
from Pythonic.debugwindow import DebugWindow
12+
from Pythonic.elements.basic_stack import ExecStack
13+
from Pythonic.elements.basic_sched import ExecSched
14+
from Pythonic.elements.basicelements import ExecRB, ExecR
715

816
# uncomment this during development
17+
"""
918
from record_function import Record, PipeRecord
1019
from elementeditor import ElementEditor
1120
from record_function import alphabet
@@ -15,15 +24,6 @@
1524
from elements.basic_sched import ExecSched
1625
from elements.basicelements import ExecRB, ExecR
1726
"""
18-
from Pythonic.record_function import Record, PipeRecord
19-
from Pythonic.elementeditor import ElementEditor
20-
from Pythonic.record_function import alphabet
21-
from Pythonic.exceptwindow import ExceptWindow
22-
from Pythonic.debugwindow import DebugWindow
23-
from Pythonic.elements.basic_stack import ExecStack
24-
from Pythonic.elements.basic_sched import ExecSched
25-
from Pythonic.elements.basicelements import ExecRB, ExecR
26-
"""
2727
class WorkerSignals(QObject):
2828

2929
finished = pyqtSignal(object, name='element_finished' )

src/Pythonic/main.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,22 @@
1111
import sys, logging, datetime, os, Pythonic, pickle
1212
import multiprocessing as mp
1313

14+
from Pythonic.workingarea import WorkingArea
15+
from Pythonic.menubar import MenuBar
16+
from Pythonic.executor import GridOperator
17+
from Pythonic.top_menubar import topMenuBar
18+
from Pythonic.basictools import BasicTools
19+
from Pythonic.cryptotools import CryptoTools
20+
from Pythonic.connectivitytools import ConnectivityTools
21+
from Pythonic.mltools import MLTools
22+
from Pythonic.mastertool import MasterTool
23+
from Pythonic.settings import Settings
24+
from Pythonic.info import InfoWindow
25+
from Pythonic.storagebar import StorageBar
26+
27+
1428
# uncomment this during development
29+
"""
1530
from workingarea import WorkingArea
1631
from menubar import MenuBar
1732
from executor import GridOperator
@@ -25,19 +40,6 @@
2540
from info import InfoWindow
2641
from storagebar import StorageBar
2742
"""
28-
from Pythonic.workingarea import WorkingArea
29-
from Pythonic.menubar import MenuBar
30-
from Pythonic.executor import GridOperator
31-
from Pythonic.top_menubar import topMenuBar
32-
from Pythonic.basictools import BasicTools
33-
from Pythonic.cryptotools import CryptoTools
34-
from Pythonic.connectivitytools import ConnectivityTools
35-
from Pythonic.mltools import MLTools
36-
from Pythonic.mastertool import MasterTool
37-
from Pythonic.settings import Settings
38-
from Pythonic.info import InfoWindow
39-
from Pythonic.storagebar import StorageBar
40-
"""
4143

4244
class MainWindow(QWidget):
4345

src/Pythonic/workingarea.py

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,30 @@
11
from PyQt5.QtWidgets import QWidgetItem, QFrame, QGridLayout, QMessageBox
22
from PyQt5.QtCore import Qt, pyqtSignal
33

4+
from Pythonic.elements.basicelements import StartElement, ExecRB, ExecR, PlaceHolder
5+
from Pythonic.elements.basic_operation import ExecOp
6+
from Pythonic.elements.basic_branch import ExecBranch
7+
from Pythonic.elements.basic_return import ExecReturn
8+
from Pythonic.elements.basic_process import ExecProcess
9+
from Pythonic.elements.basic_ta import ExecTA
10+
from Pythonic.elements.basic_sched import ExecSched
11+
from Pythonic.elements.basic_stack import ExecStack
12+
from Pythonic.elements.binance_sched import BinanceSched
13+
from Pythonic.elements.binance_ohlc import BinanceOHLC
14+
from Pythonic.elements.binance_order import BinanceOrder
15+
16+
from Pythonic.elements.ccxt import CCXT
17+
from Pythonic.elements.conn_mail import ConnMail
18+
from Pythonic.elements.conn_rest import ConnREST
19+
from Pythonic.elements.ml_svm import MLSVM
20+
from Pythonic.elements.ml_svm_predict import MLSVM_Predict
21+
22+
from Pythonic.elementmaster import ElementMaster
23+
from Pythonic.dropbox import DropBox
24+
425

526
# uncomment this during development
27+
"""
628
from elements.basicelements import StartElement, ExecRB, ExecR, PlaceHolder
729
from elements.basic_operation import ExecOp
830
from elements.basic_branch import ExecBranch
@@ -24,27 +46,6 @@
2446
from elementmaster import ElementMaster
2547
from dropbox import DropBox
2648
"""
27-
from Pythonic.elements.basicelements import StartElement, ExecRB, ExecR, PlaceHolder
28-
from Pythonic.elements.basic_operation import ExecOp
29-
from Pythonic.elements.basic_branch import ExecBranch
30-
from Pythonic.elements.basic_return import ExecReturn
31-
from Pythonic.elements.basic_process import ExecProcess
32-
from Pythonic.elements.basic_ta import ExecTA
33-
from Pythonic.elements.basic_sched import ExecSched
34-
from Pythonic.elements.basic_stack import ExecStack
35-
from Pythonic.elements.binance_sched import BinanceSched
36-
from Pythonic.elements.binance_ohlc import BinanceOHLC
37-
from Pythonic.elements.binance_order import BinanceOrder
38-
39-
from Pythonic.elements.ccxt import CCXT
40-
from Pythonic.elements.conn_mail import ConnMail
41-
from Pythonic.elements.conn_rest import ConnREST
42-
from Pythonic.elements.ml_svm import MLSVM
43-
from Pythonic.elements.ml_svm_predict import MLSVM_Predict
44-
45-
from Pythonic.elementmaster import ElementMaster
46-
from Pythonic.dropbox import DropBox
47-
"""
4849
import logging, pickle
4950

5051
class WorkingArea(QFrame):

0 commit comments

Comments
 (0)