This is how the colors are determined:
- If today’s closing price and are greater than 'n' days ago, color today’s bar green.
- If today’s closing price is greater than 'n' days ago but is not, color today’s bar blue.
- Similarly, if today’s closing price and is less than 'n' days ago, color today’s bar orange.
- If today’s closing price is less than 'n' days ago but is not, color today’s bar red.
Buy the green or blue bars, use a 1% trailing stop, and stand aside on red or orange bars.
As you see, this is more for entry confirmation. I have not tested this on any instrument.
You may have to tune the lookback period for your instrument. Default is 10.
"A color-based system for short-term trading" - http://www.traders.com/Documentation/FEE...
List of all my indicators:
List of my indicators at Appstore: http://blog.tradingview.com/?p=970
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.
// // @author LazyBear // List of all my indicators: https://www.tradingview.com/v/4IneGo8h/ // study("Colored Volume Bars [LazyBear]", shorttitle="CVOLB_LB") lookback=input(10) showMA=input(false) lengthMA=input(20) p2=close v2=volume p1=p2[lookback] v1=v2[lookback] c= iff(p2>p1 and v2>v1, green, iff(p2>p1 and v2<v1, blue, iff(p2<p1 and v2<v1, orange, iff(p2<p1 and v2>v1, red, gray)))) plot(v2, style=columns, color=c) plot(showMA?sma(v2, lengthMA):na, color=maroon)