Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
- // © Francesco_Marzolo
- //@version=5
- indicator("Hosoda N Wave and TPs {fmz}",shorttitle="Hosoda N-wave TPbtcusd", 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")
- //lblText1 = str.format("Price: {0, number}\nTime: {1, date} {1, time}", myPrice1, myTime1)
- //var l1 = label.new(myTime1, myPrice1, lblText1, xloc=xloc.bar_time)
- 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)
- 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)
- HosodaTpE=priceB + (multiply * math.abs(priceB-priceA))
- line.new(timeC,HosodaTpE,timeC+1,HosodaTpE, xloc = xloc.bar_time,extend=extend.right,color=AllColor, width=0)
- label.new(timeC, HosodaTpE, "E", xloc=xloc.bar_time,yloc=yloc.price, style=label.style_none,color=AllColor)
- HosodaTpN=priceC + (multiply * math.abs(priceB-priceA))
- line.new(timeC,HosodaTpN,timeC+1,HosodaTpN, xloc = xloc.bar_time,extend=extend.right,color=AllColor, width=0)
- label.new(timeC, HosodaTpN, "N", xloc=xloc.bar_time,yloc=yloc.price, style=label.style_none,color=AllColor)
- HosodaTpV=priceB + (multiply * math.abs(priceB-priceC))
- line.new(timeC,HosodaTpV,timeC+1,HosodaTpV, xloc = xloc.bar_time,extend=extend.right,color=AllColor, width=0)
- label.new(timeC, HosodaTpV, "V", xloc=xloc.bar_time,yloc=yloc.price, style=label.style_none,color=AllColor)
- HosodaTpNT=priceC + (multiply * math.abs(priceC-priceA))
- line.new(timeC,HosodaTpNT,timeC+1,HosodaTpNT, xloc = xloc.bar_time,extend=extend.right,color=AllColor, width=0)
- label.new(timeC, HosodaTpNT, "NT", xloc=xloc.bar_time,yloc=yloc.price, style=label.style_none,color=AllColor)
Advertisement
Add Comment
Please, Sign In to add comment