Programming My Own Trading Chart - Part 23 - Back History

Screenshot_20230427_003430.png

Automatic calculation of price back history is now implemented. When the chart starts up, it checks the state in the config, which contains the price history (if any), and if the chart has any indicators. If the data exists for these, it will draw the graphs along with the price history (candles).

However, if the indicator is empty, having no price history, it will then automatically calculate the indicator back history from the existing price history.

What is yet to be implemented is executing the indicator back history calculations when new back history is loaded into the chart.

The beginnings of this is now there, between calculation of live price history and back history on chart start up. However, I have to implement a method that differentiates between new chart data being live data or historic data. I won't be hard to do. I just have to think things through and logically plan it out.

When this is implemented, it will allow for the dynamic loading of price history once the chart scrolls to the end of the range. This will emit an event that can be subscribed to, allowing the callback to invoke an api call to the exchange (or other data source, such as a database) and fetch a new batch of price records, and then call the chat's api to load the new data, which then triggers the indicator calculation (if required).

Screenshot_20230427_005810.png

The chart has already been a year in development, but I'm finally seeing progress towards something that has the features one comes to expect of a modern trading chart that one can use for trading.

If my aim was to produce something for purely looking at static history, I could have been finished long ago. This chart is a very dynamic beast, which means there's a good deal of complexity under the hood.

I'm watching the development of the few of the other open source trade charts that exist. They also have their challenges in building a trade chart. Trade charts are complex and challenging beasts.

Progress takes it's time because it is a very difficult challenge, but one that is very worthwhile if you persist and see it through.

Sort:  

It is a very important feature you are working on, Hive-Engine and other DEXs should have features like we see in CEXs.

!LUV

I would like to work with some DEXs. If they would find something like TradeX-chart useful that would be great.

I've used a "universal" exchange api, CCXT in my trading desk that I'm developing. But I don't believe they support DEXs yet.

I'd like to see a similar library for DEX's and more overall support for them. We need them as governments move in with their regulators to throttle crypto.

I hope in future Hive's DEXs would have such intrinsic features and tools that may help traders. Currently, there is a simple charts with daily and hourly graph and it does not update so accurately.

I think DEX creators may like your work and try to inject it in their API's.