//Grab Trading Indicator
Once Trend = 0
flb = 80 //Longterm Period Max=80 Min=1
slb = 21 //Shortterm Period Max=21 Min=1)
MajorResistance = highest[flb]
MajorSupport = lowest[flb]
MinorResistance = highest[slb]
MinorSupport = lowest[slb]
If high > MajorResistance[1] then
Trend=1
EndIf
If low < MajorSupport[1] then
Trend=-1
EndIf
If Trend = 1 and low Crosses Over MinorSupport then
xLong = 1
EndIf
If Trend = -1 and high Crosses Under MinorResistance then
xShort = 1
EndIf
If xLong=1 and High Crosses Under MinorResistance then
xLong=0
EndIf
If xShort =1 and Low Crosses Over MinorSupport then
xShort=0//if strategy.position_size < 0
EndIf
If Trend=-1 and Trend[1]=-1 then
MajRColor = 255
else
MajRColor=0
EndIf
If Trend=1 and Trend[1]=1 then
MajSColor = 255
else
MajSColor=0
EndIf
If Trend = 1 and xLong=1 then
MinRColorR=255
MinRColorG=255
Else
MinRColorR=0
MinRColorG=0
EndIf
If Trend=-1 and xShort=1 then
MinSColorR=255
MinSColorG=255
Else
MinSColorR=0
MinSColorG=0
EndIf
Return MajorResistance as "MajorResistance" Coloured(MajRColor,0,0), MajorSupport as "MajorSupport" Coloured(0,MajSColor,0), MinorResistance as "MinorResistance" Coloured(MinRColorR,MinRColorG,0), MinorSupport as "MinorSupport" Coloured(MinSColorR,MinSColorG,0)