Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Superimposed Charts #467

Answered by kernc
kaleming asked this question in Q&A
Sep 17, 2021 · 3 comments · 4 replies
Discussion options

Hi @kernc,

I found very cool this option you provide to visualize superimposed charts.

I would like to know, if it is possible to accomplish other time frames combinations as well ? (1 min & 5 min / 3 min & 15 min / 5 min & 15 min). Even if I had to provide df1 and df2 already resampled.

You must be logged in to vote

You could, e.g., resample original df to '3T' (3 min) and pass bt.plot(..., superimpose='15T')?

Other than that, you could roll as many as you want of your own line indicators:

 ...
 def resample(period, df):
 return df.Open.resample(period).first(), df.Close.resample(period).last()
 self.resampled15t = self.I(resample, '15T', self.data.df, overlay=True)
 ...

Replies: 3 comments 4 replies

Comment options

You could, e.g., resample original df to '3T' (3 min) and pass bt.plot(..., superimpose='15T')?

Other than that, you could roll as many as you want of your own line indicators:

 ...
 def resample(period, df):
 return df.Open.resample(period).first(), df.Close.resample(period).last()
 self.resampled15t = self.I(resample, '15T', self.data.df, overlay=True)
 ...
You must be logged in to vote
0 replies
Answer selected by kaleming
Comment options

Hi @kernc, thanks for your reply.

It seems to be working now.

I just have a doubt.

  • I noticed when using 3T with 15T, I can' t visualize only the higher frame when scroll to zoom in, zoom out (in your example with daily data I can see only the higher frame when I zoom in, zoom out). It it possible to modify the colors_lighter parameter to make it easy to visualize the higher frame as well?
You must be logged in to vote
1 reply
Comment options

If you're as zoomed out to not distinguish the superimposed bars, you won't distinguish the main bars if you make the superimposed colors any less light. I think the defaults are reasonable.

You can quite easily change the colors in your own copy, at this place:

colors_lighter = [lightness(BEAR_COLOR, .92),
lightness(BULL_COLOR, .92)]

I'd appreciate a screenshot. 😜

Comment options

Hi @kernc, thanks again.

During the zoom in transition using your website example with daily and monthly superimposed data, it appears good as below:

image_1

When I try to zoom in my 3T / 15T chart, the transition appears like this:

image_2

Although both of them works fine after finish zooming transition:

image_3

I will try to change some lightness parameters just to see if works fine for my case.

Thanks a lot for your help;

You must be logged in to vote
3 replies
Comment options

I will probably explore some combination like this:

Comment options

When I try to zoom in my 3T / 15T chart, the transition appears like this:

image_2

Although both of them works fine after finish zooming transition

The level-of-detail change is from Bokeh:

the plot only draws a small fraction of data points during interactive operations (panning or zooming, for example)

Comment options

Thanks again @kernc . I didn`t know about these parameters.
I will have a look on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /