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) "가 추가된 거래소 객체 인덱스 (exchange object index) "가 처음 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)