Hosoda Waves ABCDE
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © WD_GANN

//@version=5
indicator("Hosoda Waves ABCDE",shorttitle="Hosoda Waves ABCDE", overlay=true)
priceA = input.price(100, inline="PointA", confirm=true)
timeA = input.time(timestamp("2020-02-20"), inline="PointA", confirm=true)
AllColor=input.color(color.blue, "Labels, Wave and TPs color")


priceB = input.price(100, inline="PointB", confirm=true)
timeB = input.time(timestamp("2020-02-20"), inline="PointB", confirm=true)
line.new(timeA,priceA,timeB,priceB, xloc = xloc.bar_time,color=AllColor)

priceC = input.price(100, inline="PointC", confirm=true)
timeC = input.time(timestamp("2020-02-20"), inline="PointC", confirm=true)
line.new(timeB,priceB,timeC,priceC, xloc = xloc.bar_time,color=AllColor)

priceD = input.price(100, inline="PointD", confirm=true)
timeD = input.time(timestamp("2020-02-20"), inline="PointD", confirm=true)
line.new(timeC,priceC,timeD,priceD, xloc = xloc.bar_time,color=AllColor)

priceE = input.price(100, inline="PointE", confirm=true)
timeE = input.time(timestamp("2020-02-20"), inline="PointE", confirm=true)
line.new(timeD,priceD,timeE,priceE, xloc = xloc.bar_time,color=AllColor)



multiply= (priceB> priceA)? 1:-1

//label.new(timeA, priceA, "A", xloc=xloc.bar_time,yloc=(multiply>0)?yloc.belowbar:yloc.abovebar, style=label.style_none,color=AllColor)

//label.new(timeB, priceB, "B", xloc=xloc.bar_time,yloc=(multiply<0)?yloc.belowbar:yloc.abovebar, style=label.style_none,color=AllColor)

//label.new(timeC, priceC, "C", xloc=xloc.bar_time,yloc=(multiply>0)?yloc.belowbar:yloc.abovebar, style=label.style_none,color=AllColor)

//label.new(timeD, priceD, "D", xloc=xloc.bar_time,yloc=(multiply<0)?yloc.belowbar:yloc.abovebar, style=label.style_none,color=AllColor)

//label.new(timeE, priceE, "E", xloc=xloc.bar_time,yloc=(multiply>0)?yloc.belowbar:yloc.abovebar, style=label.style_none,color=AllColor)

//SWING ABC

HosodaTpEabcprice=priceB + (multiply * math.abs(priceB-priceA))
line.new(timeA,HosodaTpEabcprice,timeA+1,HosodaTpEabcprice, xloc = xloc.bar_time,extend=extend.right,color=color.rgb(130, 192, 243), width=2)
label.new(timeA, HosodaTpEabcprice, "E-A=" +str.tostring(HosodaTpEabcprice), xloc=xloc.bar_time,yloc=yloc.price, style=label.style_text_outline,color=color.rgb(202, 231, 255))

HosodaTpNabcprice=priceC + (multiply * math.abs(priceB-priceA))
line.new(timeA,HosodaTpNabcprice,timeA+1,HosodaTpNabcprice, xloc = xloc.bar_time,extend=extend.right,color=color.rgb(130, 192, 243), width=2)
label.new(timeA, HosodaTpNabcprice, "N-A="+str.tostring(HosodaTpNabcprice), xloc=xloc.bar_time,yloc=yloc.price, style=label.style_text_outline,color=color.rgb(202, 231, 255))

HosodaTpVabcprice=priceB + (multiply * math.abs(priceB-priceC))
line.new(timeA,HosodaTpVabcprice,timeA+1,HosodaTpVabcprice, xloc = xloc.bar_time,extend=extend.right,color=color.lime, width=2)
label.new(timeA, HosodaTpVabcprice,"V-A=" +str.tostring(HosodaTpVabcprice) , xloc=xloc.bar_time,yloc=yloc.price, style=label.style_text_outline,color=color.rgb(179, 255, 218))

HosodaTpNTabcprice=priceC + (multiply * math.abs(priceC-priceA))
line.new(timeA,HosodaTpNTabcprice,timeA+1,HosodaTpNTabcprice, xloc = xloc.bar_time,extend=extend.right,color=color.rgb(245, 115, 115), width=2)
label.new(timeA, HosodaTpNTabcprice, "NT-A="+str.tostring(HosodaTpNTabcprice), xloc=xloc.bar_time,yloc=yloc.price, style=label.style_text_outline,color=color.rgb(255, 200, 200))

//SWING BCD

HosodaTpEbcdprice=priceC - (multiply * math.abs(priceC-priceB))
line.new(timeC,HosodaTpEbcdprice,timeC+1,HosodaTpEbcdprice, xloc = xloc.bar_time,extend=extend.right,color=color.rgb(130, 192, 243), width=1)
label.new(timeC, HosodaTpEbcdprice, "E-B=" +str.tostring(HosodaTpEbcdprice), xloc=xloc.bar_time,yloc=yloc.price, style=label.style_text_outline,color=color.rgb(202, 231, 255))

HosodaTpNbcdprice=priceD - (multiply * math.abs(priceC-priceB))
line.new(timeC,HosodaTpNbcdprice,timeC+1,HosodaTpNbcdprice, xloc = xloc.bar_time,extend=extend.right,color=color.rgb(130, 192, 243), width=1)
label.new(timeC, HosodaTpNbcdprice, "N-B="+str.tostring(HosodaTpNbcdprice), xloc=xloc.bar_time,yloc=yloc.price, style=label.style_text_outline,color=color.rgb(202, 231, 255))

HosodaTpVbcdprice=priceC - (multiply * math.abs(priceC-priceD))
line.new(timeC,HosodaTpVbcdprice,timeC+1,HosodaTpVbcdprice, xloc = xloc.bar_time,extend=extend.right,color=color.lime, width=1)
label.new(timeC, HosodaTpVbcdprice,"V-B=" +str.tostring(HosodaTpVbcdprice) , xloc=xloc.bar_time,yloc=yloc.price, style=label.style_text_outline,color=color.rgb(179, 255, 218))

HosodaTpNTbcdprice=priceD - (multiply * math.abs(priceD-priceB))
line.new(timeC,HosodaTpNTbcdprice,timeC+1,HosodaTpNTbcdprice, xloc = xloc.bar_time,extend=extend.right,color=color.rgb(245, 115, 115), width=1)
label.new(timeC, HosodaTpNTbcdprice, "NT-B="+str.tostring(HosodaTpNTbcdprice), xloc=xloc.bar_time,yloc=yloc.price, style=label.style_text_outline,color=color.rgb(255, 200, 200))

//SWING CDE

HosodaTpEcdeprice=priceD + (multiply * math.abs(priceD-priceC))
line.new(timeE,HosodaTpEcdeprice,timeE+1,HosodaTpEcdeprice, xloc = xloc.bar_time,extend=extend.right,color=color.rgb(130, 192, 243), width=0)
label.new(timeE, HosodaTpEcdeprice, "E-C=" +str.tostring(HosodaTpEcdeprice), xloc=xloc.bar_time,yloc=yloc.price, style=label.style_text_outline,color=color.rgb(202, 231, 255))

HosodaTpNcdeprice=priceE + (multiply * math.abs(priceD-priceC))
line.new(timeE,HosodaTpNcdeprice,timeE+1,HosodaTpNcdeprice, xloc = xloc.bar_time,extend=extend.right,color=color.rgb(130, 192, 243), width=0)
label.new(timeE, HosodaTpNcdeprice, "N-C="+str.tostring(HosodaTpNcdeprice), xloc=xloc.bar_time,yloc=yloc.price, style=label.style_text_outline,color=color.rgb(202, 231, 255))

HosodaTpVcdeprice=priceD + (multiply * math.abs(priceD-priceE))
line.new(timeE,HosodaTpVcdeprice,timeE+1,HosodaTpVcdeprice, xloc = xloc.bar_time,extend=extend.right,color=color.lime, width=0)
label.new(timeE, HosodaTpVcdeprice,"V-C=" +str.tostring(HosodaTpVcdeprice) , xloc=xloc.bar_time,yloc=yloc.price, style=label.style_text_outline,color=color.rgb(179, 255, 218))

HosodaTpNTcdeprice=priceE + (multiply * math.abs(priceE-priceC))
line.new(timeE,HosodaTpNTcdeprice,timeE+1,HosodaTpNTcdeprice, xloc = xloc.bar_time,extend=extend.right,color=color.rgb(245, 115, 115), width=0)
label.new(timeE, HosodaTpNTcdeprice, "NT-C="+str.tostring(HosodaTpNTcdeprice), xloc=xloc.bar_time,yloc=yloc.price, style=label.style_text_outline,color=color.rgb(255, 200, 200))
