orangequant1

FRANKENSTEIN code

orangequant1 Updated   
OANDA:EURUSD   Euro / U.S. Dollar
"Frankenstein" is the code I often call "Frank". It's below. At first glance, you'll think it's just a way to show a different timeframe and with candles. Wrong. Its candles are dynamic with the chart's tf. For example, a 4-hr tf starts at 5pm ET, ends at 9pm ET. But, say, the 7pm ET Frank candle (running a 4-hr lookback) does not show the standard 5pm ET tf-- rather it shows a lookback to 3pm ET. Tricky. IMPORTANT: If resetting lookback, you must reset all 3 of them, and note that the first one is one less than the second and third. I'm still learning to read Frank. I kind of think I should read ONLY Frank's current candle and not relate it to the preceding candle at all but I could be wrong. I simply look at current Frank candle and determine its type (still figuring out whether its color is that significant). Good luck with Frank!
//@version=4
//works
study("frankenstein",overlay=false)
theopen = open
theclose = close
thehigh = highest(high,9)
thelow = lowest(low,9)

lime = color.lime
red = color.red
palette = theclose >= theopen ? color.lime : color.red
plotcandle(theopen, thehigh, thelow, theclose,color = palette)
Comment:
TV keeps dropping my brackets from the post. So I use parens here instead, and say "theopen=(8)" but the parens should be brackets.
Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.