Type/to search
Built-in Functions
Global
Log
Market
Trade
Account
Futures
Exchange
exchange.GetName
exchange.GetLabel
exchange.GetCurrency
exchange.SetCurrency
exchange.GetQuoteCurrency
exchange.GetPeriod
exchange.SetMaxBarLen
exchange.SetPrecision
exchange.GetRate
exchange.SetRate
exchange.SetBase
exchange.GetBase
exchange.SetProxy
exchange.SetTimeout
exchange.Encode
IO
Network
Storage
Threads
TA
Talib
OS
Structures
Built-in Variables and Constants
Conventions
Exchanges

Sets the precision of the price and order amount for the exchange object. Once set, the system will automatically ignore any excess portion of the data that exceeds the specified precision.

exchange.SetPrecision(pricePrecision, amountPrecision)

Examples

Set prices to 2 decimal places and order amounts to 3 decimal places.

javascript
function main(){ // Set the price decimal precision to 2 digits and the order amount decimal precision to 3 // digits exchange.SetPrecision(2, 3) }
python
def main(): exchange.SetPrecision(2, 3)
rust
fn main() { // Set the price decimal precision to 2 digits and the order amount decimal precision to 3 // digits exchange.SetPrecision(2, 3); }

Arguments

NameTypeRequiredDescription

pricePrecision

number

Yes

Precision of the price data.

amountPrecision

number

Yes

Precision of the order amount data.

See Also

Remarks

The backtesting system does not support this function; the numerical precision in the backtesting system is handled automatically by the system.