Symbol.PipValue
property · Symbol · cAlgo.API.Internals
DesktopCLICloud
Gets the monetary value of one pip. This is the monetary value of one pip of the symbol when you started your cBot or initialized your indicator. Its not updated in real time and it remains constant.
Definition
double PipValue {get;}
api.Symbol.PipValue: float
Returns double
Examples
var riskAmount = Account.Balance * 0.01;
var stopLossPips = 20;
var volume = Symbol.NormalizeVolumeInUnits(riskAmount / (stopLossPips * Symbol.PipValue), RoundingMode.Down);
Print("Volume risking 1% with a {0} pips stop loss: {1}", stopLossPips, volume);
riskAmount = api.Account.Balance * 0.01
stopLossPips = 20
volume = api.Symbol.NormalizeVolumeInUnits(riskAmount / (stopLossPips * api.Symbol.PipValue), RoundingMode.Down)
api.Print(f"Volume risking 1% with a {stopLossPips} pips stop loss: {volume}")