-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to distinguish between available balance and frozen balance #135
Comments
|
Thanks for your reply. I think your code has given the answer, but I can't find how to call it in the backtest.
|
For now, you'll need to compute it manually due to compatibility with the live bot. You can access state values using |
The order type and time-in-force were not properly handled. This has been fixed at 126ccee. |
In your screenshot, the timestamp is in nanoseconds. I'm not sure what you meant by your question. In the backtesting logic, there is no manipulation of the timestamp unit. It's crucial to ensure that your data (such as feed and order latency) and your code maintain a consistent time unit. The local_timestamp in Order represents the time when the order is requested. Regarding setting the initial balance, I will consider it, but I believe it's something that can be easily managed by the user's code. Adding this feature would complicate the builder code, and it would require setting the balance for each asset individually. I'm not sure where you're having difficulty in computing your total balance, which is your equity value, correct? The following snippet may help you.
However, if you need to calculate something like available margin to open more positions, that depends on the exchange's margin calculation and must be handled on your end. |
When a strategy opens a short position, the short position value is added directly to the balance. How to distinguish between available balance and frozen balance in backtesting?
The text was updated successfully, but these errors were encountered: