The application draws the candlestick chart (like TradingView) and Order Book on top of it. Why? Because you cannot use realtime data from CEX to build Order Book indicator on top of the chart on TradingView.
- Xcode 26.2
- Swift 6.2
- SwiftUI
- Swift Charts
The app uses klines, orderbook and rpi_orderbook API from
- Binance
- Bybit
See live charts as TradingView does with realtime order book data.
Take a snapshot of the current chart. It will be stored at app directory, use Folder button to open it.
App needs this because it actually does not record real video, it just stores snapshots of the chart in the loop with a given time interval to not use too much CPU of your MacBook. After that you have to make a video from snapshots. How to do it is described below.
- Select a CEX and USDT pair.
- In the application set settings for the chart timeframe, candles, orderbook density.
- In the application set setting for a refresh interval.
- In the application use
Recordbutton to start record. - Leave the application running for several hours (depends on the timeframe you have selected).
- To stop, use the same button.
- See the result snapshots use
Folderbutton. - Use
ffmpegcli tool to convert snapshots to video.
- Prepare
images.txtfile with
cd /Users/${USER}/Library/Containers/OrderboolChart/Data/tmp/${TOKEN}USDT
# Each image will be shown for 0.5 seconds.
# Then refresh rate is 2 images per second.
# Less images per second more details changes will be visible.
# Be sure that files order is by ascending creation date (from oldest to newest).
for f in *.png; do echo "file '$f'" >> images.txt; echo "duration 0.5" >> images.txt; done- Run to convert a series of images listed in the file to video
ffmpeg -f concat -safe 0 -i ./images.txt -c:v libx264 -crf 10 -pix_fmt yuv420p ./output.mp4


