@@ -304,6 +304,7 @@ export function generateMockHistory(): HistoryResponse {
304304 realized_return : i > 0 ? ret : null ,
305305 realized_direction : i > 0 ? ( ret > 0 ? "UP" as const : "DOWN" as const ) : null ,
306306 realized_returns : null ,
307+ regime : ( [ "trending" , "mean-reverting" , "volatile" , "quiet" ] as const ) [ i % 4 ] ,
307308 } ) ;
308309 }
309310
@@ -312,5 +313,22 @@ export function generateMockHistory(): HistoryResponse {
312313 live_pf : grossLoss > 0 ? + ( grossProfit / grossLoss ) . toFixed ( 2 ) : null ,
313314 live_win_rate : total > 0 ? + ( wins / total ) . toFixed ( 4 ) : null ,
314315 live_num_trades : total ,
316+ session_stats : {
317+ n_trades : total ,
318+ n_wins : wins ,
319+ n_losses : total - wins ,
320+ n_flat : 31 - total ,
321+ total_pnl_pts : + ( cumPnl * BASE_PRICE ) . toFixed ( 2 ) ,
322+ best_trade_pts : + ( grossProfit * BASE_PRICE / Math . max ( wins , 1 ) ) . toFixed ( 2 ) ,
323+ worst_trade_pts : + ( - grossLoss * BASE_PRICE / Math . max ( total - wins , 1 ) ) . toFixed ( 2 ) ,
324+ current_streak : wins > total - wins ? 2 : 1 ,
325+ streak_type : wins > total - wins ? "W" as const : "L" as const ,
326+ regime_breakdown : {
327+ trending : { n : 5 , wins : 3 , pnl_pts : 8.5 } ,
328+ "mean-reverting" : { n : 4 , wins : 2 , pnl_pts : - 2.0 } ,
329+ volatile : { n : 3 , wins : 1 , pnl_pts : - 4.5 } ,
330+ quiet : { n : 2 , wins : 2 , pnl_pts : 6.0 } ,
331+ } ,
332+ } ,
315333 } ;
316334}
0 commit comments