exchange.SetPrecision()
函数用于设置exchange
交易所对象的价格与下单量的精度,设置后系统将自动忽略超出精度的数据部分。
exchange.SetPrecision(pricePrecision, amountPrecision)
pricePrecision
参数用于控制价格数据的精度。
pricePrecision
true
number
amountPrecision
参数用于控制下单量数据的精度。
amountPrecision
true
number
function main(){
// 设置价格小数位精度为2位,品种下单量小数位精度为3位
exchange.SetPrecision(2, 3)
}
def main():
exchange.SetPrecision(2, 3)
void main() {
exchange.SetPrecision(2, 3);
}
设置价格精度和下单量精度。
回测系统不支持此函数,回测系统的数值精度将自动处理。pricePrecision
和amountPrecision
参数必须为整数类型。
{@fun/Trade/exchange.Buy exchange.Buy}, {@fun/Trade/exchange.Sell exchange.Sell}