bugfixy highlight + batchid v dttbls
This commit is contained in:
@ -51,7 +51,7 @@ Hlavní loop:
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
def next(data, state: StrategyState):
|
def next(data, state: StrategyState):
|
||||||
print(10*"*","NEXT START",10*"*")
|
##print(10*"*","NEXT START",10*"*")
|
||||||
# important vars state.avgp, state.positions, state.vars, data
|
# important vars state.avgp, state.positions, state.vars, data
|
||||||
|
|
||||||
#indicators moved to call_next in upper class
|
#indicators moved to call_next in upper class
|
||||||
|
|||||||
@ -48,7 +48,8 @@ from joblib import load
|
|||||||
#9. jiny pristup by byl ucit model na konkretnich chunkach, ktere chci aby mi identifikoval. Např. určité úseky. Vymyslet. Buď nyni jako test intervaly, ale v budoucnu to treba jen nejak oznacit a poslat k nauceni. Pripadne pak udelat nejaky vycuc.
|
#9. jiny pristup by byl ucit model na konkretnich chunkach, ktere chci aby mi identifikoval. Např. určité úseky. Vymyslet. Buď nyni jako test intervaly, ale v budoucnu to treba jen nejak oznacit a poslat k nauceni. Pripadne pak udelat nejaky vycuc.
|
||||||
#10. mozna správným výběrem targetu, můžu taky naučit jen určité věci. Specializace. Stačí když se jednou dvakrát denně aktivuje.
|
#10. mozna správným výběrem targetu, můžu taky naučit jen určité věci. Specializace. Stačí když se jednou dvakrát denně aktivuje.
|
||||||
# 11. udelat si go IN model, ktery pomuze strategii generovat vstup - staci jen aby mel trochu lepsi edge nez conditiony, o zbytek se postara logika strategie
|
# 11. udelat si go IN model, ktery pomuze strategii generovat vstup - staci jen aby mel trochu lepsi edge nez conditiony, o zbytek se postara logika strategie
|
||||||
# 12. model pro neagregované nebo jen filtroné či velmi lehce agregované trady?
|
# 12. model pro neagregované nebo jen filtroné či velmi lehce agregované trady? - tickprice
|
||||||
|
# 13. jako featury pouzit Fourierovo transformaci, na sekundovem baru nebo tickprice
|
||||||
|
|
||||||
#DULEZITE
|
#DULEZITE
|
||||||
# soustredit se v modelech na predikci nasledujici hodnoty, ideálně nějaký vektor ukazující směr (např. 0 - 1, kde nula nebude růst, 1 - bude růst strmě)
|
# soustredit se v modelech na predikci nasledujici hodnoty, ideálně nějaký vektor ukazující směr (např. 0 - 1, kde nula nebude růst, 1 - bude růst strmě)
|
||||||
|
|||||||
@ -177,7 +177,7 @@
|
|||||||
<label data-bs-toggle="collapse" data-bs-target="#runner-table-inner">
|
<label data-bs-toggle="collapse" data-bs-target="#runner-table-inner">
|
||||||
<h4>Running Strategies</h4>
|
<h4>Running Strategies</h4>
|
||||||
</label>
|
</label>
|
||||||
<div id="runner-table-inner" class="collapse show" style="width:70%">
|
<div id="runner-table-inner" class="collapse show" style="width:58%">
|
||||||
<div id="controls">
|
<div id="controls">
|
||||||
<label>API-KEY: <input type="password" id="api-key" autocomplete="off"/></label>
|
<label>API-KEY: <input type="password" id="api-key" autocomplete="off"/></label>
|
||||||
<button onclick="store_api_key(event)" id="bt-store" class="btn btn-outline-success btn-sm">Store</button>
|
<button onclick="store_api_key(event)" id="bt-store" class="btn btn-outline-success btn-sm">Store</button>
|
||||||
@ -236,7 +236,7 @@
|
|||||||
<label data-bs-toggle="collapse" data-bs-target="#archive-table-inner">
|
<label data-bs-toggle="collapse" data-bs-target="#archive-table-inner">
|
||||||
<h4>Past Runs</h4>
|
<h4>Past Runs</h4>
|
||||||
</label>
|
</label>
|
||||||
<div id="archive-table-inner" class="collapse show" style="width:70%">
|
<div id="archive-table-inner" class="collapse show" style="width:58%">
|
||||||
<!-- <div id="archive-chart">
|
<!-- <div id="archive-chart">
|
||||||
<div id="chartArchive" style="position: relative;"></div>
|
<div id="chartArchive" style="position: relative;"></div>
|
||||||
<div class="legend" id="legendArchive"></div>
|
<div class="legend" id="legendArchive"></div>
|
||||||
@ -272,8 +272,9 @@
|
|||||||
<th>profit</th>
|
<th>profit</th>
|
||||||
<th>trade</th>
|
<th>trade</th>
|
||||||
<th>pos</th>
|
<th>pos</th>
|
||||||
<th>pos_avgp</th>
|
<th>avgp</th>
|
||||||
<th>metrics</th>
|
<th>metrics</th>
|
||||||
|
<th>batchid</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody></tbody>
|
<tbody></tbody>
|
||||||
@ -345,7 +346,7 @@
|
|||||||
<label data-bs-toggle="collapse" data-bs-target="#stratin-table-inner">
|
<label data-bs-toggle="collapse" data-bs-target="#stratin-table-inner">
|
||||||
<h4>Strategies</h4>
|
<h4>Strategies</h4>
|
||||||
</label>
|
</label>
|
||||||
<div id="stratin-table-inner" class="collapse show" style="width:70%">
|
<div id="stratin-table-inner" class="collapse show" style="width:58%">
|
||||||
<div id="controlsStratin">
|
<div id="controlsStratin">
|
||||||
<button id="button_add" class="btn btn-outline-success btn-sm">Add</button>
|
<button id="button_add" class="btn btn-outline-success btn-sm">Add</button>
|
||||||
<button id="button_add_json" class="btn btn-outline-success btn-sm">Add JSON</button>
|
<button id="button_add_json" class="btn btn-outline-success btn-sm">Add JSON</button>
|
||||||
|
|||||||
@ -969,14 +969,14 @@ function display_log(iterLogList, timestamp) {
|
|||||||
hdr = logLine.time + " " + logLine.event + ' - '+ (logLine.message == undefined ? "" : logLine.message)
|
hdr = logLine.time + " " + logLine.event + ' - '+ (logLine.message == undefined ? "" : logLine.message)
|
||||||
hdr = Prism.highlight(hdr, Prism.languages.log, 'log');
|
hdr = Prism.highlight(hdr, Prism.languages.log, 'log');
|
||||||
|
|
||||||
row = '<div data-bs-toggle="collapse" class="'+ highlighted + ' shj-lang-log" onclick="set_timestamp(' + logLine.time + ')" data-bs-target="#rec'+logcnt+'">'
|
row = '<div data-bs-toggle="collapse" class="'+ highlighted + '" onclick="set_timestamp(' + logLine.time + ')" data-bs-target="#rec'+logcnt+'">'
|
||||||
+hdr + '</div>'
|
+hdr + '</div>'
|
||||||
str_row = JSON.stringify(logLine.details, null, 2)
|
str_row = JSON.stringify(logLine.details, null, 2)
|
||||||
//row_detail = '<div id="rec'+logcnt+'" data-toggle="collapse" data-target="#rec'+logcnt+'"class="collapse pidi"><pre>' + str_row + '</pre></div>'
|
//row_detail = '<div id="rec'+logcnt+'" data-toggle="collapse" data-target="#rec'+logcnt+'"class="collapse pidi"><pre>' + str_row + '</pre></div>'
|
||||||
|
|
||||||
const html = Prism.highlight(str_row, Prism.languages.json, 'json');
|
const html = Prism.highlight(str_row, Prism.languages.json, 'json');
|
||||||
//console.log("tady", html)
|
//console.log("tady", html)
|
||||||
row_detail = '<div id="rec'+logcnt+'" class="collapse pidi shj-lang-log"><pre><code class="language-log">' + html + '</code></pre></div>'
|
row_detail = '<div id="rec'+logcnt+'" class="collapse pidi"><pre><code class="language-log">' + html + '</code></pre></div>'
|
||||||
|
|
||||||
var lines = document.getElementById('lines')
|
var lines = document.getElementById('lines')
|
||||||
var line = document.createElement('div')
|
var line = document.createElement('div')
|
||||||
|
|||||||
@ -614,12 +614,14 @@ var archiveRecords =
|
|||||||
{data: 'end_positions', visible: true},
|
{data: 'end_positions', visible: true},
|
||||||
{data: 'end_positions_avgp', visible: true},
|
{data: 'end_positions_avgp', visible: true},
|
||||||
{data: 'metrics', visible: true},
|
{data: 'metrics', visible: true},
|
||||||
|
{data: 'batch_id', visible: true},
|
||||||
],
|
],
|
||||||
paging: false,
|
paging: false,
|
||||||
processing: false,
|
processing: false,
|
||||||
columnDefs: [{
|
columnDefs: [{
|
||||||
targets: [0,1],
|
targets: [0,1,17],
|
||||||
render: function ( data, type, row ) {
|
render: function ( data, type, row ) {
|
||||||
|
if (!data) return data
|
||||||
return '<div class="tdnowrap" title="'+data+'">'+data+'</i>'
|
return '<div class="tdnowrap" title="'+data+'">'+data+'</i>'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -695,11 +697,12 @@ var archiveRecords =
|
|||||||
{
|
{
|
||||||
targets: [16],
|
targets: [16],
|
||||||
render: function ( data, type, row ) {
|
render: function ( data, type, row ) {
|
||||||
|
//console.log("metrics", data)
|
||||||
try {
|
try {
|
||||||
data = JSON.parse(data)
|
data = JSON.parse(data)
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
//console.log(error)
|
||||||
}
|
}
|
||||||
var res = JSON.stringify(data)
|
var res = JSON.stringify(data)
|
||||||
var unquoted = res.replace(/"([^"]+)":/g, '$1:')
|
var unquoted = res.replace(/"([^"]+)":/g, '$1:')
|
||||||
|
|||||||
13951
v2realbot/static/js/libs/bootstrap.min.css
vendored
13951
v2realbot/static/js/libs/bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
@ -24,7 +24,7 @@ Prism.languages.log = {
|
|||||||
|
|
||||||
'level': [
|
'level': [
|
||||||
{
|
{
|
||||||
pattern: /\b(?:ALERT|CRIT|CRITICAL|EMERG|EMERGENCY|ERR|ERROR|FAILURE|FATAL|SEVERE|-----)\b/,
|
pattern: /\b(?:ALERT|CRIT|CRITICAL|EMERG|EMERGENCY|ERR|ERROR|FAILURE|FATAL|SEVERE|CONF|-----)\b/,
|
||||||
alias: ['error', 'important']
|
alias: ['error', 'important']
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -36,7 +36,7 @@ Prism.languages.log = {
|
|||||||
alias: ['info', 'keyword']
|
alias: ['info', 'keyword']
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pattern: /\b(?:DBG|DEBUG|FINE|REVERSE|ADD|EXITADD|SIGNAL)\b/,
|
pattern: /\b(?:DBG|DEBUG|FINE|REVERSE|ADD|EXITADD|SIGNAL|PRECOND)\b/,
|
||||||
alias: ['debug', 'keyword']
|
alias: ['debug', 'keyword']
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -51,7 +51,7 @@ pre[class*=language-] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.token.boolean {
|
.token.boolean {
|
||||||
color: #c39375;
|
color: #7c7630;
|
||||||
}
|
}
|
||||||
|
|
||||||
.token.function {
|
.token.function {
|
||||||
@ -63,15 +63,21 @@ pre[class*=language-] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.token.class-name,.token.constant,.token.property,.token.symbol {
|
.token.class-name,.token.constant,.token.property,.token.symbol {
|
||||||
color: #f29599;
|
color: #ae4b86;
|
||||||
}
|
}
|
||||||
|
|
||||||
.token.atrule,.token.builtin,.token.important,.token.selector {
|
.token.atrule,.token.builtin,.token.selector {
|
||||||
color: #cc99cd
|
color: #cc99cd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.token.important{
|
||||||
|
color: #be6db7
|
||||||
|
/* color: #82b3b0 */
|
||||||
|
}
|
||||||
|
|
||||||
.token.keyword{
|
.token.keyword{
|
||||||
color: #9d8c98
|
color: #ca7474
|
||||||
|
/* color: #9d8c98 */
|
||||||
}
|
}
|
||||||
|
|
||||||
.token.attr-value,.token.char,.token.regex,.token.string,.token.variable {
|
.token.attr-value,.token.char,.token.regex,.token.string,.token.variable {
|
||||||
|
|||||||
@ -61,6 +61,7 @@ function initialize_statusheader() {
|
|||||||
|
|
||||||
var rows = 2;
|
var rows = 2;
|
||||||
var columns = 4;
|
var columns = 4;
|
||||||
|
console.log("initialiting statusheader")
|
||||||
console.log(JSON.stringify(statusBarConfig))
|
console.log(JSON.stringify(statusBarConfig))
|
||||||
|
|
||||||
// Create the grid table
|
// Create the grid table
|
||||||
@ -262,7 +263,8 @@ function initialize_chart() {
|
|||||||
layout: {
|
layout: {
|
||||||
background: {
|
background: {
|
||||||
type: 'solid',
|
type: 'solid',
|
||||||
color: '#2a2e39',
|
// color: '#2a2e39',
|
||||||
|
color: '#151824'
|
||||||
},
|
},
|
||||||
textColor: '#d1d4dc',
|
textColor: '#d1d4dc',
|
||||||
},
|
},
|
||||||
|
|||||||
@ -11,7 +11,8 @@
|
|||||||
color-scheme: dark;
|
color-scheme: dark;
|
||||||
--bs-body-color: #787b86;
|
--bs-body-color: #787b86;
|
||||||
--bs-body-color-rgb: 173,181,189;
|
--bs-body-color-rgb: 173,181,189;
|
||||||
--bs-body-bg: #2a2e39;
|
/* --bs-body-bg: #2a2e39; */
|
||||||
|
--bs-body-bg: #121722;
|
||||||
--bs-body-bg-rgb: 33,37,41;
|
--bs-body-bg-rgb: 33,37,41;
|
||||||
--bs-emphasis-color: #adb5bd;
|
--bs-emphasis-color: #adb5bd;
|
||||||
--bs-emphasis-color-rgb: 255,255,255;
|
--bs-emphasis-color-rgb: 255,255,255;
|
||||||
@ -225,7 +226,7 @@ html {
|
|||||||
flex-basis: auto;
|
flex-basis: auto;
|
||||||
align-self: auto;
|
align-self: auto;
|
||||||
order: 0;
|
order: 0;
|
||||||
margin-inline-start: 50px;
|
margin-inline-start: 23px;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,7 +237,7 @@ html {
|
|||||||
.legend {
|
.legend {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
color: #050505;
|
color: #050505;
|
||||||
left: 115px;
|
left: 100px;
|
||||||
top: 195px;
|
top: 195px;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
@ -254,19 +255,12 @@ html {
|
|||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
#msgContainer {
|
|
||||||
display: inline-block;
|
|
||||||
/* overflow: auto; */
|
|
||||||
height: 596px;
|
|
||||||
/* width: 32%; */
|
|
||||||
}
|
|
||||||
|
|
||||||
.clearbutton {
|
.clearbutton {
|
||||||
margin-left: 29px;
|
margin-left: 29px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* na male obrazovce je log pod grafem, zobrazujeme tedy prvni logy nahore */
|
/* na male obrazovce je log pod grafem, zobrazujeme tedy prvni logy nahore */
|
||||||
@media (max-width : 1680px) {
|
@media (max-width : 2000px) {
|
||||||
.msgContainerInner {
|
.msgContainerInner {
|
||||||
display: flex;
|
display: flex;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
@ -275,16 +269,29 @@ html {
|
|||||||
margin-left: 14px;
|
margin-left: 14px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
#msgContainer {
|
||||||
|
display: inline-block;
|
||||||
|
/* overflow: auto; */
|
||||||
|
height: 600px;
|
||||||
|
width: 40%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 1681px) {}
|
@media (min-width: 2001px) {
|
||||||
.msgContainerInner {
|
.msgContainerInner {
|
||||||
display: flex;
|
display: flex;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
height: 568px;
|
height: 568px;
|
||||||
flex-direction: column-reverse;
|
flex-direction: column-reverse;
|
||||||
margin-left: 14px;
|
margin-left: 14px;
|
||||||
width: 130%;
|
width: 130%;
|
||||||
|
}
|
||||||
|
#msgContainer {
|
||||||
|
display: inline-block;
|
||||||
|
/* overflow: auto; */
|
||||||
|
height: 600px;
|
||||||
|
width: max-content;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#lowercontainer {
|
#lowercontainer {
|
||||||
@ -405,20 +412,37 @@ pre {
|
|||||||
outline: none;
|
outline: none;
|
||||||
} */
|
} */
|
||||||
|
|
||||||
.switcher-item {
|
/* .switcher-item {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 3px 6px;
|
padding: 3px 6px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
/* color: #262b3e; */
|
|
||||||
/* background-color: #818581; */
|
|
||||||
background-color: #0202022e;;
|
background-color: #0202022e;;
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
margin-bottom: 6px;
|
margin-bottom: 6px;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
outline: none;
|
outline: none;
|
||||||
|
} */
|
||||||
|
|
||||||
|
.switcher-item {
|
||||||
|
/* cursor: pointer; */
|
||||||
|
text-decoration: double;
|
||||||
|
display: inline-block;
|
||||||
|
padding: 1px 6px;
|
||||||
|
font-size: 14px;
|
||||||
|
/* color: #262b3e; */
|
||||||
|
/* background-color: #818581; */
|
||||||
|
background-color: #0202022e;
|
||||||
|
margin-right: 8px;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
/* border: 1px; */
|
||||||
|
border-radius: 4px;
|
||||||
|
outline: solid 1px;
|
||||||
|
outline-color: #323232;
|
||||||
|
/* outline-width: 1px; */
|
||||||
|
border-style: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.switcher-item:hover {
|
.switcher-item:hover {
|
||||||
|
|||||||
@ -45,8 +45,18 @@ def populate_all_indicators(data, state: StrategyState):
|
|||||||
conf_bar = data['confirmed']
|
conf_bar = data['confirmed']
|
||||||
last_update_delta, avg_delta = process_delta()
|
last_update_delta, avg_delta = process_delta()
|
||||||
|
|
||||||
state.ilog(lvl=1,e=f"----- {data['index']}-{conf_bar}--delta:{last_update_delta}---AVGdelta:{avg_delta}", data=data)
|
conf = "-----"
|
||||||
|
if conf_bar == 1:
|
||||||
|
conf = "CONF"
|
||||||
|
|
||||||
|
lp = data['close']
|
||||||
|
state.ilog(lvl=1,e=f"{conf} {data['index']}-{conf_bar}--delta:{last_update_delta}---AVGdelta:{avg_delta}", data=data)
|
||||||
|
|
||||||
|
#TODO tento lof patri spis do nextu classic SL - je poplatny typu stratefie
|
||||||
|
#TODO na toto se podivam, nejak moc zajasonovani a zpatky
|
||||||
|
#PERF PROBLEM
|
||||||
|
state.ilog(lvl=1,e="ENTRY", msg=f"LP:{lp} P:{state.positions}/{round(float(state.avgp),3)} SL:{state.vars.activeTrade.stoploss_value if state.vars.activeTrade is not None else None} profit:{round(float(state.profit),2)} Trades:{len(state.tradeList)} pend:{state.vars.pending}", activeTrade=json.loads(json.dumps(state.vars.activeTrade, default=json_serial)), prescribedTrades=json.loads(json.dumps(state.vars.prescribedTrades, default=json_serial)), pending=str(state.vars.pending))
|
||||||
|
|
||||||
#kroky pro CONFIRMED BAR only
|
#kroky pro CONFIRMED BAR only
|
||||||
if conf_bar == 1:
|
if conf_bar == 1:
|
||||||
#logika pouze pro potvrzeny bar
|
#logika pouze pro potvrzeny bar
|
||||||
@ -65,12 +75,7 @@ def populate_all_indicators(data, state: StrategyState):
|
|||||||
#populate indicators, that have type in stratvars.indicators
|
#populate indicators, that have type in stratvars.indicators
|
||||||
populate_dynamic_indicators(data, state)
|
populate_dynamic_indicators(data, state)
|
||||||
|
|
||||||
lp = data['close']
|
#vytiskneme si indikatory
|
||||||
|
|
||||||
|
|
||||||
#TODO na toto se podivam, nejak moc zajasonovani a zpatky
|
|
||||||
#PERF PROBLEM
|
|
||||||
state.ilog(lvl=1,e="ENTRY", msg=f"LP:{lp} P:{state.positions}/{round(float(state.avgp),3)} SL:{state.vars.activeTrade.stoploss_value if state.vars.activeTrade is not None else None} profit:{round(float(state.profit),2)} Trades:{len(state.tradeList)} pend:{state.vars.pending}", activeTrade=json.loads(json.dumps(state.vars.activeTrade, default=json_serial)), prescribedTrades=json.loads(json.dumps(state.vars.prescribedTrades, default=json_serial)), pending=str(state.vars.pending))
|
|
||||||
inds = get_last_ind_vals()
|
inds = get_last_ind_vals()
|
||||||
state.ilog(lvl=1,e="Indikatory", **inds)
|
state.ilog(lvl=1,e="Indikatory", **inds)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user