Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Custom Coding For Nickafella
- //@version=4
- study("Price-Drive MTF Instagram LuckyNickVA", overlay=true)
- t=input(title="Timeframe", type=input.resolution, defval="")
- i=input(title="Line Color", type=input.color, defval=color.black)
- w=input(4,"Width", minval=1, maxval=24)
- HH=0.0
- LL=0.0
- x1=0
- x2=0
- x3=0
- x4=0
- x5=0
- x6=0
- x7=0
- x8=0
- x9=0
- x10=0
- x11=0
- x12=0
- x13=0
- x14=0
- x15=0
- x16=0
- x17=0
- x18=0
- x19=0
- x20=0
- x21=0
- x22=0
- x23=0
- x24=0
- x25=0
- nX1=0
- nX2=0
- nX3=0
- nX4=0
- nX5=0
- nX6=0
- nX7=0
- nX8=0
- nX9=0
- nX10=0
- nX11=0
- nX12=0
- nX13=0
- nX14=0
- nX15=0
- nX16=0
- nX17=0
- nX18=0
- nX19=0
- nX20=0
- nX21=0
- nX22=0
- nX23=0
- nX24=0
- nX25=0
- genX1=0
- genY1=0.0
- genX2=0
- genY2=0.0
- genX3=0
- genY3=0.0
- genX4=0
- genY4=0.0
- genX5=0
- genY5=0.0
- genX6=0
- genY6=0.0
- genX7=0
- genY7=0.0
- genX8=0
- genY8=0.0
- genX9=0
- genY9=0.0
- genX10=0
- genY10=0.0
- genX11=0
- genY11=0.0
- genX12=0
- genY12=0.0
- genX13=0
- genY13=0.0
- genX14=0
- genY14=0.0
- genX15=0
- genY15=0.0
- genX16=0
- genY16=0.0
- genX17=0
- genY17=0.0
- genX18=0
- genY18=0.0
- genX19=0
- genY19=0.0
- genX20=0
- genY20=0.0
- genX21=0
- genY21=0.0
- genX22=0
- genY22=0.0
- genX23=0
- genY23=0.0
- genX24=0
- genY24=0.0
- genX25=0
- genY25=0.0
- direction=0
- pinLow=0
- pinHigh=0
- bullish=false
- // Define Terms
- srcC=security(syminfo.tickerid, t, close)
- srcO=security(syminfo.tickerid, t, open)
- bullish:=srcC>srcO
- direction:=bullish?1:-1
- if(barstate.isfirst == false)
- if (direction>0)
- HH:=direction[1]<0?high:max(high,HH[1])
- LL:=LL[1]
- else
- LL:=direction[1]>0?low:min(low,LL[1])
- HH:=HH[1]
- pinHigh:=HH==high?bar_index:HH[1]==high[1] and high<=high[1]?bar_index-1:pinHigh[1]
- pinLow:=LL==low?bar_index:LL[1]==low[1] and low>=low[1]?bar_index-1:pinLow[1]
- if (direction < direction[1])
- x25 := x24[1]
- x24 := x23[1]
- x23 := x22[1]
- x22 := x21[1]
- x21 := x20[1]
- x20 := x19[1]
- x19 := x18[1]
- x18 := x17[1]
- x17 := x16[1]
- x16 := x15[1]
- x15 := x14[1]
- x14 := x13[1]
- x13 := x12[1]
- x12 := x11[1]
- x11 := x10[1]
- x10 := x9[1]
- x9 := x8[1]
- x8 := x7[1]
- x7 := x6[1]
- x6 := x5[1]
- x5 := x4[1]
- x4 := x3[1]
- x3 := x2[1]
- x2 := pinHigh
- else if (direction > direction[1])
- x25 := x24[1]
- x24 := x23[1]
- x23 := x22[1]
- x22 := x21[1]
- x21 := x20[1]
- x20 := x19[1]
- x19 := x18[1]
- x18 := x17[1]
- x17 := x16[1]
- x16 := x15[1]
- x15 := x14[1]
- x14 := x13[1]
- x13 := x12[1]
- x12 := x11[1]
- x11 := x10[1]
- x10 := x9[1]
- x9 := x8[1]
- x8 := x7[1]
- x7 := x6[1]
- x6 := x5[1]
- x5 := x4[1]
- x4 := x3[1]
- x3 := x2[1]
- x2 := pinLow
- else
- x25 := x25[1]
- x24 := x24[1]
- x23 := x23[1]
- x22 := x22[1]
- x21 := x21[1]
- x20 := x20[1]
- x19 := x19[1]
- x18 := x18[1]
- x17 := x17[1]
- x16 := x16[1]
- x15 := x15[1]
- x14 := x14[1]
- x13 := x13[1]
- x12 := x12[1]
- x11 := x11[1]
- x10 := x10[1]
- x9 := x9[1]
- x8 := x8[1]
- x7 := x7[1]
- x6 := x6[1]
- x5 := x5[1]
- x4 := x4[1]
- x3 := x3[1]
- x2 := x2[1]
- // Locate ZZ points
- x1 := direction > 0 ? pinHigh : direction < 0 ? pinLow : x1[1]
- nX1 := bar_index - x1
- nX5 := bar_index - x5
- nX2 := bar_index - x2
- nX3 := bar_index - x3
- nX4 := bar_index - x4
- nX4 := bar_index - x4
- nX6 := bar_index - x6
- nX7 := bar_index - x7
- nX8 := bar_index - x8
- nX9 := bar_index - x9
- nX10 := bar_index - x10
- nX11 := bar_index - x11
- nX12 := bar_index - x12
- nX13 := bar_index - x13
- nX14 := bar_index - x14
- nX15 := bar_index - x15
- nX16 := bar_index - x16
- nX17 := bar_index - x17
- nX18 := bar_index - x18
- nX19 := bar_index - x19
- nX20 := bar_index - x20
- nX21 := bar_index - x21
- nX22 := bar_index - x22
- nX23 := bar_index - x23
- nX24 := bar_index - x24
- nX25 := bar_index - x25
- // Generate X & Y Points
- if (direction > 0)
- genY1 := high[nX1]
- genX1 := bar_index - nX1
- genY2 := low[nX2]
- genX2 := bar_index - nX2
- genY3 := high[nX3]
- genX3 := bar_index - nX3
- genY4 := low[nX4]
- genX4 := bar_index - nX4
- genY5 := high[nX5]
- genX5 := bar_index - nX5
- genY6 := low[nX6]
- genX6 := bar_index - nX6
- genY7 := high[nX7]
- genX7 := bar_index - nX7
- genY8 := low[nX8]
- genX8 := bar_index - nX8
- genY9 := high[nX9]
- genX9 := bar_index - nX9
- genY10 := low[nX10]
- genX10 := bar_index - nX10
- genY11 := high[nX11]
- genX11 := bar_index - nX11
- genY12 := low[nX12]
- genX12 := bar_index - nX12
- genY13 := high[nX13]
- genX13 := bar_index - nX13
- genY14 := low[nX14]
- genX14 := bar_index - nX14
- genY15 := high[nX15]
- genX15 := bar_index - nX15
- genY16 := low[nX16]
- genX16 := bar_index - nX16
- genY17 := high[nX17]
- genX17 := bar_index - nX17
- genY18 := low[nX18]
- genX18 := bar_index - nX18
- genY19 := high[nX19]
- genX19 := bar_index - nX19
- genY20 := low[nX20]
- genX20 := bar_index - nX20
- genY21 := high[nX21]
- genX21 := bar_index - nX21
- genY22 := low[nX22]
- genX22 := bar_index - nX22
- genY23 := high[nX23]
- genX23 := bar_index - nX23
- genY24 := low[nX24]
- genX24 := bar_index - nX24
- genY25 := high[nX25]
- genX25 := bar_index - nX25
- else
- genY1 := low[nX1]
- genX1 := bar_index - nX1
- genY2 := high[nX2]
- genX2 := bar_index - nX2
- genY3 := low[nX3]
- genX3 := bar_index - nX3
- genY4 := high[nX4]
- genX4 := bar_index - nX4
- genY5 := low[nX5]
- genX5 := bar_index - nX5
- genY6 := high[nX6]
- genX6 := bar_index - nX6
- genY7 := low[nX7]
- genX7 := bar_index - nX7
- genY8 := high[nX8]
- genX8 := bar_index - nX8
- genY9 := low[nX9]
- genX9 := bar_index - nX9
- genY10 := high[nX10]
- genX10 := bar_index - nX10
- genY11 := low[nX11]
- genX11 := bar_index - nX11
- genY12 := high[nX12]
- genX12 := bar_index - nX12
- genY13 := low[nX13]
- genX13 := bar_index - nX13
- genY14 := high[nX14]
- genX14 := bar_index - nX14
- genY15 := low[nX15]
- genX15 := bar_index - nX15
- genY16 := high[nX16]
- genX16 := bar_index - nX16
- genY17 := low[nX17]
- genX17 := bar_index - nX17
- genY18 := high[nX18]
- genX18 := bar_index - nX18
- genY19 := low[nX19]
- genX19 := bar_index - nX19
- genY20 := high[nX20]
- genX20 := bar_index - nX20
- genY21 := low[nX21]
- genX21 := bar_index - nX21
- genY22 := high[nX22]
- genX22 := bar_index - nX22
- genY23 := low[nX23]
- genX23 := bar_index - nX23
- genY24 := high[nX24]
- genX24 := bar_index - nX24
- genY25 := low[nX25]
- genX25 := bar_index - nX25
- if(barstate.islast or barstate.isrealtime)
- var L1 = line.new(genX2,genY2,genX1,genY1,color=i, style=line.style_solid, width=w)
- var L2 = line.new(genX3,genY3,genX2,genY2,color=i, style=line.style_solid, width=w)
- var L3 = line.new(genX4,genY4,genX3,genY3,color=i, style=line.style_solid, width=w)
- var L4 = line.new(genX5,genY5,genX4,genY4,color=i, style=line.style_solid, width=w)
- var L5 = line.new(genX6,genY6,genX5,genY5,color=i, style=line.style_solid, width=w)
- var L6 = line.new(genX7,genY7,genX6,genY6,color=i, style=line.style_solid, width=w)
- var L7 = line.new(genX8,genY8,genX7,genY7,color=i, style=line.style_solid, width=w)
- var L8 = line.new(genX9,genY9,genX8,genY8,color=i, style=line.style_solid, width=w)
- var L9 = line.new(genX10,genY10,genX9,genY9,color=i, style=line.style_solid, width=w)
- var L10 = line.new(genX11,genY11,genX10,genY10,color=i, style=line.style_solid, width=w)
- var L11 = line.new(genX12,genY12,genX11,genY11,color=i, style=line.style_solid, width=w)
- var L12 = line.new(genX13,genY13,genX12,genY12,color=i, style=line.style_solid, width=w)
- var L13 = line.new(genX14,genY14,genX13,genY13,color=i, style=line.style_solid, width=w)
- var L14 = line.new(genX15,genY15,genX14,genY14,color=i, style=line.style_solid, width=w)
- var L15 = line.new(genX16,genY16,genX15,genY15,color=i, style=line.style_solid, width=w)
- var L16 = line.new(genX17,genY17,genX16,genY16,color=i, style=line.style_solid, width=w)
- var L17 = line.new(genX18,genY18,genX17,genY17,color=i, style=line.style_solid, width=w)
- var L18 = line.new(genX19,genY19,genX18,genY18,color=i, style=line.style_solid, width=w)
- var L19 = line.new(genX20,genY20,genX19,genY19,color=i, style=line.style_solid, width=w)
- var L20 = line.new(genX21,genY21,genX20,genY20,color=i, style=line.style_solid, width=w)
- var L21 = line.new(genX22,genY22,genX21,genY21,color=i, style=line.style_solid, width=w)
- var L22 = line.new(genX23,genY23,genX22,genY22,color=i, style=line.style_solid, width=w)
- var L23 = line.new(genX24,genY24,genX23,genY23,color=i, style=line.style_solid, width=w)
- var L24 = line.new(genX25,genY25,genX24,genY24,color=i, style=line.style_solid, width=w)
Add Comment
Please, Sign In to add comment