Candle Plot MTF

S

shizah

New member
I asked @RobertPayne if the following is possible: https://www.tradingview.com/chart/EURUSD/CI3qgX6c-Candle-Plot-MTF-Introduction/ He said it is by mentioning that he wrote one at the beginning of the year just to see if he could. The top chart is AAPL 5 min chart with 15 minute overlay. The bottom chart is the same 5 min chart of AAAPL with a 60 min overlay.

Here's the what he came up with:



Robert would be willing to help us out in coding this if there's interest.
 
Last edited by a moderator:
H

horserider

Well-known member
VIP
Warehouse
Why ? If you see 3 declining 5 min candles, hmmm might the 15 min candle be declining. Possibly for a consolidation area it might be useful, like in the bottom chart. When is the hour candle drawn ? Is it at close of the hour time period ? If so what good would it be?
 
S

Steve2286

New member
VIP
Would you be able to add other indicators to chart? or is that too much for TOS
 
markos

markos

Well-known member
VIP
Warehouse
@Steve2286 One thing at a time probably. Actually, after this exercise gets completed, anyone would be able to add whatever studies they wanted to their own chart.
 
Last edited:
markos

markos

Well-known member
VIP
Warehouse
Why ? If you see 3 declining 5 min candles, hmmm might the 15 min candle be declining. Possibly for a consolidation area it might be useful, like in the bottom chart. When is the hour candle drawn ? Is it at close of the hour time period ? If so what good would it be?
@horserider the question is why not? This post came from the tutorial post with Mr. Payne.
The reason why @RobertPayne would be interested in helping with a study like this is that it would help quite a few people that want to learn coding as there are many aspects of the code for this study to be used in others.
The deal is that this community would have to work on producing the code "publicly" and he would tutor as the group works along. That is my understanding from the tutorial post.
@shizah please put fractal boxes in the search bar and see if that is another idea of where you would like to lead this.
 
S

shizah

New member
In my opinion, the biggest reason would be you can cut down on the number of charts. Easier to see what is happening on higher time frames while comparing to the current time frame you are trading in. Overall, I think you would get a much better picture of what is happening in the asset you are trading.

Also, the fact the Robert actually has already coded this leads me to believe that there is tremendous value in this for trading/coding. For him to code this indicator before I even asked him if this would be possible I think speaks volumes.

Markos - I'm not sure about the fractal boxes. I have seen that script before. Never played around with it.

The only scripts I use are the ORB and TMO by Mobius. The other couple I use are native to TOS.
 
RobertPayne

RobertPayne

Member
Also, the fact the Robert actually has already coded this leads me to believe that there is tremendous value in this for trading/coding. For him to code this indicator before I even asked him if this would be possible I think speaks volumes.
I wouldn't read anything into that. I coded it because someone else emailed me and asked if it was possible. As I said, I did it just to see if I could. A personal challenge--nothing more. Once I finished it, I never looked at it again...until you asked about it.

I do a lot of things just to see if I can. It gives me an opportunity to challenge myself and learn.
 
netarchitech

netarchitech

Member
I do a lot of things just to see if I can. It gives me an opportunity to challenge myself and learn.
@RobertPayne I feel the same way...IMO, more people need to adopt this mindset! With that said, thank you again for so generously offering your assistance and expertise to the uTS community...
 
S

skynetgen

Active member
Warehouse
Is there a study which does that or this is just concept?
 
H

Hguru

Member
Hi All,

I am a new member and saw this message sequence and thought I would start the project.

Robert good to see you here as like lots of study addicts I am a big fan, I hope you can help or help others complete the project.

Here are a few studies I found in my index from others from years back who created overlay studies but not as good as the TradingView one but they might be a starting point to get the project moving along as I think the overlay study from TradingView is very cool and could be helpful in seeing the two candle charts in one.

If someone can make them better and closer to the TradingView ones that would be great. I am not a coder more a poor masher so this is my contribution to the project.

Hguru

for candles

Pinto_ OverlayHigherAGPbars

LB_ChartOverlay

For the MACD

Pinto_MACD_Overlay
 
H

Hguru

Member
I shared it with a friend and this is what he send me back as a first crack at it, I just looked it over and put it on a chart

Chart_Overlay for TOS
Code:
input agg = AggregationPeriod.FOUR_HOURS;

plot o = open(period = agg);

plot c = close(period = agg);

o.AssignValueColor(if o > c then Color.Red else Color.Green);

o.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

c.AssignValueColor(if o > c then Color.Red else Color.Green);

c.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

AddCloud(c, o, Color.Green, Color.Red);
 
markos

markos

Well-known member
VIP
Warehouse
@Hguru welcome to useThinkScript! I know you from TSL. Stick around, you are more than a code masher as I have seen what you can do. We have another /CL trader on this site who will make himself known in time I'm sure. Again, welcome!
 
H

Hguru

Member
@markos appreciate the kind words I have had help from a number of great coders who are able to take some of my ideas and turn them into workable indicators but I try. All about giving back.
 
RobertPayne

RobertPayne

Member
I shared it with a friend and this is what he send me back as a first crack at it, I just looked it over and put it on a chart

Chart_Overlay for TOS
Code:
input agg = AggregationPeriod.FOUR_HOURS;
plot o = open(period = agg);
plot c = close(period = agg);
o.AssignValueColor(if o > c then Color.Red else Color.Green);
o.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
c.AssignValueColor(if o > c then Color.Red else Color.Green);
c.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
AddCloud(c, o, Color.Green, Color.Red);
Bravo! This achieves the stated goal of overlaying the higher time period movement onto the chart.



If all you want is to display the relevant information, you can stop right here. However, I feel there is room for improvement. The challenge, and the fun, lies in beautifying the indicator within the constraints of Thinkscript.

Here is my interpretation.



If you zoom in a bit, you will see that the AddCloud() function wants to paint continuously from one candle to the next.



So, the question is, how do you get the paint to stay within the boxes?

Hint: you will need to use more than one AddCloud() statement.
 
H

Hguru

Member
nice ...plus how can we get the wick thing that is done in the TV video
 
RobertPayne

RobertPayne

Member
nice ...plus how can we get the wick thing that is done in the TV video
I haven't seen the video. However, your code above is already plotting open and close price from the higher time period. Simply add in the high and low and format them the way you want. Perhaps plotting them as dots so that they are distinct from the rest of the chart.
 
markos

markos

Well-known member
VIP
Warehouse
Maybe I am missing something, but why don't the clouds go to the bottom of the body in some cases?


For instance, the first and 3rd don't cover the body, but the second TF on Thursday does cover? Thanks.
 
Last edited:
S

skynetgen

Active member
Warehouse
Maybe I am missing something, but why don't the clouds go to the bottom of the body in some cases?


For instance, the first and 3rd don't cover the body, but the second TF on Thursday does cover? Thanks.
Its open vs close (not high vs low)
 
RobertPayne

RobertPayne

Member
Maybe I am missing something, but why don't the clouds go to the bottom of the body in some cases?
Remember, this indicator is plotting the higher period candle. In this case, it is set to show a 60 minute candle overlayed onto a 15 minute chart.

So, the painted areas are only showing the 60 minute open / close price action. In the case of the large red box in the middle, the 60 minute candle would have opened at the same price the first 15 minute candle (of that period) opened. That is shown by the red line at the top.

Then, over the next three 15 minute candles, price moved up then back down (forming what would be the upper wick on a 60 minute chart).

Price moved to a low of the 3rd 15 minute candle before reversing and closing at the top of the 4th, white 15 minute candle. The down, then up of candles 3 and 4 would be the lower wick on the 60 minute chart.

Finally, the close of the 4th, white 15 minute candle, would also be the close of the 60 minute candle--represented by the lower red line.

So, the painted portion represents the 60 minute candle body.
 

Top