Trading Warz Candles

WickFlair

New member
Can you guys make these for TOS please...
Inside Bar- Yellow candle labeled IB
Outside Bar- White Candle labeled OB
Holy Grail- OB+IB candle pattern with a vertical yellow cloud that signals Holy Grail
Nirvana- IB+OB candle pattern with a vertical blue cloud that signals Nirvana

* Someone posted a TOS version of these on his Twitter but they did not color the candle they only plotted a small colored dot on the candles and didn't have the vertical clouds either
 
Last edited:
Solution
One more, addition of doubles and fixed nirvana.

Code:
# Trading Warz Candles
# Assembled for https://b4indicators.com/threads/trading-warz-candles.117/
# v1.0 - barbaros
# v1.1 - barbaros - added colors and options
# v1.2 - barbaros - bug fixes

input ShowNirvana = yes;
input ShowHolyGrail = yes;
input ShowDoubles = yes;

DefineGlobalColor("InsidePower", Color.YELLOW);
DefineGlobalColor("OutsidePower", Color.WHITE);
DefineGlobalColor("Nirvana", Color.BLUE);
DefineGlobalColor("HolyGrail", Color.YELLOW);
DefineGlobalColor("Doubles", Color.MAGENTA);

def IsUp = close > open;
def IsDown = close < open;
def IsDoji = IsDoji();
def avgRange = 0.05 * Average(high - low, 20);

def InsidePower = 
    ((Sum(IsUp, 1)[1] >= 0)) and
    ((Sum(IsUp...

WickFlair

New member
FI_l4n8VcAIFdB0



what it looks like on trading view
 

barbaros

Administrator
Staff member
@WickFlair please try this and let me know if it works as expected.

ozKmHvT.png


There is a difference between ToS and TradingView where TradingView clouds start from the left of a bar and ends at the right edge. ToS starts shading them from the middle. If the outcome is not what you like, we can extend the cloud on ToS to start from the middle of previous bar to the middle of the next bar.

Code:
# Trading Warz Candles
# Assembled for https://b4indicators.com/threads/trading-warz-candles.117/
# v1.0 - barbaros

def IsUp = close > open;
def IsDown = close < open;
def IsDoji = IsDoji();
def avgRange = 0.05 * Average(high - low, 20);


def InsidePower =
    ((Sum(IsUp, 1)[1] >= 0)) and
    ((Sum(IsUp, 1)[0] >= 0)) and
    Lowest(low[1], 1) <= Lowest(low[0], 1) and
    Highest(high[1], 1) >= Highest(high[0], 1);

def OutsidePower =
    ((Sum(IsUp, 1)[1] >= 0)) and
    ((Sum(IsUp, 1)[0] >= 0)) and
    Lowest(low[1], 1) > Lowest(low[0], 1) and
    Highest(high[1], 1) < Highest(high[0], 1);

def HollyGrail =
    ((Sum(IsUp, 1)[2] >= 0)) and
    ((Sum(IsUp, 1)[1] >= 0)) and
    ((Sum(IsUp, 1)[0] >= 0)) and
    Lowest(low[2], 1) > Lowest(low[1], 1) and
    Lowest(low[1], 1) < Lowest(low[0], 1) and
    Highest(high[2], 1) < Highest(high[1], 1) and
    Highest(high[1], 1) > Highest(high[0], 1);

def Nirvana =
    ((Sum(IsUp, 1)[2] >= 0)) and
    ((Sum(IsUp, 1)[1] >= 0)) and
    ((Sum(IsUp, 1)[0] >= 0)) and
    Highest(high[1], 1) > Highest(high[0], 1) and
    Lowest(low[2], 1) < Lowest(low[1], 1) and
    Highest(high[2], 1) > Highest(high[1], 1) and
    Lowest(low[1], 1) < Lowest(low[0], 1);

AssignPriceColor(
    if InsidePower then Color.YELLOW
    else if OutsidePower then Color.WHITE
    else Color.CURRENT
);

AddCloud(
    if HollyGrail or HollyGrail[-1] then Double.POSITIVE_INFINITY else Double.NaN,
    if HollyGrail or HollyGrail[-1] then Double.NEGATIVE_INFINITY else Double.NaN,
    Color.YELLOW, Color.YELLOW
);

AddCloud(
    if Nirvana or Nirvana[-1] then Double.POSITIVE_INFINITY else Double.NaN,
    if Nirvana or Nirvana[-1] then Double.NEGATIVE_INFINITY else Double.NaN,
    Color.BLUE, Color.BLUE
);
 

barbaros

Administrator
Staff member
Here is a version that allows you to customize colors.

Code:
# Trading Warz Candles
# Assembled for https://b4indicators.com/threads/trading-warz-candles.117/
# v1.0 - barbaros
# v1.1 - barbaros - added colors and options

input ShowNirvana = yes;
input ShowHollyGrail = yes;

DefineGlobalColor("InsidePower", Color.YELLOW);
DefineGlobalColor("OutsidePower", Color.WHITE);
DefineGlobalColor("Nirvana", Color.BLUE);
DefineGlobalColor("HollyGrail", Color.YELLOW);

def IsUp = close > open;
def IsDown = close < open;
def IsDoji = IsDoji();
def avgRange = 0.05 * Average(high - low, 20);

def InsidePower =
    ((Sum(IsUp, 1)[1] >= 0)) and
    ((Sum(IsUp, 1)[0] >= 0)) and
    Lowest(low[1], 1) <= Lowest(low[0], 1) and
    Highest(high[1], 1) >= Highest(high[0], 1);

def OutsidePower =
    ((Sum(IsUp, 1)[1] >= 0)) and
    ((Sum(IsUp, 1)[0] >= 0)) and
    Lowest(low[1], 1) > Lowest(low[0], 1) and
    Highest(high[1], 1) < Highest(high[0], 1);

def HollyGrail =
    ((Sum(IsUp, 1)[2] >= 0)) and
    ((Sum(IsUp, 1)[1] >= 0)) and
    ((Sum(IsUp, 1)[0] >= 0)) and
    Lowest(low[2], 1) > Lowest(low[1], 1) and
    Lowest(low[1], 1) < Lowest(low[0], 1) and
    Highest(high[2], 1) < Highest(high[1], 1) and
    Highest(high[1], 1) > Highest(high[0], 1);

def Nirvana =
    ((Sum(IsUp, 1)[2] >= 0)) and
    ((Sum(IsUp, 1)[1] >= 0)) and
    ((Sum(IsUp, 1)[0] >= 0)) and
    Highest(high[1], 1) > Highest(high[0], 1) and
    Lowest(low[2], 1) < Lowest(low[1], 1) and
    Highest(high[2], 1) > Highest(high[1], 1) and
    Lowest(low[1], 1) < Lowest(low[0], 1);

AssignPriceColor(
    if InsidePower then GlobalColor("InsidePower")
    else if OutsidePower then GlobalColor("OutsidePower")
    else Color.CURRENT
);

AddCloud(
    if ShowHollyGrail and (HollyGrail or HollyGrail[-1]) then Double.POSITIVE_INFINITY else Double.NaN,
    if ShowHollyGrail and (HollyGrail or HollyGrail[-1]) then Double.NEGATIVE_INFINITY else Double.NaN,
    GlobalColor("HollyGrail"), GlobalColor("HollyGrail")
);

AddCloud(
    if ShowNirvana and (Nirvana or Nirvana[-1]) then Double.POSITIVE_INFINITY else Double.NaN,
    if ShowNirvana and (Nirvana or Nirvana[-1]) then Double.NEGATIVE_INFINITY else Double.NaN,
    GlobalColor("Nirvana"), GlobalColor("Nirvana")
);
 

barbaros

Administrator
Staff member
One more, addition of doubles and fixed nirvana.

Code:
# Trading Warz Candles
# Assembled for https://b4indicators.com/threads/trading-warz-candles.117/
# v1.0 - barbaros
# v1.1 - barbaros - added colors and options
# v1.2 - barbaros - bug fixes

input ShowNirvana = yes;
input ShowHolyGrail = yes;
input ShowDoubles = yes;

DefineGlobalColor("InsidePower", Color.YELLOW);
DefineGlobalColor("OutsidePower", Color.WHITE);
DefineGlobalColor("Nirvana", Color.BLUE);
DefineGlobalColor("HolyGrail", Color.YELLOW);
DefineGlobalColor("Doubles", Color.MAGENTA);

def IsUp = close > open;
def IsDown = close < open;
def IsDoji = IsDoji();
def avgRange = 0.05 * Average(high - low, 20);

def InsidePower = 
    ((Sum(IsUp, 1)[1] >= 0)) and
    ((Sum(IsUp, 1)[0] >= 0)) and
    Lowest(low[1], 1) <= Lowest(low[0], 1) and
    Highest(high[1], 1) >= Highest(high[0], 1);

def OutsidePower = 
    ((Sum(IsUp, 1)[1] >= 0)) and
    ((Sum(IsUp, 1)[0] >= 0)) and
    Lowest(low[1], 1) > Lowest(low[0], 1) and
    Highest(high[1], 1) < Highest(high[0], 1);

def HolyGrail = OutsidePower[1] and InsidePower;

def Nirvana =  InsidePower[1] and OutsidePower;

def Doubles = (InsidePower[1] and InsidePower) or (OutsidePower[1] and OutsidePower);

AssignPriceColor(
    if InsidePower then GlobalColor("InsidePower")
    else if OutsidePower then GlobalColor("OutsidePower")
    else Color.CURRENT
);

AddCloud(
    if ShowHolyGrail and (HolyGrail or HolyGrail[-1]) then Double.POSITIVE_INFINITY else Double.NaN,
    if ShowHolyGrail and (HolyGrail or HolyGrail[-1]) then Double.NEGATIVE_INFINITY else Double.NaN,
    GlobalColor("HolyGrail"), GlobalColor("HolyGrail")
);

AddCloud(
    if ShowNirvana and (Nirvana or Nirvana[-1]) then Double.POSITIVE_INFINITY else Double.NaN,
    if ShowNirvana and (Nirvana or Nirvana[-1]) then Double.NEGATIVE_INFINITY else Double.NaN,
    GlobalColor("Nirvana"), GlobalColor("Nirvana")
);

AddCloud(
    if ShowDoubles and (Doubles or Doubles[-1]) then Double.POSITIVE_INFINITY else Double.NaN,
    if ShowDoubles and (Doubles or Doubles[-1]) then Double.NEGATIVE_INFINITY else Double.NaN,
    GlobalColor("Doubles"), GlobalColor("Doubles")
);
 
Solution

BannonMan85

New member
I don't think there is a scanner for this. We can build one.
I guess what I am saying is that when you use the 3 codes for inside power, outside power and holy grail, they can only be used in the scanner section. they don't save as a study to apply to charts but they are under studies in the scanner section.
 

DjEskimo007

New member
Hey guys, been searching all of the freaking internet for the tradingwarz indicators and boy did I come across the jackpot. I was wondering what the other version looked referenced in post #6 in regards to the shading of the clouds. Is there a way to color the whole of both candles instead of just the middles of both? Thanks in advance
 

barbaros

Administrator
Staff member
Hey guys, been searching all of the freaking internet for the tradingwarz indicators and boy did I come across the jackpot. I was wondering what the other version looked referenced in post #6 in regards to the shading of the clouds. Is there a way to color the whole of both candles instead of just the middles of both? Thanks in advance
Hello. Welcome. I don't think there is a way to color the whole candle due to thinkorswim limitation. We can look into coloring from the middle of the previous candle though.
 
Top