feat: enhance strategy simulation with Inverse Perpetual support, effective leverage caps, and advanced charting

This commit is contained in:
DiTus
2026-03-03 23:07:03 +01:00
parent 50c525a0bd
commit 9883d1bea9
3 changed files with 375 additions and 134 deletions

View File

@ -22,6 +22,7 @@ constructor() {
this.summarySignal = null;
this.lastCandleTimestamp = null;
this.simulationMarkers = [];
this.avgPriceSeries = null;
this.init();
}
@ -35,6 +36,18 @@ constructor() {
this.simulationMarkers = [];
this.updateSignalMarkers();
}
setAvgPriceData(data) {
if (this.avgPriceSeries) {
this.avgPriceSeries.setData(data || []);
}
}
clearAvgPriceData() {
if (this.avgPriceSeries) {
this.avgPriceSeries.setData([]);
}
}
init() {
this.createTimeframeButtons();
@ -128,6 +141,16 @@ constructor() {
lastValueVisible: false,
priceLineVisible: false,
}, 0);
this.avgPriceSeries = this.chart.addSeries(LightweightCharts.LineSeries, {
color: '#00bcd4',
lineWidth: 1,
lineStyle: LightweightCharts.LineStyle.Solid,
lastValueVisible: true,
priceLineVisible: false,
crosshairMarkerVisible: false,
title: '',
});
this.currentPriceLine = this.candleSeries.createPriceLine({
price: 0,