mirror of
https://github.com/freqtrade/frequi.git
synced 2024-09-21 10:01:09 +00:00
Support not having an exit column
This commit is contained in:
parent
9d7748b504
commit
de50ed88d9
|
@ -280,7 +280,15 @@ export default defineComponent({
|
|||
y: colBuyData,
|
||||
},
|
||||
},
|
||||
{
|
||||
],
|
||||
};
|
||||
|
||||
if (colSellData >= 0) {
|
||||
if (!Array.isArray(chartOptions.value?.legend) && chartOptions.value?.legend?.data) {
|
||||
chartOptions.value.legend.data.push('Long exit');
|
||||
}
|
||||
if (Array.isArray(options.series)) {
|
||||
options.series.push({
|
||||
name: 'Long exit',
|
||||
type: 'scatter',
|
||||
symbol: 'diamond',
|
||||
|
@ -294,17 +302,22 @@ export default defineComponent({
|
|||
x: colDate,
|
||||
y: colSellData,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (hasShorts) {
|
||||
// Add short support
|
||||
if (!Array.isArray(chartOptions.value?.legend) && chartOptions.value?.legend?.data) {
|
||||
if (colShortEntryData >= 0) {
|
||||
chartOptions.value.legend.data.push('Short');
|
||||
}
|
||||
if (colShortExitData >= 0) {
|
||||
chartOptions.value.legend.data.push('Short exit');
|
||||
}
|
||||
}
|
||||
if (Array.isArray(options.series)) {
|
||||
if (colShortEntryData >= 0) {
|
||||
options.series.push({
|
||||
name: 'Short',
|
||||
type: 'scatter',
|
||||
|
@ -320,6 +333,8 @@ export default defineComponent({
|
|||
y: colShortEntryData,
|
||||
},
|
||||
});
|
||||
}
|
||||
if (colShortExitData >= 0) {
|
||||
options.series.push({
|
||||
name: 'Short exit',
|
||||
type: 'scatter',
|
||||
|
@ -337,6 +352,7 @@ export default defineComponent({
|
|||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Merge this into original data
|
||||
Object.assign(chartOptions.value, options);
|
||||
|
@ -526,7 +542,7 @@ export default defineComponent({
|
|||
animation: false,
|
||||
legend: {
|
||||
// Initial legend, further entries are pushed to the below list
|
||||
data: ['Candles', 'Volume', 'Long', 'Long exit'],
|
||||
data: ['Candles', 'Volume', 'Long'],
|
||||
right: '1%',
|
||||
},
|
||||
tooltip: {
|
||||
|
|
Loading…
Reference in New Issue
Block a user