Tidan
Member
After reading this thread I was interested in combining Ray Bull Power and Ray Bear Power as I trade both long and short near equally.
https://usethinkscript.com/threads/renko-bar-based-trading-system-for-thinkorswim.3252/
Perhaps someone may find this useful.
https://usethinkscript.com/threads/renko-bar-based-trading-system-for-thinkorswim.3252/
Perhaps someone may find this useful.
Code:
declare lower;
# Ray component
input bullLength = 13;
input bearLength = 13;
plot zeroline = 0;
def Bull = high - ExpAverage(close, bullLength);
def Bear = low - ExpAverage(close, bearLength);
def bullOver = if bull > zeroline then bull else double.nan;
def bullUnder = if bull < zeroline then bull else double.nan;
def bearOver = if bear > zeroline then bear else double.nan;
def bearUnder = if bear < zeroline then bear else double.nan;
plot minorBullPower = if bearOver then bearOver else double.nan;
plot BullPower = if bullOver then bullOver else double.nan;
plot minorBearPower = if bullUnder then bullUnder else double.nan;
plot BearPower = if bearUnder then bearUnder else double.nan;
minorBullPower.assignValueColor(Color.dark_green);
minorBullPower.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
minorBullPower.SetLineWeight(3);
minorBullPower.hideTitle();
minorBearPower.assignValueColor(color.dark_red);
minorBearPower.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
minorBearPower.SetLineWeight(3);
minorBearPower.hideTitle();
BullPower.assignValueColor(Color.green);
BullPower.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
BullPower.SetLineWeight(3);
BearPower.assignValueColor(Color.red);
BearPower.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
BearPower.SetLineWeight(3);
ZeroLine.SetDefaultColor(GetColor(3));
Last edited by a moderator: