Function adjustOrderFlowResolution

  • Adjusts the resolution of orderflow data by rebinning price levels based on a specified tick size and multiplier.

    Parameters

    • orderflowTrades: {
          [price: number]: OrderFlowRow;
      }
    • tickSize: number

      The smallest price increment for the instrument.

    • tickMultiplier: number

      A multiplier to adjust the tick size, effectively determining the new bin size for price levels.

    Returns {
        [normalisedPrice: number]: OrderFlowRow;
    }

    A new object with adjusted price levels (normalised prices) as keys and aggregated OrderFlowRow objects as values.

    Example

    const originalData = {
    "100.1": { volSumAsk: 100, volSumBid: 150 },
    "100.2": { volSumAsk: 200, volSumBid: 180 },
    "100.3": { volSumAsk: 150, volSumBid: 120 }
    };
    const adjustedData = adjustOrderFlowResolution(originalData, 0.1, 5);
    // Returns: {
    // "100": { volSumAsk: 450, volSumBid: 450 }
    // }

    Remarks

    This function is optimised for performance, using a traditional for loop and avoiding unnecessary object creation. It's particularly useful for adjusting the granularity of orderflow data, which can be helpful for analysis at different price resolutions.

Generated using TypeDoc