0
Follow
1
Followers
OKEX模拟盘
实盘配置了ETH
代码如下 也设置了 模拟盘啥的
//设置为模拟仓
exchanges[0].IO("simulate", true)
//设置为永续合约
exchanges[0].SetContractType("swap")
// 读取当前行情信息
var ticker0 = exchanges[0].GetTicker()
Log("High:", ticker0.High, "Low:", ticker0.Low, "Sell:", ticker0.Sell, "Buy:", ticker0.Buy, "Last:", ticker0.Last, "Volume:", ticker0.Volume)
var position0 = exchanges[0].GetPosition()
if (position0.length > 0) {
Log("永续合约 exchanges[0] Amount:", position0[0].Amount, "FrozenAmount:", position0[0].FrozenAmount, "Price:",position0[0].Price, "Profit:", position0[0].Profit, "Type:", position0[0].Type,
"ContractType:", position0[0].ContractType)
} else {
Log("持仓为空")
}
var account = exchange.GetAccount()
Log("账户信息,Balance:", account.Balance, "FrozenBalance:", account.FrozenBalance, "Stocks:",
account.Stocks, "FrozenStocks:", account.FrozenStocks)
Related Recommendations
How to Specify Different Versions of Data for the Rented Strategy by Its Rental Code MetadataAdvanced Tutorial for FMZ Quant platform Strategy WritingElementary Tutorial for FMZ Quant platform Strategy WritingGet Started with FMZ Quant PlatformSECURITY BUGI keep getting error: Exchange_GetAccount: Invalid ContractTypeWe have an incredibly profitable market making algorithm for sideways markets on Bitmex - but need expert to help eliminate wait times during downward volatility in the marketError with deribitLimitations of the backtesting engineHow to install ta-lib on linux docker?
Comment
All comments (3)
- 1



