Type/to search
4
Follow
11
Followers
複数の取引ペアのバックテスト エラー: 製品のサブスクリプションに失敗しました
Help
Created 2022-11-20 13:54:09  
 1
 1294

'''backtest
start: 2022-11-18 00:00:00
end: 2022-11-18 00:01:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"},{"eid":"Futures_Binance","currency":"ETH_USDT"},{"eid":"Futures_Binance","currency":"ETC_USDT"}]
'''

def main():
while True:
Log(exchange.GetAccount())
for r in range(len(exchanges)):
Log ((("の追加された取引所オブジェクトのインデックス (((最初の0は,このように推論):",r",名称:",exchanges[r].GetName (), "タグ:", exchanges (リンク)[r].GetLabel())

exchanges[r].SetDirection("buy")

exchanges[r].Buy ((-1, 10, "開多")

position_cangwei = _C(exchange.GetPosition)

Log(position_cangwei)

Sleep(10000)

策略の最後の5行を残し,エラー:品種サブスクリプションが失敗 BTC_USDT_Futures_Binance
策略の最後の2-5行にコメントを残して,Sleep (((10000),またはミスを逃す:品種登録失敗 BTC_USDT_Futures_Binance
策略の最後の5行を全部注釈すれば,策略は失敗しないが,反省は止まらない.
マルチトレード戦略を学ぶ
img

Related Recommendations
Comment
All comments (1)
    '''backtest start: 2022-11-18 00:00:00 end: 2022-11-18 00:01:00 period: 1m basePeriod: 1m exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"},{"eid":"Futures_Binance","currency":"ETH_USDT"},{"eid":"Futures_Binance","currency":"ETC_USDT"}] ''' def main(): while True: Log(exchange.GetAccount()) for r in range(len(exchanges)): Log("添加的交易所对象索引(第一个为0以此类推):", r, "名称:", exchanges[r].GetName(), "标签:", exchanges[r].GetLabel()) exchanges[r].SetContractType("swap") # 期货要设置合约的 exchanges[r].SetDirection("buy") exchanges[r].Buy(-1, 10, "开多") position_cangwei = _C(exchange.GetPosition) Log(position_cangwei) Sleep(10000)

    期货要设置合约的。

    4 years ago
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)