jonshank62
New member
I like to use 2 momentum scans simultaneously 1 on the 1 hour and 1 on the 5 minute I keep seeing when the 5 minute crosses above the 1 hour and they are both positive or green a lot of times their is a price explosion I would like to build a scanner on the 5 minute for when this happens .
I will add code and a screenshot below.
I will add code and a screenshot below.
Code:
declare Lower;
input length = 14;
input calcLength = 5;
input smoothLength = 3;
input agg = AggregationPeriod.Fifteen_min;
def o = open(period = agg);;
def c = close(period = agg);
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.light_green
else color.pink);
Signal.AssignValueColor(if Main > Signal
then color.light_green
else color.pink);
Signal.HideBubble();
Signal.HideTitle();
addCloud(Main, Signal, color.light_green, color.pink);
plot zero = if isNaN(c) then double.nan else 0;
zero.SetDefaultColor(Color.black);
zero.hideBubble();
zero.hideTitle();
plot ob = if isNaN(c) then double.nan else round(length * .7);
ob.SetDefaultColor(Color.red);
ob.HideBubble();
ob.HideTitle();
plot os = if isNaN(c) then double.nan else -round(length * .7);
os.SetDefaultColor(Color.green);
os.HideBubble();
os.HideTitle();
# End Code TMO with Higher Aggregation
Last edited by a moderator: