OPEN-SOURCE SCRIPT
Emmanuel Optuma Bar Colors v2

This script colours TradingView’s Bar Chart to follow a simple, powerful bar-type logic used in Optuma-style analysis.
It makes the chart easier to read by showing the relationship between:
Up bars
Down bars
Outside bars
Inside bars
🔍 Bar Type Detection
Up Bar
Close > Previous close
→ Indicates upward strength
→ Coloured Green
Down Bar
Close < Previous close
→ Indicates downward pressure
→ Coloured Red
Outside Bar
High > Previous high and Low < Previous low
→ Market expands its range
→ Coloured Blue
Inside Bar
High < Previous high and Low > Previous low
→ Market contracts inside the previous bar
→ Follows previous bar’s colour
🎨 Colour Rules Summary
Bar Type Colour Meaning
Up Bar 🟩 Green Bullish pressure
Down Bar 🟥 Red Bearish pressure
Outside Bar 🔵 Blue Range expansion, bar resets structure
Inside Bar Same as previous bar Market indecision, continuation
🧠 Inside Bar Logic (Very Important)
Inside bars always copy the colour of the previous bar, which means:
If the previous bar was Green → inside bar becomes Green
If the previous bar was Red → inside bar becomes Red
If the previous bar was Blue → inside bar becomes Blue
This keeps the structure visually consistent and easy to read.
📈 Why This Helps Traders
This approach makes it easier to see:
✔ Trend continuation
Inside bars keep the trend colour, making swings clearer.
✔ Trend weakness
Inside bars after outside bars show contraction.
✔ Breakouts
Blue outside bars stand out as moments of range expansion.
✔ Market rhythm
The chart becomes easier to follow for beginners and advanced traders.
🧩 How to Use It
Set chart type to Bars
Add the script
Hide default colours (barcolor replaces them)
This instantly transforms TradingView into a teaching-friendly chart like Optuma.
It makes the chart easier to read by showing the relationship between:
Up bars
Down bars
Outside bars
Inside bars
🔍 Bar Type Detection
Up Bar
Close > Previous close
→ Indicates upward strength
→ Coloured Green
Down Bar
Close < Previous close
→ Indicates downward pressure
→ Coloured Red
Outside Bar
High > Previous high and Low < Previous low
→ Market expands its range
→ Coloured Blue
Inside Bar
High < Previous high and Low > Previous low
→ Market contracts inside the previous bar
→ Follows previous bar’s colour
🎨 Colour Rules Summary
Bar Type Colour Meaning
Up Bar 🟩 Green Bullish pressure
Down Bar 🟥 Red Bearish pressure
Outside Bar 🔵 Blue Range expansion, bar resets structure
Inside Bar Same as previous bar Market indecision, continuation
🧠 Inside Bar Logic (Very Important)
Inside bars always copy the colour of the previous bar, which means:
If the previous bar was Green → inside bar becomes Green
If the previous bar was Red → inside bar becomes Red
If the previous bar was Blue → inside bar becomes Blue
This keeps the structure visually consistent and easy to read.
📈 Why This Helps Traders
This approach makes it easier to see:
✔ Trend continuation
Inside bars keep the trend colour, making swings clearer.
✔ Trend weakness
Inside bars after outside bars show contraction.
✔ Breakouts
Blue outside bars stand out as moments of range expansion.
✔ Market rhythm
The chart becomes easier to follow for beginners and advanced traders.
🧩 How to Use It
Set chart type to Bars
Add the script
Hide default colours (barcolor replaces them)
This instantly transforms TradingView into a teaching-friendly chart like Optuma.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.