计算可开仓手数问题
已经在Vars区域:定义了结构变量OnInit:获取合约信息和默认保证金率Bool contractRet = False; contractRet = GetSymbolInfo(Symbol, symInfo); Bool marginRet = GetMarginRate(Symbol, mRate); 但是没有的获取到是啥问题?
已经在Vars区域:定义了结构变量OnInit:获取合约信息和默认保证金率Bool contractRet = False; contractRet = GetSymbolInfo(Symbol, symInfo); Bool marginRet = GetMarginRate(Symbol, mRate); 但是没有的获取到是啥问题?
你是怎么得出没有获取到这个结论的
回复:Commentary,# 合约乘数: 0(初始化时获取) # 多头保证金率: 0%(初始化时获取) # 空头保证金率: 0%(初始化时获取)
回复:Vars Series<Numeric> calculatedLots; Integer globalContractUnit(0); Numeric globalLongMarginRate(0); Numeric globalShortMarginRate(0); Events OnInit() globalContractUnit = ContractUnit(); MarginRate mRate; Bool ret = A_GetMarginRate(Symbol, mRate); If (ret) { globalLongMarginRate = mRate.longMarginRatio; globalShortMarginRate = mRate.shortMarginRatio; }Commentary输出的信息:# 合约乘数: 0(初始化时获取) # 多头保证金率: 0%(初始化时获取) # 空头保证金率: 0%(初始化时获取)。而且运行策略时初始化明显感觉卡顿了一下。大佬给看看是不是代码有问题