The resource loading... loading...

exchange.SetPrecision

exchange.SetPrecision() function is used to set the precision of the exchange exchange object price and order amount, after setting, the system will ignore the excess data automatically.

exchange.SetPrecision(pricePrecision, amountPrecision)

The pricePrecision parameter is used to control the precision of the price data. pricePrecision true number The amountPrecision parameter is used to control the precision of the amount of data to be ordered. amountPrecision true number

function main(){
    // Set the decimal precision of price to 2 bits, and the decimal precision of variety order amount to 3 bits
    exchange.SetPrecision(2, 3)
}
def main():
    exchange.SetPrecision(2, 3)
void main() {
    exchange.SetPrecision(2, 3);
}

The backtesting system does not support this function, and the numerical accuracy of the backtesting system is handled automatically.

{@fun/Trade/exchange.Buy exchange.Buy}, {@fun/Trade/exchange.Sell exchange.Sell}

exchange.GetHistoryOrders exchange.SetRate