HHV & LLV based Trend
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © NumberGames

/////////////////////////////////////////////////////////////////////////////////////////
////  UP trend: HHV_fastline = HHV Slowline and LLVfastline crossover LLVSlowline  /////
/// DOWN trend: HHV_fastline crossunder HHV Slowline and LLVfastline !=LLVSlowline /////
////////////////////////////////////////////////////////////////////////////////////////
//@version=4

study("HHV & LLV based Trend", overlay=true,resolution="",resolution_gaps=false)

fastline=input(3,title="FastLine")
slowline=input(10,title="SlowLine")

HHV3 = highest(high, fastline)
LLV3 = lowest(low, fastline)


HHV10 = highest(high, slowline)
LLV10 = lowest(low, slowline)

h3=plot(HHV3, color=HHV3==HHV10?na:#ff009b, linewidth=2, title="HHV3")
l3=plot(LLV3, color=LLV3==LLV10?na:#00ffa0, linewidth=2, title="LLV3")


h10=plot(HHV10, color=HHV3==HHV10?na:#ff009b, linewidth=2, title="HHV10")
l10=plot(LLV10, color=LLV3==LLV10?na:#00ffa0, linewidth=2, title="LLV10")

fill(h3,h10,color=color.orange,transp=20)
fill(l3,l10,color=color.green,transp=20)
