xmd79

Price-Drive MTF Instagram LuckyNickVA

Jun 26th, 2023
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.84 KB | None | 0 0
  1. // Custom Coding For Nickafella
  2. //@version=4
  3. study("Price-Drive MTF Instagram LuckyNickVA", overlay=true)
  4. t=input(title="Timeframe", type=input.resolution, defval="")
  5. i=input(title="Line Color", type=input.color, defval=color.black)
  6. w=input(4,"Width", minval=1, maxval=24)
  7. HH=0.0
  8. LL=0.0
  9. x1=0
  10. x2=0
  11. x3=0
  12. x4=0
  13. x5=0
  14. x6=0
  15. x7=0
  16. x8=0
  17. x9=0
  18. x10=0
  19. x11=0
  20. x12=0
  21. x13=0
  22. x14=0
  23. x15=0
  24. x16=0
  25. x17=0
  26. x18=0
  27. x19=0
  28. x20=0
  29. x21=0
  30. x22=0
  31. x23=0
  32. x24=0
  33. x25=0
  34. nX1=0
  35. nX2=0
  36. nX3=0
  37. nX4=0
  38. nX5=0
  39. nX6=0
  40. nX7=0
  41. nX8=0
  42. nX9=0
  43. nX10=0
  44. nX11=0
  45. nX12=0
  46. nX13=0
  47. nX14=0
  48. nX15=0
  49. nX16=0
  50. nX17=0
  51. nX18=0
  52. nX19=0
  53. nX20=0
  54. nX21=0
  55. nX22=0
  56. nX23=0
  57. nX24=0
  58. nX25=0
  59. genX1=0
  60. genY1=0.0
  61. genX2=0
  62. genY2=0.0
  63. genX3=0
  64. genY3=0.0
  65. genX4=0
  66. genY4=0.0
  67. genX5=0
  68. genY5=0.0
  69. genX6=0
  70. genY6=0.0
  71. genX7=0
  72. genY7=0.0
  73. genX8=0
  74. genY8=0.0
  75. genX9=0
  76. genY9=0.0
  77. genX10=0
  78. genY10=0.0
  79. genX11=0
  80. genY11=0.0
  81. genX12=0
  82. genY12=0.0
  83. genX13=0
  84. genY13=0.0
  85. genX14=0
  86. genY14=0.0
  87. genX15=0
  88. genY15=0.0
  89. genX16=0
  90. genY16=0.0
  91. genX17=0
  92. genY17=0.0
  93. genX18=0
  94. genY18=0.0
  95. genX19=0
  96. genY19=0.0
  97. genX20=0
  98. genY20=0.0
  99. genX21=0
  100. genY21=0.0
  101. genX22=0
  102. genY22=0.0
  103. genX23=0
  104. genY23=0.0
  105. genX24=0
  106. genY24=0.0
  107. genX25=0
  108. genY25=0.0
  109. direction=0
  110. pinLow=0
  111. pinHigh=0
  112. bullish=false
  113. // Define Terms
  114. srcC=security(syminfo.tickerid, t, close)
  115. srcO=security(syminfo.tickerid, t, open)
  116. bullish:=srcC>srcO
  117. direction:=bullish?1:-1
  118. if(barstate.isfirst == false)
  119. if (direction>0)
  120. HH:=direction[1]<0?high:max(high,HH[1])
  121. LL:=LL[1]
  122. else
  123. LL:=direction[1]>0?low:min(low,LL[1])
  124. HH:=HH[1]
  125. pinHigh:=HH==high?bar_index:HH[1]==high[1] and high<=high[1]?bar_index-1:pinHigh[1]
  126. pinLow:=LL==low?bar_index:LL[1]==low[1] and low>=low[1]?bar_index-1:pinLow[1]
  127. if (direction < direction[1])
  128. x25 := x24[1]
  129. x24 := x23[1]
  130. x23 := x22[1]
  131. x22 := x21[1]
  132. x21 := x20[1]
  133. x20 := x19[1]
  134. x19 := x18[1]
  135. x18 := x17[1]
  136. x17 := x16[1]
  137. x16 := x15[1]
  138. x15 := x14[1]
  139. x14 := x13[1]
  140. x13 := x12[1]
  141. x12 := x11[1]
  142. x11 := x10[1]
  143. x10 := x9[1]
  144. x9 := x8[1]
  145. x8 := x7[1]
  146. x7 := x6[1]
  147. x6 := x5[1]
  148. x5 := x4[1]
  149. x4 := x3[1]
  150. x3 := x2[1]
  151. x2 := pinHigh
  152. else if (direction > direction[1])
  153. x25 := x24[1]
  154. x24 := x23[1]
  155. x23 := x22[1]
  156. x22 := x21[1]
  157. x21 := x20[1]
  158. x20 := x19[1]
  159. x19 := x18[1]
  160. x18 := x17[1]
  161. x17 := x16[1]
  162. x16 := x15[1]
  163. x15 := x14[1]
  164. x14 := x13[1]
  165. x13 := x12[1]
  166. x12 := x11[1]
  167. x11 := x10[1]
  168. x10 := x9[1]
  169. x9 := x8[1]
  170. x8 := x7[1]
  171. x7 := x6[1]
  172. x6 := x5[1]
  173. x5 := x4[1]
  174. x4 := x3[1]
  175. x3 := x2[1]
  176. x2 := pinLow
  177. else
  178. x25 := x25[1]
  179. x24 := x24[1]
  180. x23 := x23[1]
  181. x22 := x22[1]
  182. x21 := x21[1]
  183. x20 := x20[1]
  184. x19 := x19[1]
  185. x18 := x18[1]
  186. x17 := x17[1]
  187. x16 := x16[1]
  188. x15 := x15[1]
  189. x14 := x14[1]
  190. x13 := x13[1]
  191. x12 := x12[1]
  192. x11 := x11[1]
  193. x10 := x10[1]
  194. x9 := x9[1]
  195. x8 := x8[1]
  196. x7 := x7[1]
  197. x6 := x6[1]
  198. x5 := x5[1]
  199. x4 := x4[1]
  200. x3 := x3[1]
  201. x2 := x2[1]
  202. // Locate ZZ points
  203. x1 := direction > 0 ? pinHigh : direction < 0 ? pinLow : x1[1]
  204. nX1 := bar_index - x1
  205. nX5 := bar_index - x5
  206. nX2 := bar_index - x2
  207. nX3 := bar_index - x3
  208. nX4 := bar_index - x4
  209. nX4 := bar_index - x4
  210. nX6 := bar_index - x6
  211. nX7 := bar_index - x7
  212. nX8 := bar_index - x8
  213. nX9 := bar_index - x9
  214. nX10 := bar_index - x10
  215. nX11 := bar_index - x11
  216. nX12 := bar_index - x12
  217. nX13 := bar_index - x13
  218. nX14 := bar_index - x14
  219. nX15 := bar_index - x15
  220. nX16 := bar_index - x16
  221. nX17 := bar_index - x17
  222. nX18 := bar_index - x18
  223. nX19 := bar_index - x19
  224. nX20 := bar_index - x20
  225. nX21 := bar_index - x21
  226. nX22 := bar_index - x22
  227. nX23 := bar_index - x23
  228. nX24 := bar_index - x24
  229. nX25 := bar_index - x25
  230. // Generate X & Y Points
  231. if (direction > 0)
  232. genY1 := high[nX1]
  233. genX1 := bar_index - nX1
  234. genY2 := low[nX2]
  235. genX2 := bar_index - nX2
  236. genY3 := high[nX3]
  237. genX3 := bar_index - nX3
  238. genY4 := low[nX4]
  239. genX4 := bar_index - nX4
  240. genY5 := high[nX5]
  241. genX5 := bar_index - nX5
  242. genY6 := low[nX6]
  243. genX6 := bar_index - nX6
  244. genY7 := high[nX7]
  245. genX7 := bar_index - nX7
  246. genY8 := low[nX8]
  247. genX8 := bar_index - nX8
  248. genY9 := high[nX9]
  249. genX9 := bar_index - nX9
  250. genY10 := low[nX10]
  251. genX10 := bar_index - nX10
  252. genY11 := high[nX11]
  253. genX11 := bar_index - nX11
  254. genY12 := low[nX12]
  255. genX12 := bar_index - nX12
  256. genY13 := high[nX13]
  257. genX13 := bar_index - nX13
  258. genY14 := low[nX14]
  259. genX14 := bar_index - nX14
  260. genY15 := high[nX15]
  261. genX15 := bar_index - nX15
  262. genY16 := low[nX16]
  263. genX16 := bar_index - nX16
  264. genY17 := high[nX17]
  265. genX17 := bar_index - nX17
  266. genY18 := low[nX18]
  267. genX18 := bar_index - nX18
  268. genY19 := high[nX19]
  269. genX19 := bar_index - nX19
  270. genY20 := low[nX20]
  271. genX20 := bar_index - nX20
  272. genY21 := high[nX21]
  273. genX21 := bar_index - nX21
  274. genY22 := low[nX22]
  275. genX22 := bar_index - nX22
  276. genY23 := high[nX23]
  277. genX23 := bar_index - nX23
  278. genY24 := low[nX24]
  279. genX24 := bar_index - nX24
  280. genY25 := high[nX25]
  281. genX25 := bar_index - nX25
  282. else
  283. genY1 := low[nX1]
  284. genX1 := bar_index - nX1
  285. genY2 := high[nX2]
  286. genX2 := bar_index - nX2
  287. genY3 := low[nX3]
  288. genX3 := bar_index - nX3
  289. genY4 := high[nX4]
  290. genX4 := bar_index - nX4
  291. genY5 := low[nX5]
  292. genX5 := bar_index - nX5
  293. genY6 := high[nX6]
  294. genX6 := bar_index - nX6
  295. genY7 := low[nX7]
  296. genX7 := bar_index - nX7
  297. genY8 := high[nX8]
  298. genX8 := bar_index - nX8
  299. genY9 := low[nX9]
  300. genX9 := bar_index - nX9
  301. genY10 := high[nX10]
  302. genX10 := bar_index - nX10
  303. genY11 := low[nX11]
  304. genX11 := bar_index - nX11
  305. genY12 := high[nX12]
  306. genX12 := bar_index - nX12
  307. genY13 := low[nX13]
  308. genX13 := bar_index - nX13
  309. genY14 := high[nX14]
  310. genX14 := bar_index - nX14
  311. genY15 := low[nX15]
  312. genX15 := bar_index - nX15
  313. genY16 := high[nX16]
  314. genX16 := bar_index - nX16
  315. genY17 := low[nX17]
  316. genX17 := bar_index - nX17
  317. genY18 := high[nX18]
  318. genX18 := bar_index - nX18
  319. genY19 := low[nX19]
  320. genX19 := bar_index - nX19
  321. genY20 := high[nX20]
  322. genX20 := bar_index - nX20
  323. genY21 := low[nX21]
  324. genX21 := bar_index - nX21
  325. genY22 := high[nX22]
  326. genX22 := bar_index - nX22
  327. genY23 := low[nX23]
  328. genX23 := bar_index - nX23
  329. genY24 := high[nX24]
  330. genX24 := bar_index - nX24
  331. genY25 := low[nX25]
  332. genX25 := bar_index - nX25
  333. if(barstate.islast or barstate.isrealtime)
  334. var L1 = line.new(genX2,genY2,genX1,genY1,color=i, style=line.style_solid, width=w)
  335. var L2 = line.new(genX3,genY3,genX2,genY2,color=i, style=line.style_solid, width=w)
  336. var L3 = line.new(genX4,genY4,genX3,genY3,color=i, style=line.style_solid, width=w)
  337. var L4 = line.new(genX5,genY5,genX4,genY4,color=i, style=line.style_solid, width=w)
  338. var L5 = line.new(genX6,genY6,genX5,genY5,color=i, style=line.style_solid, width=w)
  339. var L6 = line.new(genX7,genY7,genX6,genY6,color=i, style=line.style_solid, width=w)
  340. var L7 = line.new(genX8,genY8,genX7,genY7,color=i, style=line.style_solid, width=w)
  341. var L8 = line.new(genX9,genY9,genX8,genY8,color=i, style=line.style_solid, width=w)
  342. var L9 = line.new(genX10,genY10,genX9,genY9,color=i, style=line.style_solid, width=w)
  343. var L10 = line.new(genX11,genY11,genX10,genY10,color=i, style=line.style_solid, width=w)
  344. var L11 = line.new(genX12,genY12,genX11,genY11,color=i, style=line.style_solid, width=w)
  345. var L12 = line.new(genX13,genY13,genX12,genY12,color=i, style=line.style_solid, width=w)
  346. var L13 = line.new(genX14,genY14,genX13,genY13,color=i, style=line.style_solid, width=w)
  347. var L14 = line.new(genX15,genY15,genX14,genY14,color=i, style=line.style_solid, width=w)
  348. var L15 = line.new(genX16,genY16,genX15,genY15,color=i, style=line.style_solid, width=w)
  349. var L16 = line.new(genX17,genY17,genX16,genY16,color=i, style=line.style_solid, width=w)
  350. var L17 = line.new(genX18,genY18,genX17,genY17,color=i, style=line.style_solid, width=w)
  351. var L18 = line.new(genX19,genY19,genX18,genY18,color=i, style=line.style_solid, width=w)
  352. var L19 = line.new(genX20,genY20,genX19,genY19,color=i, style=line.style_solid, width=w)
  353. var L20 = line.new(genX21,genY21,genX20,genY20,color=i, style=line.style_solid, width=w)
  354. var L21 = line.new(genX22,genY22,genX21,genY21,color=i, style=line.style_solid, width=w)
  355. var L22 = line.new(genX23,genY23,genX22,genY22,color=i, style=line.style_solid, width=w)
  356. var L23 = line.new(genX24,genY24,genX23,genY23,color=i, style=line.style_solid, width=w)
  357. var L24 = line.new(genX25,genY25,genX24,genY24,color=i, style=line.style_solid, width=w)
Add Comment
Please, Sign In to add comment