TradingView
cheesywedges
Mar 27, 2021 6:04 PM

cheesywedges MTF MACD+Stoch+Ichi+PSAR 

Bitcoin / TetherUSBinance

Description

This is a heatmap created to show 4 key indicators MACD, Stochastic, Ichimoku and PSAR. Adjust TF accordingly. Default is incremental by 45 minutes.

One advantage is you can see as the indicator current candles change from green to red or the other way round as the current trend changes. Eg. MACD attempting to cross Signal and the candle will flicker red to green and you can see it happen on multiple TF.

Standard Settings
  • PSAR - Start, Increment and Max Value
  • Stochastic - K,D,Smooth, Upper and Lower
  • MACD - Fast, Slow and Smooth
  • Ichimoku - Conversion Line, Base Line Periods, Lagging Span and Displacement


Advanced Settings (MACD)
  • MACD/Signal Crossover , eg. Long = MACD > Signal
  • MACD/Signal + Histogram Crossover , eg. Long = MACD > Signal and Hist > 0 and Signal > 0
  • MACD/Signal Crossing, eg. Long = MACD > Signal and previous MACD < previous Signal
  • MACD/Signal + Histogram Crossing, eg. Long = MACD > Signal and previous MACD < previous Signal and Hist > 0 and Signal > 0 and previous Hist > previous Signal
  • For normal usage, just use MACD/Signal Crossover


Recommended Settings
  • Ichimoku 20, 60, 120, 30


If customized enhancement required drop a message and I'll see what I can do.

Release Notes

Update to cater the following timeframe. Please let me know if there's a quicker way to do the conversion.

string_to_res(str)=>
res = iff(str == "1" , 1 ,
iff(str == "3" , 3 ,
iff(str == "5" , 5 ,
iff(str == "10" , 20 ,
iff(str == "15" , 15 ,
iff(str == "20" , 20 ,
iff(str == "30" , 30 ,
iff(str == "45" , 45 ,
iff(str == "60" , 60 ,
iff(str == "90" , 90 ,
iff(str == "120", 120 ,
iff(str == "180", 180 ,
iff(str == "240", 240 ,
iff(str == "300", 300 ,
iff(str == "360", 360 ,
iff(str == "720", 720 ,
iff(str == "D" , 1440,
iff(str == "1D" , 1440,
iff(str == "3D" , 1440 * 3,
iff(str == "W" , 1440 * 7,
iff(str == "1W" , 1440 * 7,
999)))))))))))))))))))))
res

Release Notes

Updated chart
Comments
surfnvb7
How were you able to get the labeled time frames on the right side of the heat map? Mind releasing open-source code?
Tracks
Instead of converting string to resolution, can you not just use the input.resolution input type? Or does that not include the specific timeframes you want to use?
cheesywedges
@Tracks, I am performing a comparison of the chart's TF versus the TF from input. Both comes in string type and a conversion is required. I have never tried timeframe.period > input_tf_1 as both are string, I doubt that works.

string_to_res(timeframe.period) > string_to_res(input_tf_1)
Tracks
@cheesywedges, hmm.. Here's an example of a string input I use. I plug the 'res' variable right into the security function without converting string to resolution with no issues.

sorry. I can't show the actual line of code. It gets reformatted and messed up. But basically I use options and just have the different timeframes in quotes.
peggyjo2222
Nice indicator. When I install on my day chart only the day line shows up. How do I enable all the other time frames? I have tried checking the boxes. Thanks so much.
cheesywedges
@peggyjo2222, it would not show you timeframes that are smaller than itself. So if you are on the Daily timeframe, you need to set Daily as your first timeframe and add 2D 3D onwards.
Tracks
@cheesywedges, @peggyjo222 I run into this issue a lot. The analogy I use to explain to people is this: Imagine I ask you what time you woke up today, but all you can say is "Wednesday". Although technically correct, your answer isn't granular enough to properly answer the question.
More