Version 0.34.0 is released. Persistency support, real-time syncing with the exchange, and more!

Version 0.34.0 is released. Persistency support, real-time syncing with the exchange, and more!

2 years agoNews By Saleh

Hi everyone,

Today's release is a big one. But there are no breaking changes to be worried about.

I completely refactored the live mode's calculations to be synced in real-time with the exchange. From now on, the live mode uses the information on the exchange instead of calculating it on our own.

This is a huge deal because it means:

  • No more Jesse and the exchange are out of sync errors which were the result of unexpected events such as issues raising after sudden price surges/crashes in the crypto market.
  • It made it possible for me to implement the persistency feature. Meaning that you can stop Jesse, and start at a later time without closing your positions and orders.
  • Some tricky calculations such as fees or the available margin are now calculated on the exchange instead of on Jesse. This opens the way for implementation of the spot mode. In case you don't know, the main reason I haven't added support for the spot mode was because of how different the calculations are for the spot mode; even worse, I've come to realize that each exchange is doing it differently! But we don't have to worry about that anymore.

Here's the full list of changes:

What's new?

  • [IMPROVEMENTS] Instead of calculating changes in positions and orders, Jesse now uses data on the exchange to stay in sync in real-time.
  • [NEW FEATURE] Added persistency support to the live mode. Jesse is now able to stop and start at a later time without starting from scratch.
  • [NEW FEATURE] Added is_stop_loss and is_take_profit properties to the Order class. Useful for detecting the role of the executed order in methods such as on_close_position().
  • [BREAKING CHANGE] Dependencies are now locked. So from this version forward, doing pip install jesse will force your dependencies to be the same as the current version's requirements. This is to prevent you from installing a different version of the dependencies leading to unexpected behavior.
  • [NEW FEATURE] The position table now displays the liquidation price of the position in the live trading dashboard.
  • [NEW FEATURE] Added has_long_entry_orders and has_short_entry_orders properties to the Strategy class. They are used for knowing the type of entry orders for times that position is not opened yet such as inside the should_cancel() and before() methods and also in filters.
  • [NEW FEATURE] Implemented a "check for newer version" component in the GUI dashboard. So you'll be notified inside the app for newer versions of both the framework and the live plugin. You can skip updates if you choose to.
  • [IMPROVEMENTS] Improved the handling of "PARTIALLY FILLED" orders in the live mode. The new refactor handles them properly, and also you can see in the dashboard the amount of the order that was filled.

Initial Persistency Support

This release brings the initial support for the long-waited persistency support. What persistency means, in this case, is that you can stop Jesse, and start it at a later time without losing your positions and orders. You couldn't do that before because Jesse could only keep track of orders and positions if it was submitted by itself.

As a result of this, you can also start a session with Jesse, and then submit orders manually.

For example, you could open a position using a market order on the exchange, and not only Jesse will pick up on it, but also it'll execute the on_open_position() method (which is a good place for submitting your stop-loss and take-profit orders).

But there are some limitations to which events are supported. In short, if you submitted your orders via Jesse in the first place, stopped Jesse, and started it again, it should be fine for most strategies.

An example of what isn't supported is if you define a custom variable inside your strategy, fill it with some data, stop Jesse, and start it again. Because there will be no way for Jesse to know what was the value of that variable when it was stopped.

If you like Jesse to close positions and orders as it was previously, you can do it by disabling the persistency feature in your settings:

settings-persistency

I have written a post about known situations where persistency is and isn't supported.

Youtube Videos

In case you don't know, I recently released two tutorial videos on my YouTube channel about using Jesse via a remote server that is worth checking out:

I intend to release more videos regularly, so please subscribe to the channel if you haven't already. I highly appreciate comments and likes on the videos as the channel is new and could use your support.

What's next

In every release, I like to include one important new feature/refactor, and a bunch of small ones and bug fixes.

As for the next release's an important feature, I want to add the ability to use the REST API of exchanges for fetching candles in the live mode as a backup for the WebSocket connection.

Happy algo-trading,

— Saleh

❤️ Like Jesse?

If you like this project, please consider supporting me for free by using my referral links.

It's a win-win, you get free discounts and bonuses, and it helps me to develop more features and content:


Thank you 🙏