Skip to main content

response_position_pl_ratio_for_trade_read

Function response_position_pl_ratio_for_trade_read 

Source
pub fn response_position_pl_ratio_for_trade_read(
    raw_ratio: Option<f64>,
    _price: f64,
    _cost_price: f64,
    _position_side: i32,
) -> Option<f64>
Expand description

Preserve C++ Trd_GetPositionList P/L ratio semantics.

C++ APIServer_Trd_GetPositionList.cpp:83-97 writes fDilutedPLRatio / fAveragePLRatio straight into the FTAPI response. The lower real/sim parsers already normalize backend-specific wire forms before the APIServer layer. Do not infer units from price/cost here: real accounts have shown cases where that heuristic expands the public response by 100x versus C++.