bugfixy
This commit is contained in:
31
testy/testDict.py
Normal file
31
testy/testDict.py
Normal file
@ -0,0 +1,31 @@
|
||||
from v2realbot.utils.utils import AttributeDict
|
||||
indicators = AttributeDict(time=[])
|
||||
|
||||
for key,value in indicators.items():
|
||||
if key != "time":
|
||||
indicators[key].append(0)
|
||||
|
||||
|
||||
#as indicators are stored vector based, time is populated for each iteration
|
||||
def populate_indicator_time(self, item):
|
||||
if self.rectype == RecordType.BAR:
|
||||
#jako cas indikatorů pridavame cas baru, jejich hodnoty se naplni v nextu
|
||||
self.state.indicators['time'].append(item['time'])
|
||||
elif self.rectype == RecordType.TRADE:
|
||||
pass
|
||||
elif self.rectype == RecordType.CBAR:
|
||||
#novy vzdy pridame
|
||||
if self.nextnew:
|
||||
self.state.indicators['time'].append(item['time'])
|
||||
self.append_bar(self.state.bars,item)
|
||||
self.nextnew = 0
|
||||
#nasledujici updatneme, po potvrzeni, nasleduje novy bar
|
||||
else:
|
||||
if item['confirmed'] == 0:
|
||||
self.state.indicators['time'][-1]=item['time']
|
||||
self.replace_prev_bar(self.state.bars,item)
|
||||
#confirmed
|
||||
else:
|
||||
self.state.indicators['time'][-1]=item['time']
|
||||
self.replace_prev_bar(self.state.bars,item)
|
||||
self.nextnew = 1
|
||||
@ -251,7 +251,7 @@ def next(data, state: StrategyState):
|
||||
#kvuli spravnemu zobrazovani na gui
|
||||
state.indicators.slope.append(0)
|
||||
state.indicators.slopeMA.append(0)
|
||||
state.ilog(e="Slope - not enough data", slope_lookback=slope_lookback)
|
||||
state.ilog(e="Slope - not enough data", slope_lookback=slope_lookback, slope=state.indicators.slope, slopeMA=state.indicators.slopeMA)
|
||||
|
||||
except Exception as e:
|
||||
print("Exception in NEXT Indicator section", str(e))
|
||||
|
||||
Binary file not shown.
@ -543,8 +543,8 @@ def get_alpaca_history_bars(symbol: str, datetime_object_from: datetime, datetim
|
||||
#ohlcvList = {}
|
||||
|
||||
#bars = {}
|
||||
|
||||
return 0, bars.data[symbol]
|
||||
#bars.data[symbol]
|
||||
return 0, result
|
||||
except Exception as e:
|
||||
return -2, str(e)
|
||||
|
||||
|
||||
@ -12,6 +12,8 @@
|
||||
<link rel="manifest" href="/static/site.webmanifest">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
|
||||
|
||||
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
|
||||
|
||||
@ -38,7 +40,7 @@
|
||||
<div id="main" class="mainConteiner flex-container content">
|
||||
<div id="chartContainer" class="flex-items">
|
||||
<label data-bs-toggle="collapse" data-bs-target="#chartContainerInner" aria-expanded="true">
|
||||
<h4><span class="badge secondary-bg">Chart</span></h4>
|
||||
<h4>Chart</h4>
|
||||
</label>
|
||||
<div>Status: <span id="status">Not connected</span></div>
|
||||
<div id="chartContainerInner" class="collapse">
|
||||
@ -75,7 +77,7 @@
|
||||
<div id="hist-trades" class="flex-items">
|
||||
<div id="form-trades">
|
||||
<label data-bs-toggle="collapse" data-bs-target="#trades-data">
|
||||
<h4><span class="badge secondary-bg">Trade History</span></h4>
|
||||
<h4>Trade History</h4>
|
||||
</label>
|
||||
<label>Timestamp: <input type="text" id="trade-timestamp" autocomplete="off"/></label>
|
||||
<label>SYM: <input type="text" id="trade-symbol" autocomplete="off"/></label>
|
||||
@ -90,7 +92,7 @@
|
||||
</div>
|
||||
<div id="runner-table" class="flex-items">
|
||||
<label data-bs-toggle="collapse" data-bs-target="#runner-table-inner">
|
||||
<h4><span class="badge secondary-bg">Running Strategies</span></h4>
|
||||
<h4>Running Strategies</h4>
|
||||
</label>
|
||||
<div id="runner-table-inner" class="collapse show" style="width:70%">
|
||||
<div id="controls">
|
||||
@ -147,7 +149,7 @@
|
||||
|
||||
<div id="archive-table" class="flex-items">
|
||||
<label data-bs-toggle="collapse" data-bs-target="#archive-table-inner">
|
||||
<h4><span class="badge secondary-bg">Past Runs</span></h4>
|
||||
<h4>Past Runs</h4>
|
||||
</label>
|
||||
<div id="archive-table-inner" class="collapse show" style="width:70%">
|
||||
<!-- <div id="archive-chart">
|
||||
@ -243,7 +245,7 @@
|
||||
</div>
|
||||
<div id="stratin-table" class="flex-items">
|
||||
<label data-bs-toggle="collapse" data-bs-target="#stratin-table-inner">
|
||||
<h4><span class="badge secondary-bg">Strategies</span></h4>
|
||||
<h4>Strategies</h4>
|
||||
</label>
|
||||
<div id="stratin-table-inner" class="collapse show" style="width:70%">
|
||||
<button id="button_add" class="btn btn-outline-success btn-sm">Add</button>
|
||||
@ -269,8 +271,8 @@
|
||||
<th>add_data</th>
|
||||
<th>note</th>
|
||||
<th>history</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th>status</th>
|
||||
<!-- <th></th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
@ -456,7 +458,7 @@
|
||||
</div>
|
||||
<div id="configContainer" class="flex-items">
|
||||
<label data-bs-toggle="collapse" data-bs-target="#configInner" aria-expanded="true">
|
||||
<h4><span class="badge secondary-bg">Config</span></h4>
|
||||
<h4>Config</h4>
|
||||
</label>
|
||||
<div id="configInner" class="collapse show">
|
||||
config options
|
||||
|
||||
@ -90,7 +90,7 @@ function transform_data(data) {
|
||||
marker["time"] = timestamp;
|
||||
// marker["position"] = (trade.order.side == "buy") ? "belowBar" : "aboveBar"
|
||||
marker["position"] = (trade.order.side == "buy") ? "inBar" : "aboveBar"
|
||||
marker["color"] = (trade.order.side == "buy") ? "#cfcbc2" : "red"
|
||||
marker["color"] = (trade.order.side == "buy") ? "#37cade" : "red"
|
||||
//marker["shape"] = (trade.order.side == "buy") ? "arrowUp" : "arrowDown"
|
||||
marker["shape"] = (trade.order.side == "buy") ? "circle" : "arrowDown"
|
||||
//marker["text"] = trade.qty + "/" + trade.price
|
||||
@ -177,6 +177,7 @@ function chart_archived_run(archRecord, data, oneMinuteBars) {
|
||||
if (chart !== null) {
|
||||
chart.remove()
|
||||
clear_status_header()
|
||||
indList = [];
|
||||
if (toolTip !== null) {
|
||||
toolTip.style.display = 'none';
|
||||
}
|
||||
@ -252,6 +253,8 @@ function chart_archived_run(archRecord, data, oneMinuteBars) {
|
||||
intitialize_candles()
|
||||
candlestickSeries.setData(AllCandleSeriesesData.get(interval));
|
||||
|
||||
display_buy_markers();
|
||||
|
||||
if (last_range) {
|
||||
chart.timeScale().setVisibleRange(last_range);
|
||||
}
|
||||
@ -433,150 +436,119 @@ function chart_archived_run(archRecord, data, oneMinuteBars) {
|
||||
}
|
||||
}
|
||||
|
||||
//gets indicators from archived data and displays them on the chart
|
||||
//displays (redraws) buy markers
|
||||
function display_buy_markers() {
|
||||
if (avgBuyLine !== null) {
|
||||
chart.removeSeries(avgBuyLine)
|
||||
}
|
||||
|
||||
if (markersLine !== null) {
|
||||
chart.removeSeries(markersLine)
|
||||
}
|
||||
|
||||
console.log("avgp_buy_line",transformed_data["avgp_buy_line"])
|
||||
console.log("avgp_markers",transformed_data["avgp_markers"])
|
||||
|
||||
if (transformed_data["avgp_buy_line"].length > 0) {
|
||||
avgBuyLine = chart.addLineSeries({
|
||||
// title: "avgpbuyline",
|
||||
color: '#e8c76d',
|
||||
// color: 'transparent',
|
||||
lineWidth: 1,
|
||||
lastValueVisible: false
|
||||
});
|
||||
|
||||
avgBuyLine.applyOptions({
|
||||
lastValueVisible: false,
|
||||
priceLineVisible: false,
|
||||
});
|
||||
|
||||
|
||||
console.log("avgp_buy_line",transformed_data["avgp_buy_line"])
|
||||
console.log("avgp_markers",transformed_data["avgp_markers"])
|
||||
try {
|
||||
avgBuyLine.setData(transformed_data["avgp_buy_line"]);
|
||||
}
|
||||
catch (error) {
|
||||
console.log("avgbuyline")
|
||||
}
|
||||
|
||||
avgBuyLine.setMarkers(transformed_data["avgp_markers"])
|
||||
}
|
||||
|
||||
if (transformed_data["avgp_buy_line"].length > 0) {
|
||||
avgBuyLine = chart.addLineSeries({
|
||||
// title: "avgpbuyline",
|
||||
color: '#e8c76d',
|
||||
// color: 'transparent',
|
||||
markersLine = chart.addLineSeries({
|
||||
// title: "avgpbuyline",
|
||||
// color: '#d6d1c3',
|
||||
color: 'transparent',
|
||||
lineWidth: 1,
|
||||
lastValueVisible: false
|
||||
});
|
||||
|
||||
avgBuyLine.applyOptions({
|
||||
lastValueVisible: false,
|
||||
priceLineVisible: false,
|
||||
});
|
||||
|
||||
|
||||
try {
|
||||
avgBuyLine.setData(transformed_data["avgp_buy_line"]);
|
||||
}
|
||||
catch (error) {
|
||||
console.log("avgbuyline")
|
||||
}
|
||||
|
||||
avgBuyLine.setMarkers(transformed_data["avgp_markers"])
|
||||
}
|
||||
|
||||
markersLine = chart.addLineSeries({
|
||||
// title: "avgpbuyline",
|
||||
// color: '#d6d1c3',
|
||||
color: 'transparent',
|
||||
lineWidth: 1,
|
||||
lastValueVisible: false
|
||||
});
|
||||
|
||||
|
||||
|
||||
try {
|
||||
markersLine.setData(transformed_data["markers_line"]);
|
||||
}
|
||||
catch (error) {
|
||||
console.log("markersLine")
|
||||
}
|
||||
markersLine.setMarkers(transformed_data["markers"])
|
||||
|
||||
//chart.subscribeCrosshairMove(param => {
|
||||
chart.subscribeCrosshairMove(param => {
|
||||
//LEGEND SECTIOIN
|
||||
firstRow.style.color = 'white';
|
||||
update_chart_legend(param);
|
||||
|
||||
markersLine.setMarkers(transformed_data["markers"])
|
||||
|
||||
|
||||
|
||||
//TBD dynamicky
|
||||
//pokud je nazev atributu X_candles vytvorit candles
|
||||
//pokud je objekt Y_line pak vytvorit lajnu
|
||||
//pokud je objekt Z_markers pak vytvorit markers
|
||||
//pokud je Z = X nebo Y, pak markers dat na danou lajnu (priklad vvwap_line, avgp_line, avgp_markers)
|
||||
//udelat si nahodny vyber barev z listu
|
||||
|
||||
//DO BUDOUCNA MARKERS
|
||||
// chart.subscribeCrosshairMove(param => {
|
||||
// console.log(param.hoveredObjectId);
|
||||
// });
|
||||
|
||||
|
||||
|
||||
|
||||
//TODO onlick zkopirovat timestamp param.time
|
||||
// chart.subscribeClick(param => {
|
||||
// $('#trade-timestamp').val(param.time)
|
||||
// //alert(JSON.safeStringify(param))
|
||||
// //console.log(param.hoveredObjectId);
|
||||
// });
|
||||
|
||||
//TODO
|
||||
// - legend
|
||||
// - identifikatory
|
||||
// - volume
|
||||
|
||||
|
||||
//chart.subscribeCrosshairMove(param => {
|
||||
chart.subscribeCrosshairMove(param => {
|
||||
//LEGEND SECTIOIN
|
||||
firstRow.style.color = 'white';
|
||||
update_chart_legend(param);
|
||||
|
||||
//TOOLTIP SECTION
|
||||
//$('#trade-timestamp').val(param.time)
|
||||
if (
|
||||
param.point === undefined ||
|
||||
!param.time ||
|
||||
param.point.x < 0 ||
|
||||
param.point.x > container1.clientWidth ||
|
||||
param.point.y < 0 ||
|
||||
param.point.y > container1.clientHeight
|
||||
) {
|
||||
toolTip.style.display = 'none';
|
||||
} else {
|
||||
//vyber serie s jakou chci pracovat - muzu i dynamicky
|
||||
//je to mapa https://tradingview.github.io/lightweight-charts/docs/api/interfaces/MouseEventParams
|
||||
|
||||
//key = series (key.seriestype vraci Line/Candlestick atp.) https://tradingview.github.io/lightweight-charts/docs/api/interfaces/SeriesOptionsMap
|
||||
|
||||
toolTip.style.display = 'none';
|
||||
toolTip.innerHTML = "";
|
||||
var data = param.seriesData.get(markersLine);
|
||||
var data2 = param.seriesData.get(avgBuyLine);
|
||||
if ((data !== undefined) || (data2 !== undefined)) {
|
||||
//param.seriesData.forEach((value, key) => {
|
||||
//console.log("key",key)
|
||||
//console.log("value",value)
|
||||
|
||||
//data = value
|
||||
//DOCASNE VYPNUTO
|
||||
toolTip.style.display = 'block';
|
||||
//TOOLTIP SECTION
|
||||
//$('#trade-timestamp').val(param.time)
|
||||
if (
|
||||
param.point === undefined ||
|
||||
!param.time ||
|
||||
param.point.x < 0 ||
|
||||
param.point.x > container1.clientWidth ||
|
||||
param.point.y < 0 ||
|
||||
param.point.y > container1.clientHeight
|
||||
) {
|
||||
toolTip.style.display = 'none';
|
||||
} else {
|
||||
//vyber serie s jakou chci pracovat - muzu i dynamicky
|
||||
//je to mapa https://tradingview.github.io/lightweight-charts/docs/api/interfaces/MouseEventParams
|
||||
|
||||
//key = series (key.seriestype vraci Line/Candlestick atp.) https://tradingview.github.io/lightweight-charts/docs/api/interfaces/SeriesOptionsMap
|
||||
|
||||
toolTip.style.display = 'none';
|
||||
toolTip.innerHTML = "";
|
||||
var data = param.seriesData.get(markersLine);
|
||||
var data2 = param.seriesData.get(avgBuyLine);
|
||||
if ((data !== undefined) || (data2 !== undefined)) {
|
||||
//param.seriesData.forEach((value, key) => {
|
||||
//console.log("key",key)
|
||||
//console.log("value",value)
|
||||
|
||||
//console.log(JSON.safeStringify(key))
|
||||
// if (toolTip.innerHTML == "") {
|
||||
// toolTip.innerHTML = `<div>${param.time}</div>`
|
||||
// }
|
||||
buy_price = 0
|
||||
//u sell markeru nemame avgBuyLine
|
||||
if (data2 !== undefined) {
|
||||
buy_price = parseFloat(data2.value).toFixed(3)
|
||||
}
|
||||
//data = value
|
||||
//DOCASNE VYPNUTO
|
||||
toolTip.style.display = 'block';
|
||||
|
||||
//console.log(JSON.safeStringify(key))
|
||||
// if (toolTip.innerHTML == "") {
|
||||
// toolTip.innerHTML = `<div>${param.time}</div>`
|
||||
// }
|
||||
buy_price = 0
|
||||
//u sell markeru nemame avgBuyLine
|
||||
if (data2 !== undefined) {
|
||||
buy_price = parseFloat(data2.value).toFixed(3)
|
||||
}
|
||||
|
||||
toolTip.innerHTML += `<div>POS:${tradeDetails.get(param.time).position_qty}/${buy_price}</div><div>T:${tradeDetails.get(param.time).qty}/${data.value}</div>`;
|
||||
|
||||
//inspirace
|
||||
// toolTip.innerHTML = `<div style="color: ${'#2962FF'}">Apple Inc.</div><div style="font-size: 24px; margin: 4px 0px; color: ${'black'}">
|
||||
// ${Math.round(100 * price) / 100}
|
||||
// </div><div style="color: ${'black'}">
|
||||
// ${dateStr}
|
||||
// </div>`;
|
||||
|
||||
|
||||
// Position tooltip according to mouse cursor position
|
||||
toolTip.style.left = param.point.x+120 + 'px';
|
||||
toolTip.style.top = param.point.y + 'px';
|
||||
toolTip.innerHTML += `<div>POS:${tradeDetails.get(param.time).position_qty}/${buy_price}</div><div>T:${tradeDetails.get(param.time).qty}/${data.value}</div>`;
|
||||
|
||||
//inspirace
|
||||
// toolTip.innerHTML = `<div style="color: ${'#2962FF'}">Apple Inc.</div><div style="font-size: 24px; margin: 4px 0px; color: ${'black'}">
|
||||
// ${Math.round(100 * price) / 100}
|
||||
// </div><div style="color: ${'black'}">
|
||||
// ${dateStr}
|
||||
// </div>`;
|
||||
|
||||
|
||||
// Position tooltip according to mouse cursor position
|
||||
toolTip.style.left = param.point.x+120 + 'px';
|
||||
toolTip.style.top = param.point.y + 'px';
|
||||
}
|
||||
//});
|
||||
}
|
||||
//});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
chart.subscribeClick(param => {
|
||||
$('#trade-timestamp').val(param.time)
|
||||
@ -638,7 +610,7 @@ function chart_archived_run(archRecord, data, oneMinuteBars) {
|
||||
|
||||
|
||||
//add status
|
||||
$("#statusRegime").text("ARCHIVED RUN")
|
||||
$("#statusRegime").text("PAST RUN: "+archRecord.id)
|
||||
$("#statusName").text(archRecord.name)
|
||||
$("#statusMode").text(archRecord.mode)
|
||||
$("#statusAccount").text(archRecord.account)
|
||||
|
||||
@ -175,7 +175,7 @@ var archiveRecords =
|
||||
],
|
||||
paging: false,
|
||||
processing: false,
|
||||
columnDefs: [ {
|
||||
columnDefs: [{
|
||||
targets: [0,1],
|
||||
render: function ( data, type, row ) {
|
||||
return '<div class="tdnowrap" title="'+data+'">'+data+'</i>'
|
||||
@ -198,13 +198,62 @@ var archiveRecords =
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
{
|
||||
targets: [9,10],
|
||||
render: function ( data, type, row ) {
|
||||
//market datetime
|
||||
return format_date(data, true)
|
||||
},
|
||||
},
|
||||
{
|
||||
targets: [2],
|
||||
render: function ( data, type, row ) {
|
||||
return '<div class="tdname" title="'+data+'">'+data+'</i>'
|
||||
},
|
||||
},
|
||||
{
|
||||
targets: [4],
|
||||
render: function ( data, type, row ) {
|
||||
return '<div class="tdnote" title="'+data+'">'+data+'</i>'
|
||||
},
|
||||
},
|
||||
{
|
||||
targets: [11],
|
||||
render: function ( data, type, row ) {
|
||||
//if ilog_save true
|
||||
if (data) {
|
||||
return '<span class="material-symbols-outlined">done_outline</span>'
|
||||
}
|
||||
else {
|
||||
return null
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
targets: [8],
|
||||
render: function ( data, type, row ) {
|
||||
//if ilog_save true
|
||||
if (data == "ACCOUNT1") {
|
||||
res="ACC1"
|
||||
}
|
||||
else if (data == "ACCOUNT2") {
|
||||
res="ACC2"
|
||||
}
|
||||
else { res=data}
|
||||
return res
|
||||
},
|
||||
},
|
||||
{
|
||||
targets: [7],
|
||||
render: function ( data, type, row ) {
|
||||
//if ilog_save true
|
||||
if (data == "backtest") {
|
||||
res="bt"
|
||||
}
|
||||
else { res=data}
|
||||
return res
|
||||
},
|
||||
}
|
||||
],
|
||||
order: [[6, 'desc']],
|
||||
// paging: true,
|
||||
@ -216,4 +265,7 @@ var archiveRecords =
|
||||
// $(row).addClass('highlight');
|
||||
// }
|
||||
//}
|
||||
} );
|
||||
} );
|
||||
|
||||
|
||||
|
||||
@ -6,19 +6,19 @@ function store_api_key(event) {
|
||||
}
|
||||
|
||||
function get_status(id) {
|
||||
var status = "stopped"
|
||||
var status = ""
|
||||
runnerRecords.rows().iterator('row', function ( context, index ) {
|
||||
var data = this.row(index).data();
|
||||
//window.alert(JSON.stringify(data))
|
||||
if (data.strat_id == id) {
|
||||
//window.alert("found");
|
||||
if ((data.run_mode) == "backtest") { status_detail = data.run_mode}
|
||||
if ((data.run_mode) == "backtest") { status_detail = '<span>'+data.run_mode+'</span>'}
|
||||
else { status_detail = data.run_mode + " | " + data.run_account}
|
||||
if (data.run_paused == null) {
|
||||
status = "running | "+ status_detail
|
||||
status = '<span class="material-symbols-outlined">play_circle</span>'+status_detail
|
||||
}
|
||||
else {
|
||||
status = "paused | "+ status_detail
|
||||
status = '<span class="material-symbols-outlined">pause_circle</span>'+ status_detail
|
||||
}}
|
||||
//window.alert("found") }
|
||||
});
|
||||
@ -423,7 +423,7 @@ var stratinRecords =
|
||||
targets: 12,
|
||||
render: function ( data, type, row ) {
|
||||
var status = get_status(data)
|
||||
return '<i class="fas fa-check-circle">'+status+'</i>'
|
||||
return status
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@ -32,11 +32,13 @@ legendlist.appendChild(firstRow);
|
||||
|
||||
function update_chart_legend(param) {
|
||||
|
||||
function name(val) {
|
||||
return '<div class="legendItemName">' + val + '</>'
|
||||
function name(val, color = null) {
|
||||
color = (color)?' style="color: '+ color + ';"' : "";
|
||||
return '<div class="legendItemName" ' + color + '>' + val + '</>'
|
||||
}
|
||||
function val(val) {
|
||||
return '<div class="legendItemValue">' + val + '</>'
|
||||
function val(val, color = null) {
|
||||
color = (color)?' style="color: '+ color + ';"' : "";
|
||||
return '<div class="legendItemValue" ' + color + '>' + val + '</>'
|
||||
}
|
||||
|
||||
if (param.time) {
|
||||
@ -44,24 +46,29 @@ function update_chart_legend(param) {
|
||||
//BASIC INDICATORS
|
||||
const bars = param.seriesData.get(candlestickSeries);
|
||||
if (bars !== undefined) {
|
||||
firstRow.innerHTML += name("O") + val(bars.open) + name("H") + val(bars.high) + name("L") + val(bars.low) + name("C") + val(bars.close)
|
||||
//console.log(JSON.stringify(candlestickSeries.options()))
|
||||
var color = candlestickSeries.options().upColor;
|
||||
firstRow.innerHTML += name("O", color) + val(bars.open) + name("H", color) + val(bars.high) + name("L", color) + val(bars.low) + name("C") + val(bars.close)
|
||||
}
|
||||
|
||||
const volumes = param.seriesData.get(volumeSeries);
|
||||
if (volumes !== undefined) {
|
||||
firstRow.innerHTML += name("Vol") +val(volumes.value)
|
||||
var color = volumeSeries.options().color;
|
||||
firstRow.innerHTML += name("Vol", color) +val(volumes.value)
|
||||
}
|
||||
const data = param.seriesData.get(vwapSeries);
|
||||
if (data !== undefined) {
|
||||
var color = vwapSeries.options().color;
|
||||
const vwap = data.value !== undefined ? data.value : data.close;
|
||||
firstRow.innerHTML += name('vwap') + val(vwap.toFixed(2))
|
||||
firstRow.innerHTML += name('vwap', color) + val(vwap.toFixed(2))
|
||||
}
|
||||
//ADDITIONAL CUSTOM INDICATORS
|
||||
//iterate of custom indicators dictionary to get values of custom lines
|
||||
// var customIndicator = {name: key, series: null}
|
||||
indList.forEach(function (item) {
|
||||
var ind = param.seriesData.get(item.series)
|
||||
if (ind !== undefined) { firstRow.innerHTML += name(item.name) + val(ind.value.toFixed(3))}
|
||||
var color = item.series.options().color;
|
||||
if (ind !== undefined) { firstRow.innerHTML += name(item.name, color) + val(ind.value.toFixed(3), color)}
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
||||
@ -1,17 +1,19 @@
|
||||
/* :root {
|
||||
--dt-row-selected: 18, 143, 175;
|
||||
--dt-row-selected: 140,142,141;
|
||||
} */
|
||||
:root {
|
||||
--dt-row-selected: 140,142,141;
|
||||
--dt-row-selected: 56,95,126;
|
||||
--dt-row-selected-text: 173,181,189;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] {
|
||||
color-scheme: dark;
|
||||
--bs-body-color: #adb5bd;
|
||||
--bs-body-color: #787b86;
|
||||
--bs-body-color-rgb: 173,181,189;
|
||||
--bs-body-bg: #2a2e39;
|
||||
--bs-body-bg-rgb: 33,37,41;
|
||||
--bs-emphasis-color: #fff;
|
||||
--bs-emphasis-color: #adb5bd;
|
||||
--bs-emphasis-color-rgb: 255,255,255;
|
||||
--bs-secondary-color: rgba(173, 181, 189, 0.75);
|
||||
--bs-secondary-color-rgb: 173,181,189;
|
||||
@ -58,6 +60,23 @@
|
||||
--bs-form-invalid-border-color: #ea868f;
|
||||
}
|
||||
|
||||
.form-label {
|
||||
margin-top: 0.5em;
|
||||
color: var(--bs-emphasis-color);
|
||||
}
|
||||
.form-check {
|
||||
display: block;
|
||||
min-height: 2.5rem;
|
||||
padding-left: 1.5em;
|
||||
margin-left: 0.25rem;
|
||||
}
|
||||
|
||||
.h4, h4 {
|
||||
font-size: 1.4rem;
|
||||
color: var(--bs-emphasis-color);
|
||||
font-weight: 200;
|
||||
}
|
||||
|
||||
tbody, td, tfoot, th, thead, tr {
|
||||
border-color: #7d7d8a;
|
||||
border-style: solid;
|
||||
@ -77,6 +96,32 @@ table.dataTable thead th, table.dataTable thead td, table.dataTable tfoot th, ta
|
||||
color: #787b86;
|
||||
}
|
||||
|
||||
table.dataTable thead>tr>th.sorting, table.dataTable thead>tr>th.sorting_asc, table.dataTable thead>tr>th.sorting_desc, table.dataTable thead>tr>th.sorting_asc_disabled, table.dataTable thead>tr>th.sorting_desc_disabled, table.dataTable thead>tr>td.sorting, table.dataTable thead>tr>td.sorting_asc, table.dataTable thead>tr>td.sorting_desc, table.dataTable thead>tr>td.sorting_asc_disabled, table.dataTable thead>tr>td.sorting_desc_disabled {
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
padding-right: 10px;
|
||||
font-size: xx-small;
|
||||
}
|
||||
|
||||
table.dataTable thead>tr>th.sorting:before, table.dataTable thead>tr>th.sorting:after, table.dataTable thead>tr>th.sorting_asc:before, table.dataTable thead>tr>th.sorting_asc:after, table.dataTable thead>tr>th.sorting_desc:before, table.dataTable thead>tr>th.sorting_desc:after, table.dataTable thead>tr>th.sorting_asc_disabled:before, table.dataTable thead>tr>th.sorting_asc_disabled:after, table.dataTable thead>tr>th.sorting_desc_disabled:before, table.dataTable thead>tr>th.sorting_desc_disabled:after, table.dataTable thead>tr>td.sorting:before, table.dataTable thead>tr>td.sorting:after, table.dataTable thead>tr>td.sorting_asc:before, table.dataTable thead>tr>td.sorting_asc:after, table.dataTable thead>tr>td.sorting_desc:before, table.dataTable thead>tr>td.sorting_desc:after, table.dataTable thead>tr>td.sorting_asc_disabled:before, table.dataTable thead>tr>td.sorting_asc_disabled:after, table.dataTable thead>tr>td.sorting_desc_disabled:before, table.dataTable thead>tr>td.sorting_desc_disabled:after {
|
||||
position: absolute;
|
||||
display: block;
|
||||
opacity: 0.525;
|
||||
right: 4px;
|
||||
line-height: 9px;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
table.dataTable thead>tr>th.sorting_asc:before, table.dataTable thead>tr>th.sorting_desc:after, table.dataTable thead>tr>td.sorting_asc:before, table.dataTable thead>tr>td.sorting_desc:after {
|
||||
opacity: 1;
|
||||
}
|
||||
.tdnote {
|
||||
width: 188px;
|
||||
}
|
||||
|
||||
.tdname {
|
||||
width: 140px;
|
||||
}
|
||||
|
||||
.secondary-bg {
|
||||
--bs-bg-opacity: 1;
|
||||
background-color: #414749;
|
||||
@ -101,6 +146,8 @@ table.dataTable thead th, table.dataTable thead td, table.dataTable tfoot th, ta
|
||||
--bs-gradient: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* .btn-outline-success {
|
||||
--bs-btn-color: #316164;
|
||||
--bs-btn-border-color: #247e85;
|
||||
@ -177,7 +224,7 @@ html {
|
||||
z-index: 1;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
font-weight: 300;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.legendItemName {
|
||||
@ -260,7 +307,7 @@ pre {
|
||||
}
|
||||
|
||||
.highlighted {
|
||||
font-weight: bold;
|
||||
color: var(--bs-emphasis-color);
|
||||
}
|
||||
|
||||
.switcher {
|
||||
@ -279,7 +326,7 @@ pre {
|
||||
padding: 6px 8px;
|
||||
font-size: 14px;
|
||||
color: #262b3e;
|
||||
background-color: transparent;
|
||||
background-color: #818581;
|
||||
margin-right: 8px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
@ -299,4 +346,12 @@ pre {
|
||||
.switcher-active-item,
|
||||
.switcher-active-item:hover {
|
||||
background-color: #e1eff9;
|
||||
}
|
||||
|
||||
.material-symbols-outlined {
|
||||
font-variation-settings:
|
||||
'FILL' 0,
|
||||
'wght' 300,
|
||||
'GRAD' 0,
|
||||
'opsz' 24
|
||||
}
|
||||
Binary file not shown.
@ -224,7 +224,15 @@ class Strategy:
|
||||
self.before_iteration()
|
||||
ted = datetime.fromtimestamp(self.state.time).astimezone(zoneNY)
|
||||
if is_open_rush(ted, self.open_rush) or is_close_rush(ted, self.close_rush):
|
||||
print("Rush hour - skipping")
|
||||
#self.state.ilog(e="Rush hour - skipping")
|
||||
#identifikatory jsou ulozeny vektorove, tzn. kdyz nejdeme dovnitr iterace(tak nepotrebujeme prazdny cas pro tuto iteraci)
|
||||
#hodnoty time a identifikatoru musi byt stejne
|
||||
#TBD pripdane predelat a dodelat pro CBARy az je budu pouzivat
|
||||
if self.rectype == RecordType.BAR:
|
||||
self.state.indicators['time'].pop()
|
||||
elif self.rectype == RecordType.CBAR:
|
||||
print("RUSH skipping NOT IMPLEMENTED for CBARs yet")
|
||||
|
||||
else:
|
||||
self.next(item, self.state)
|
||||
self.after_iteration(item)
|
||||
|
||||
Reference in New Issue
Block a user