• Memorial Day Sale! Claim the biggest discount of the year with $50 off VIP using code MEM50. Sign up here.

TMO & RSILG candle colors

Mbaker333

New member
VIP
My candles are colored to match the TMO lower study that shares space with the RSILG. Is there a way to keep the TMO candle color scheme but add a condition that colors the candles yellow/blue when the RSILG and TMO overlap at there critical limits?
im new so maybe the question is confusing so maybe the picture helps illustrate...



Any help is very much appreciated!
NLzB1si.jpg
 
Last edited:
Solution
Sorry can't help with your request. Could you share the code for the TMO color changing candles? Thanks
Code:
input length = 14;
input calcLength = 5;
input smoothLength = 3;

def o = open;
def c = close;
def data = fold i = 0 to length
           with s
           do s + (if c > getValue(o, i)
                   then 1
                   else if c < getValue(o, i)
                        then - 1
                        else 0);
def EMA5 = ExpAverage(data, calcLength);
plot Main = ExpAverage(EMA5, smoothLength);
plot Signal = ExpAverage(Main, smoothLength);
     Main.AssignValueColor(if Main > Signal
                           then color.CYAN
                           else color.red);
     Signal.AssignValueColor(if Main > Signal...

Mkirk

New member
VIP
My candles are colored to match the TMO lower study that shares space with the RSILG. Is there a way to keep the TMO candle color scheme but add a condition that colors the candles yellow/blue when the RSILG and TMO overlap at there critical limits?
im new so maybe the question is confusing so maybe the picture helps illustrate...



Any help is very much appreciated!
NLzB1si.jpg
Sorry can't help with your request. Could you share the code for the TMO color changing candles? Thanks
 

Gvaro

New member
Sorry can't help with your request. Could you share the code for the TMO color changing candles? Thanks
Code:
input length = 14;
input calcLength = 5;
input smoothLength = 3;

def o = open;
def c = close;
def data = fold i = 0 to length
           with s
           do s + (if c > getValue(o, i)
                   then 1
                   else if c < getValue(o, i)
                        then - 1
                        else 0);
def EMA5 = ExpAverage(data, calcLength);
plot Main = ExpAverage(EMA5, smoothLength);
plot Signal = ExpAverage(Main, smoothLength);
     Main.AssignValueColor(if Main > Signal
                           then color.CYAN
                           else color.red);
     Signal.AssignValueColor(if Main > Signal
                             then color.CYAN
                             else color.red);
     Signal.HideBubble();
     Signal.HideTitle();
addCloud(Main, Signal, color.green, color.red);
plot zero = if isNaN(c) then double.nan else 0;
     zero.SetDefaultColor(Color.gray);
     zero.hideBubble();
     zero.hideTitle();
plot ob = if isNaN(c) then double.nan else round(length * .7);
     ob.SetDefaultColor(Color.gray);
     ob.HideBubble();
     ob.HideTitle();
plot os = if isNaN(c) then double.nan else -round(length * .7);
     os.SetDefaultColor(Color.gray);
     os.HideBubble();
     os.HideTitle();
addCloud(ob, length, color.light_red, color.light_red, no);
addCloud(-length, os, color.cyan, color.cyan);
assignpriceColor(if MAIN > SIGNAL then color.CYAN else color.current);
assignpriceColor(if MAIN < SIGNAL then color.RED else color.current);
alert(MAIN crosses above SIGNAL,"bullish",Alert.bar,Sound.ring);
alert(MAIN crosses below SIGNAL,"bearish",Alert.bar,Sound.ring);

# End Code TMO
 
Solution

GiantBull

New member
I am trying to change the candlesticks color when the TMO changes from red to green or other way around. Is it possible to do this? I have seen it with other indicators and it helps by making the chart cleaner with less indicators. Here's the code:

# TMO ((T)rue (M)omentum (O)scilator)
# Mobius
# V01.05.2018
# hint: TMO calculates momentum using the delta of price. Giving a much better picture of trend, tend reversals and divergence than momentum oscillators using price.

declare Lower;

input length = 14;
input calcLength = 5;
input smoothLength = 3;

def o = open;
def c = close;
def data = fold i = 0 to length
with s
do s + (if c > getValue(o, i)
then 1
else if c < getValue(o, i)
then - 1
else 0);
def EMA5 = ExpAverage(data, calcLength);
plot Main = ExpAverage(EMA5, smoothLength);
plot Signal = ExpAverage(Main, smoothLength);
Main.AssignValueColor(if Main > Signal
then color.green
else color.red);
Signal.AssignValueColor(if Main > Signal
then color.green
else color.red);
Signal.HideBubble();
Signal.HideTitle();
addCloud(Main, Signal, color.green, color.red);
plot zero = if isNaN(c) then double.nan else 0;
zero.SetDefaultColor(Color.gray);
zero.hideBubble();
zero.hideTitle();
plot ob = if isNaN(c) then double.nan else round(length * .7);
ob.SetDefaultColor(Color.gray);
ob.HideBubble();
ob.HideTitle();
plot os = if isNaN(c) then double.nan else -round(length * .7);
os.SetDefaultColor(Color.gray);
os.HideBubble();
os.HideTitle();
addCloud(ob, length, color.light_red, color.light_red, no);
addCloud(-length, os, color.light_green, color.light_green);
# End Code TMO
 

Similar threads

Top