Type/to search
0
Follow
0
Followers
Como você obtém os dados de backtesting do Balance?
Help
Created 2022-07-23 22:05:11  Updated 2022-07-24 08:47:41
 10
 1245

Ambiente de ressonância simulado

Como é calculado o valor do Balance?

O capital inicial é de 50000, 100 vezes o nível de alavancagem, o capital inicial de abertura é de 500%, a garantia de ocupação deveria ser teoricamente de 5%, o usdt disponível deveria ser o capital inicial de 95%, e os dados impressos são de 3937

Related Recommendations
Comment
All comments (10)

    初始资金*开仓5倍 = 50000 * 5 = 250000 ,100杠杆,即保证金使用开仓规模的1/100 , 即2500。
    img
    img

    function main() { exchange.SetContractType("swap") exchange.SetMarginLevel(100) var acc = exchange.GetAccount() Log(acc) //下单 var t = exchange.GetTicker() exchange.SetDirection("buy") exchange.Buy(t.Sell + 1000, acc.Balance * 5 / t.Last) Log(exchange.GetAccount()) }

    Balance是当前可用保证金。偏差考虑资金费率因素。

    4 years ago

    img

    盈利越高,Balance数值越低

    4 years ago

    这边测试正常的,您在具体看下。

    4 years ago

    '''backtest
    start: 2021-09-25 00:00:00
    end: 2021-10-25 23:59:00
    period: 1d
    basePeriod: 1h
    exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
    '''

    def main():
    exchange.SetContractType("swap")
    exchange.SetMarginLevel(100)

    acc = exchange.GetAccount()
    t = exchange.GetTicker()
    exchange.SetDirection("buy")
    exchange.Buy(t.Sell + 1000, acc.Balance * 5 / t.Last)

    while True:
    acc = exchange.GetAccount()
    pos = exchange.GetPosition()
    Log("Account.Balance: {}, Position.Profit: {}".format(acc.Balance, pos[0].Profit))
    Sleep(3600000*8)

    麻烦帮忙看看,我这代码是否有问题

    4 years ago

    币安期货有资金费率(回测也有),考虑下。

    4 years ago

    我的意思是赚钱了,可用保证金应该是放大的,被扣除的资金费率不可能超过盈利数据

    4 years ago

    平仓才有。

    4 years ago

    好的,蟹蟹

    4 years ago

    class Trade():
    def init(self):
    exchange.SetContractType("swap")
    exchange.SetMarginLevel(100)

    def OnOrder(self):
    acc = exchange.GetAccount()
    t = exchange.GetTicker()
    exchange.SetDirection("buy")
    exchange.Buy(t.Sell + 1000, acc.Balance * 5 / t.Last)
    Log(acc)

    def main():
    trade = Trade()
    trade.OnOrder()

    while True:
    acc = exchange.GetAccount()
    pos = exchange.GetPosition()
    Log("Account.Balance: {}, Position.Profit: {}".format(acc.Balance, pos[0].Profit))
    Sleep(3600000*8) img 盈利越高,Balance数值怎么会越低

    4 years ago

    蟹蟹,我这边查看一下

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