Browse Source

TradesList: colored lines

master
Denis Tereshkin 7 years ago
parent
commit
8c5c33547e
  1. 84
      src/nailab/nailab_rc.py
  2. 8
      src/nailab/ui/tradeslistwidget.py

84
src/nailab/nailab_rc.py

@ -9,6 +9,41 @@ @@ -9,6 +9,41 @@
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x02\x0e\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x30\x00\x00\x00\x30\x08\x06\x00\x00\x00\x57\x02\xf9\x87\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x1b\xaf\x00\x00\x1b\xaf\
\x01\x5e\x1a\x91\x1c\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x01\x8b\x49\x44\
\x41\x54\x68\x81\xed\x99\x4f\x4a\xc3\x40\x14\x87\x7f\x49\x53\x94\
\x0a\x2a\xa2\xe2\x9f\x45\xf1\x04\x3d\x42\xc5\x9d\x1b\x71\x29\x81\
\x9e\xa0\x17\xe8\x11\x7a\x0f\x37\x5d\x8a\x07\x08\xba\xc9\xde\x13\
\x94\x2e\x6a\x4b\x5a\x28\xad\x34\x28\x49\xe6\x79\x82\x37\x24\x99\
\xc6\x17\x61\xbe\xed\x1b\xde\xfc\x3e\xe6\x31\x09\x8c\x43\x44\xf8\
\xcf\xb8\xd2\x01\x4c\xf1\x74\xc5\x20\x0c\xdb\x50\xee\x90\x40\x5d\
\x07\xce\xe5\x2e\x37\x9e\x2e\xa3\xf7\xde\xe3\xc3\xad\x69\x1f\xf6\
\x04\x82\x30\x6c\x83\xdc\x0f\x00\x4f\xbb\x0e\x0f\x00\x5f\xf1\xb6\
\xfb\xfc\xf2\xfa\x66\xda\x87\x1f\x21\xe5\x0e\x41\x38\x32\xdd\x40\
\xc7\x2e\x24\x58\x01\x02\xdd\x99\x34\xce\x8b\xa9\x04\x2b\xe0\xc0\
\x39\x2f\xdb\xb4\x28\x26\x12\xb5\xb9\x85\xca\x4a\xd4\x46\x00\x28\
\x27\x51\x2b\x01\xa0\xb8\x84\x98\x80\xd7\x68\xb0\xb5\x22\x12\x62\
\x02\xad\xbd\x7d\x6d\x3d\xaf\x84\x98\xc0\xd9\xf1\x09\x5c\x57\xbf\
\x7d\x1e\x09\x31\x81\xa6\xe7\xe1\xe6\xe2\x1a\x87\xad\x03\xa3\x71\
\xd2\xfe\x0b\x55\x4d\xd3\xf3\x70\x75\x9a\xeb\x73\xd3\xe5\x0a\xb5\
\xbb\x85\x8a\x62\x05\xa4\xb1\x02\xd2\x58\x01\x69\xac\x80\x34\x56\
\x40\x1a\x2b\x20\x8d\x15\x90\xc6\x0a\x48\x63\x05\xa4\xb1\x02\xd2\
\x58\x01\x69\xac\x80\x34\x56\x40\x1a\x56\x20\xcd\xb2\xbf\xcc\xa1\
\x45\x97\x85\x15\x88\x7f\xbe\x2b\x09\x53\x06\x5d\x16\x56\x60\xb1\
\x5e\x45\x4a\xa9\x4a\x02\x15\x41\x29\x85\xc5\x7a\x15\x71\x75\x7e\
\x84\x92\x24\x18\xcf\xa7\xd8\xc4\x5b\x91\x71\x4a\xb3\x0c\x9b\x78\
\x8b\xf1\x7c\x8a\x34\x49\x02\x6e\x1d\xfb\x3e\xa0\x40\x83\x24\x4d\
\xef\x3f\x97\x51\xa5\xaf\xf5\x39\x58\x13\x68\xc0\x15\xd9\x13\xe8\
\xfb\xfe\x84\x40\x1d\x07\x18\x01\x98\x55\x12\x4d\xcf\xcc\x01\x46\
\x04\xea\xf4\x7d\x7f\xc2\x2d\xfa\x05\x0e\x3c\xa3\x06\xde\xce\x5a\
\xc4\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x02\x8f\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
@ -149,41 +184,6 @@ qt_resource_data = b"\ @@ -149,41 +184,6 @@ qt_resource_data = b"\
\x09\xf1\x80\x43\x84\x88\xf8\xc7\x59\x11\x0f\x08\xbf\x13\x4f\x03\
\xd1\x77\xe2\x69\xf0\xdf\xc0\xb4\xf9\x0b\x47\x70\x6d\x4b\x01\x24\
\x0b\x02\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x02\x0e\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x30\x00\x00\x00\x30\x08\x06\x00\x00\x00\x57\x02\xf9\x87\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x1b\xaf\x00\x00\x1b\xaf\
\x01\x5e\x1a\x91\x1c\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x01\x8b\x49\x44\
\x41\x54\x68\x81\xed\x99\x4f\x4a\xc3\x40\x14\x87\x7f\x49\x53\x94\
\x0a\x2a\xa2\xe2\x9f\x45\xf1\x04\x3d\x42\xc5\x9d\x1b\x71\x29\x81\
\x9e\xa0\x17\xe8\x11\x7a\x0f\x37\x5d\x8a\x07\x08\xba\xc9\xde\x13\
\x94\x2e\x6a\x4b\x5a\x28\xad\x34\x28\x49\xe6\x79\x82\x37\x24\x99\
\xc6\x17\x61\xbe\xed\x1b\xde\xfc\x3e\xe6\x31\x09\x8c\x43\x44\xf8\
\xcf\xb8\xd2\x01\x4c\xf1\x74\xc5\x20\x0c\xdb\x50\xee\x90\x40\x5d\
\x07\xce\xe5\x2e\x37\x9e\x2e\xa3\xf7\xde\xe3\xc3\xad\x69\x1f\xf6\
\x04\x82\x30\x6c\x83\xdc\x0f\x00\x4f\xbb\x0e\x0f\x00\x5f\xf1\xb6\
\xfb\xfc\xf2\xfa\x66\xda\x87\x1f\x21\xe5\x0e\x41\x38\x32\xdd\x40\
\xc7\x2e\x24\x58\x01\x02\xdd\x99\x34\xce\x8b\xa9\x04\x2b\xe0\xc0\
\x39\x2f\xdb\xb4\x28\x26\x12\xb5\xb9\x85\xca\x4a\xd4\x46\x00\x28\
\x27\x51\x2b\x01\xa0\xb8\x84\x98\x80\xd7\x68\xb0\xb5\x22\x12\x62\
\x02\xad\xbd\x7d\x6d\x3d\xaf\x84\x98\xc0\xd9\xf1\x09\x5c\x57\xbf\
\x7d\x1e\x09\x31\x81\xa6\xe7\xe1\xe6\xe2\x1a\x87\xad\x03\xa3\x71\
\xd2\xfe\x0b\x55\x4d\xd3\xf3\x70\x75\x9a\xeb\x73\xd3\xe5\x0a\xb5\
\xbb\x85\x8a\x62\x05\xa4\xb1\x02\xd2\x58\x01\x69\xac\x80\x34\x56\
\x40\x1a\x2b\x20\x8d\x15\x90\xc6\x0a\x48\x63\x05\xa4\xb1\x02\xd2\
\x58\x01\x69\xac\x80\x34\x56\x40\x1a\x56\x20\xcd\xb2\xbf\xcc\xa1\
\x45\x97\x85\x15\x88\x7f\xbe\x2b\x09\x53\x06\x5d\x16\x56\x60\xb1\
\x5e\x45\x4a\xa9\x4a\x02\x15\x41\x29\x85\xc5\x7a\x15\x71\x75\x7e\
\x84\x92\x24\x18\xcf\xa7\xd8\xc4\x5b\x91\x71\x4a\xb3\x0c\x9b\x78\
\x8b\xf1\x7c\x8a\x34\x49\x02\x6e\x1d\xfb\x3e\xa0\x40\x83\x24\x4d\
\xef\x3f\x97\x51\xa5\xaf\xf5\x39\x58\x13\x68\xc0\x15\xd9\x13\xe8\
\xfb\xfe\x84\x40\x1d\x07\x18\x01\x98\x55\x12\x4d\xcf\xcc\x01\x46\
\x04\xea\xf4\x7d\x7f\xc2\x2d\xfa\x05\x0e\x3c\xa3\x06\xde\xce\x5a\
\xc4\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
"
qt_resource_name = b"\
@ -195,6 +195,10 @@ qt_resource_name = b"\ @@ -195,6 +195,10 @@ qt_resource_name = b"\
\x00\x6f\xa6\x53\
\x00\x69\
\x00\x63\x00\x6f\x00\x6e\x00\x73\
\x00\x07\
\x04\xca\x57\xa7\
\x00\x6e\
\x00\x65\x00\x77\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x08\
\x06\xc1\x59\x87\
\x00\x6f\
@ -207,20 +211,16 @@ qt_resource_name = b"\ @@ -207,20 +211,16 @@ qt_resource_name = b"\
\x0c\x81\x80\x07\
\x00\x65\
\x00\x78\x00\x65\x00\x63\x00\x75\x00\x74\x00\x65\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x07\
\x04\xca\x57\xa7\
\x00\x6e\
\x00\x65\x00\x77\x00\x2e\x00\x70\x00\x6e\x00\x67\
"
qt_resource_struct = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\
\x00\x00\x00\x0e\x00\x02\x00\x00\x00\x04\x00\x00\x00\x03\
\x00\x00\x00\x66\x00\x00\x00\x00\x00\x01\x00\x00\x08\x5d\
\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x00\x34\x00\x00\x00\x00\x00\x01\x00\x00\x02\x93\
\x00\x00\x00\x4a\x00\x00\x00\x00\x00\x01\x00\x00\x04\xca\
\x00\x00\x00\x32\x00\x00\x00\x00\x00\x01\x00\x00\x02\x12\
\x00\x00\x00\x48\x00\x00\x00\x00\x00\x01\x00\x00\x04\xa5\
\x00\x00\x00\x5e\x00\x00\x00\x00\x00\x01\x00\x00\x06\xdc\
"
def qInitResources():

8
src/nailab/ui/tradeslistwidget.py

@ -35,3 +35,11 @@ class TradesListWidget(QtWidgets.QWidget): @@ -35,3 +35,11 @@ class TradesListWidget(QtWidgets.QWidget):
item.setText(6, "{:.4f}".format(trade["exit_price"]))
item.setText(7, "{:.4f}".format(trade["pnl"]))
if trade["pnl"] > 0:
brush = QtGui.QBrush(QtGui.QColor(180, 255, 180))
else:
brush = QtGui.QBrush(QtGui.QColor(255, 180, 180))
for i in range(0, 8):
item.setBackground(i, brush)

Loading…
Cancel
Save