Skip to content

Symbol.NormalizeVolumeInUnits

method · Symbol · cAlgo.API.Internals

DesktopCLICloud

Round the volume to the amount suitable for a trade.

Definition

double NormalizeVolumeInUnits(double volume, RoundingMode roundingMode)
api.Symbol.NormalizeVolumeInUnits(volume: float, roundingMode: RoundingMode) -> float

Parameters

Name C# type Python type Description
volume double float Amount to normalize
roundingMode RoundingMode RoundingMode Rounding method

Returns double — Normalized volume

Examples

var volume = Symbol.NormalizeVolumeInUnits(12345.67, RoundingMode.Down);
Print("Normalized volume: {0}", volume);
volume = api.Symbol.NormalizeVolumeInUnits(12345.67, RoundingMode.Down)
api.Print(f"Normalized volume: {volume}")