@@ -96,6 +96,7 @@ function normalisePoints(points: PositionChartPoint[]) {
9696function getMarkerTrades ( trades : TradeInfo [ ] , tradePathBase : string ) {
9797 return trades
9898 . filter ( ( trade ) => ! trade . repaired_at )
99+ . filter ( ( trade ) => ! trade . isRepair )
99100 . filter ( ( trade ) => {
100101 const plannedQuantity = trade . planned_quantity ;
101102 const executedQuantity = trade . executed_quantity ?? 0 ;
@@ -114,7 +115,7 @@ function getMarkerTrades(trades: TradeInfo[], tradePathBase: string) {
114115 directionLabel : trade . direction === TradeDirections . Enter ? 'Increase' : 'Decrease' ,
115116 quantity : trade . executed_quantity ?? trade . planned_quantity ?? null ,
116117 price : trade . executed_price ?? null ,
117- tradeValueUsd : trade . value ,
118+ tradeValueUsd : getTradeValueUsd ( trade ) ,
118119 tradeUrl : `${ tradePathBase } /trade-${ trade . trade_id } `
119120 }
120121 ] ;
@@ -163,3 +164,8 @@ function getNearestPoint(points: PositionChartPoint[], timestamp: number) {
163164function getTradeTimestamp ( trade : TradeInfo ) {
164165 return trade . executed_at ?? trade . failed_at ?? trade . started_at ?? trade . opened_at ?? null ;
165166}
167+
168+ function getTradeValueUsd ( trade : TradeInfo ) {
169+ const reserveValue = Math . abs ( trade . executed_reserve || trade . planned_reserve || 0 ) ;
170+ return reserveValue || trade . value ;
171+ }
0 commit comments