Skip to content
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

working with list of list instead of dataframes #497

Open
Fougl opened this issue Dec 11, 2024 · 1 comment
Open

working with list of list instead of dataframes #497

Fougl opened this issue Dec 11, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Fougl
Copy link

Fougl commented Dec 11, 2024

Description

Hi, I am wondering how difficult it is to change the chart.set and chart.update and chart.update_from_tick to actually accept list of lists? Concatenating to a dataframe gets extremely costly, if dataframe is a bit larger, also for live trading, its concatenating the ticks and calculating continously, which is not optimal.

Code example

No response

Method of implementation

No response

@Fougl Fougl added the enhancement New feature or request label Dec 11, 2024
@EsIstJosh
Copy link

EsIstJosh commented Dec 12, 2024

You could adapt / mimic js_data() in utils.py to work with nested lists instead of dataframes. Take each candle/datapoint's values, create a dictionary like this, put them all into a list (or don't if it's to update the chart) then dump it into json.

LineData = {
	time: Time;
	value: number;
}

CandleData = {
	time: Time;
	high: number;
	low: number;
	close: number;
	open: number;
}

Then just modify the set/update methods in abstract.py to accept your data. Now for the live data, analyze the logic behind the update()/update_from_tick() methods carefully so you can implement your version correctly.

AbstractChart needs it's own implementation of the set/update methods, separate from the ones in SeriesCommon btw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants