Guest User

Untitled

a guest
Oct 22nd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.90 KB | None | 0 0
  1. //@version=4
  2. study(" Weight Systen", "Weight system", true, format.inherit)
  3. //code from linear regression used https://www.tradingview.com/script/CD7yUWRV-Linear-Regression-Trend-Channel/
  4. //code from pivots taken from https://www.tradingview.com/script/RqdDzaRp-Traditional-Pivot-Points-Alerts/
  5. // code for linear lines taken from https://www.tradingview.com/v/Mk7G47nS/
  6. period = input( 100, "Period" , input.integer, minval=3)
  7. deviations = input( 2.0, "Deviation(s)" , input.float , minval=0.1, step=0.1)
  8. periodMinusOne = period-1
  9. Ex = 0.0, Ey = 0.0, Ex2 = 0.0, Exy = 0.0, for i=0 to periodMinusOne
  10. closeI = nz(close[i]), Ex := Ex + i, Ey := Ey + closeI, Ex2 := Ex2 + (i * i), Exy := Exy + (closeI * i)
  11. ExEx = Ex * Ex, slope = Ex2==ExEx ? 0.0 : (period * Exy - Ex * Ey) / (period * Ex2 - ExEx)
  12. linearRegression = (Ey - slope * Ex) / period
  13. intercept = linearRegression + bar_index * slope
  14. deviation = 0.0, for i=0 to periodMinusOne
  15. deviation := deviation + pow(nz(close[i]) - (intercept - slope * (bar_index[i])), 2.0)
  16. deviation := deviations * sqrt(deviation / periodMinusOne)
  17. startingPointY = linearRegression + slope / periodMinusOne
  18. lineColor = startingPointY > startingPointY[1] ? color.blue : color.red
  19.  
  20.  
  21. //
  22. ///////////////
  23. // FUNCTIONS //
  24. ///////////////
  25.  
  26. // Function outputs 1 when it's the first bar of the D/W/M/Y
  27. is_newbar(res) =>
  28. ch = 0
  29. if(res == 'Y')
  30. t = year(time('D'))
  31. ch := change(t) != 0 ? 1 : 0
  32. else
  33. t = time(res)
  34. ch := change(t) != 0 ? 1 : 0
  35. ch
  36.  
  37. // Rounding levels to min tick
  38. nround(x) =>
  39. n = round(x / syminfo.mintick) * syminfo.mintick
  40.  
  41. ////////////
  42. // INPUTS //
  43. ////////////
  44.  
  45. pp_type = input(title = 'Pivot Type', defval = "Linear")
  46. pp_period = input(title = "Period", defval = "Day", type = input.string, options = ['Day', 'Week', 'Month', 'Year'])
  47. show_historical_levels = input(title = "Show Historical Levels?", defval = false, type = input.bool)
  48. show_level_value = input(title = "Show Levels Value?", defval = true, type = input.bool)
  49. show_current_levels = input(title = "Show Current Levels", defval = false, type = input.bool)
  50.  
  51. pp_res = pp_period == 'Day' ? 'D' : pp_period == 'Week' ? 'W' : pp_period == 'Month' ? 'M' : 'Y'
  52.  
  53. /////////////////////
  54. // Get HLC from HT //
  55.  
  56. // Calc Open
  57. open_cur = 0.0
  58. open_cur := is_newbar(pp_res) ? open : open_cur[1]
  59.  
  60. popen = 0.0
  61. popen := is_newbar(pp_res) ? open_cur[1] : popen[1]
  62.  
  63. // Calc High
  64. high_cur = 0.0
  65. high_cur := is_newbar(pp_res) ? high : max(high_cur[1], high)
  66.  
  67. phigh = 0.0
  68. phigh := is_newbar(pp_res) ? high_cur[1] : phigh[1]
  69.  
  70. // Calc Low
  71. low_cur = 0.0
  72. low_cur := is_newbar(pp_res) ? low : min(low_cur[1], low)
  73.  
  74. plow = 0.0
  75. plow := is_newbar(pp_res) ? low_cur[1] : plow[1]
  76.  
  77. // Calc Close
  78. pclose = 0.0
  79. pclose := is_newbar(pp_res) ? close[1] : pclose[1]
  80.  
  81.  
  82. ////////////////////////////
  83. // CALCULATE PIVOT POINTS //
  84. ////////////////////////////
  85.  
  86. PP = 0.0
  87. R1 = 0.0
  88. S1 = 0.0
  89.  
  90. if (pp_type == "Linear")
  91. PP := startingPointY
  92. R1 := PP + deviation
  93. S1 := PP - deviation
  94.  
  95.  
  96. // Projected levels
  97.  
  98. prPP = 0.0
  99. prR1 = 0.0
  100. prS1 = 0.0
  101.  
  102. if (pp_type == "Linear")
  103. prPP := startingPointY
  104. prR1 := prPP + deviation
  105. prS1 := prPP - deviation
  106.  
  107.  
  108. //////////////
  109. // PLOTTING //
  110.  
  111. bars_sinse = 0
  112. bars_sinse := is_newbar(pp_res) ? 0 : bars_sinse[1] + 1
  113.  
  114. ////////////////////////
  115. // PLOT PIVOTS LEVELS //
  116.  
  117. vpp_p = line.new(bar_index[min(bars_sinse, 300)], PP, bar_index, PP, color=color.gray, style = line.style_solid, extend = extend.none)
  118. vs1_p = line.new(bar_index[min(bars_sinse, 300)], S1, bar_index, S1, color=color.red, style = line.style_solid, extend = extend.none)
  119. vr1_p = line.new(bar_index[min(bars_sinse, 300)], R1, bar_index, R1, color=color.green, style = line.style_solid, extend = extend.none)
  120.  
  121. // delete previous lines in the same period
  122. if (not is_newbar(pp_res) or not show_historical_levels)
  123. line.delete(vpp_p[1])
  124. line.delete(vs1_p[1])
  125. line.delete(vr1_p[1])
  126.  
  127.  
  128.  
  129.  
  130. // Add labels
  131. label_vpp = label.new(bar_index, PP, text=show_level_value ? ("P" + " " + tostring(nround(PP))) : "P", style= label.style_none)
  132. label_vs1 = label.new(bar_index, S1, text=show_level_value ? ("S1" + " " + tostring(nround(S1))) : "S1", style= label.style_none)
  133. label_vr1 = label.new(bar_index, R1, text=show_level_value ? ("R1" + " " + tostring(nround(R1))) : "R1", style= label.style_none)
  134.  
  135.  
  136. label.delete(label_vpp[1])
  137. label.delete(label_vs1[1])
  138. label.delete(label_vr1[1])
  139.  
  140.  
  141. // Projected levels
  142. line vpp_pr = na
  143. line vs1_pr = na
  144. line vr1_pr = na
  145.  
  146.  
  147. if (show_current_levels)
  148.  
  149. vpp_pr = line.new(bar_index[1], prPP, bar_index, prPP, color=color.gray, style = line.style_dashed, extend = extend.right)
  150. vs1_pr = line.new(bar_index[1], prS1, bar_index, prS1, color=color.red, style = line.style_dashed, extend = extend.right)
  151. vr1_pr = line.new(bar_index[1], prR1, bar_index, prR1, color=color.green, style = line.style_dashed, extend = extend.right)
  152.  
  153.  
  154. line.delete(vpp_pr[1])
  155. line.delete(vs1_pr[1])
  156. line.delete(vr1_pr[1])
  157.  
  158. //
  159.  
  160. //
  161. extra = input(false)
  162. a5 = 0.
  163.  
  164. a5 := PP
  165. //----
  166. upper = 0.
  167. lower = 0.
  168.  
  169. upper :=R1
  170. lower := S1
  171. //----
  172. n = bar_index
  173. if barstate.islast and extra == true
  174. line A = line.new(n[1],upper[1],n,upper,extend=extend.right,color=#0080FF,style=line.style_dashed,width=2)
  175. line B = line.new(n[1],a5[1],n,a5,extend=extend.right,color=#e65100,style=line.style_dashed,width=2)
  176. line C = line.new(n[1],lower[1],n,lower,extend=extend.right,color=#ff1100,style=line.style_dashed,width=2)
  177. line.delete(A[1])
  178. line.delete(B[1])
  179. line.delete(C[1])
  180.  
  181. //
  182. //==== REGRESSION SLOPE
  183. src1 = input(close, title="Source")
  184. ext=input(true,title="Extend Lines")
  185. ln=ext?extend.right:extend.none
  186. //-- MEAN
  187. calcSlope(src1, period) =>
  188. if not barstate.islast
  189. [float(na), float(na), float(na)]
  190. else
  191. sumX = 0.0
  192. sumY = 0.0
  193. sumXSqr = 0.0
  194. sumXY = 0.0
  195. for i = 0 to period - 1
  196. val = src1[i]
  197. per = i + 1.0
  198. sumX := sumX + per
  199. sumY := sumY + val
  200. sumXSqr := sumXSqr + per * per
  201. sumXY := sumXY + val * per
  202. slope = (period * sumXY - sumX * sumY) / (period * sumXSqr - sumX * sumX)
  203. average = sumY / period
  204. intercept = average - slope * sumX / period + slope
  205. [slope, average, intercept]
  206. [s, a1, i] = calcSlope(src1, period)
  207.  
  208. //deviation code by jwammo12
  209. lrc = linreg(src1, period, 0)
  210. lrc1 = linreg(src1,period,1)
  211. lrSlope = (lrc-lrc1)
  212. lrIntercept = lrc - bar_index*lrSlope
  213. deviationSum = 0.0
  214. for z=0 to period-1
  215. deviationSum:= deviationSum + pow(src1[z]-(lrSlope*(bar_index-z)+lrIntercept), 2)
  216. deviation5 = sqrt(deviationSum/(period))
  217.  
  218. up = deviation5 * deviations //+lrc
  219. dn = deviation5 * deviations
  220.  
  221. startPrice = (i + s * (period - 1))
  222. endPrice = i
  223.  
  224.  
  225. ///////////////////
  226. var line baseLine3 = na
  227. if na(baseLine3)
  228. baseLine3 := line.new(bar_index - period + 1, startPrice, bar_index, endPrice, width=5, color=color.blue, style=line.style_dotted)
  229. else
  230. line.set_xy1(baseLine3, bar_index - period + 1, startPrice)
  231. line.set_xy2(baseLine3, bar_index, endPrice)
  232. na //
  233.  
  234.  
  235. //////////High Channel//////////////
  236. var line baseLine1 = na
  237. if na(baseLine1)
  238. baseLine1 := line.new(bar_index - period + 1, startPrice + up, bar_index, endPrice + up, width=5, color=color.red, style=line.style_dotted)
  239. else
  240. line.set_xy1(baseLine1, bar_index - period + 1, startPrice + up)
  241. line.set_xy2(baseLine1, bar_index, endPrice + up)
  242. na //
  243.  
  244. ////////////////Low Channel///////////////////
  245. var line baseLine2 = na
  246. if na(baseLine2)
  247. baseLine2 := line.new(bar_index - period + 1, startPrice-dn, bar_index, endPrice-dn, width=5, color=color.red, style=line.style_dotted)
  248. else
  249. line.set_xy1(baseLine2, bar_index - period + 1, startPrice- dn)
  250. line.set_xy2(baseLine2, bar_index, endPrice- dn)
  251. na //
  252.  
  253. hilow = ((high - low)*100)
  254. openclose = ((close - open)*100)
  255. vol1 = (volume / hilow)
  256. spreadvol = (openclose * vol1)
  257. VPT = spreadvol + cum(spreadvol)
  258. window_len = 28
  259.  
  260. v_len = 14
  261. price_spread = stdev(high-low, window_len)
  262.  
  263. vp = spreadvol + cum(spreadvol)
  264. smooth = sma(vp, v_len)
  265. v_spread = stdev(vp - smooth, window_len)
  266. shadow = (vp - smooth) / v_spread * price_spread
  267.  
  268. out1 = shadow > 0 ? high + shadow : low + shadow
  269.  
  270. //plot(out, style=line,linewidth=3, color=color)
  271. len=input(5)
  272. vpt=ema(out1,len)
  273.  
  274.  
  275. // INPUTS //
  276. st_mult = input(3, title = 'SuperTrend Multiplier', minval = 0, maxval = 100, step = 0.01)
  277. st_period = input(7, title = 'SuperTrend Period', minval = 1)
  278.  
  279. // CALCULATIONS //
  280. up_lev = vpt - (st_mult * atr(st_period))
  281. dn_lev = vpt + (st_mult * atr(st_period))
  282.  
  283. up_trend = 0.0
  284. up_trend := close[1] > up_trend[1] ? max(up_lev, up_trend[1]) : up_lev
  285.  
  286. down_trend = 0.0
  287. down_trend := close[1] < down_trend[1] ? min(dn_lev, down_trend[1]) : dn_lev
  288.  
  289. // Calculate trend var
  290. trend10 = 0
  291. trend10 := close > down_trend[1] ? 1: close < up_trend[1] ? -1 : nz(trend10[1], 1)
  292.  
  293. // Calculate SuperTrend Line
  294. st_line = trend10 ==1 ? up_trend : down_trend
  295.  
  296.  
  297.  
  298. //
  299. // inputs
  300. Depth = input(12, title="Depth") // Depth
  301. Deviation = input(5, title="Deviation") // Deviation
  302.  
  303. // ZigZag
  304. lastlow = 0.0, lasthigh = 0.0
  305. lastlow := nz(lastlow[1])
  306. lasthigh := nz(lasthigh[1])
  307.  
  308. data(x) =>
  309. d = security(syminfo.tickerid, timeframe.period, x, gaps = barmerge.gaps_off, lookahead = barmerge.lookahead_on)
  310. d
  311. getLow(x, y, z, a) =>
  312. lastlow = y
  313. v = data(x)
  314. m = v==lastlow or data(z) - v > a*syminfo.mintick
  315. if v!=lastlow
  316. lastlow := v
  317. if m
  318. v := 0.0
  319. [v,lastlow]
  320. getHigh(x, y, z, a) =>
  321. lasthigh = y
  322. v = data(x)
  323. m = v==lasthigh or v - data(z) > a*syminfo.mintick
  324. if v!=lasthigh
  325. lasthigh := v
  326. if m
  327. v := 0.0
  328. [v,lasthigh]
  329.  
  330. [v,e] = getLow(lowest(Depth), lastlow, low, Deviation)
  331. lastlow := e
  332. zBB = v != 0.0
  333. [v1,e1] = getHigh(highest(Depth), lasthigh, high, Deviation)
  334. lasthigh := e1
  335. zSS = v1 != 0.0
  336.  
  337. zigzagDirection = -1
  338. zigzagHigh = 0
  339. zigzagLow = 0
  340. zigzagDirection := zBB ? 0 : zSS ? 1 : nz(zigzagDirection[1], -1)
  341. virtualLow = zigzagLow[1] + 1
  342. if not zBB or (zBB and zigzagDirection == zigzagDirection[1] and low > low[virtualLow])
  343. zigzagLow := nz(zigzagLow[1]) + 1
  344. virtualHigh = zigzagHigh[1] + 1
  345. if not zSS or (zSS and zigzagDirection == zigzagDirection[1] and high < high[virtualHigh])
  346. zigzagHigh := nz(zigzagHigh[1]) + 1
  347. a=bar_index-zigzagLow
  348. b=bar_index-zigzagHigh
  349. var color c = na, c := fixnan(a < b[1] ? color.lime : a > b[1] ? color.red : na)
  350. //line zigzag = line.new(bar_index-zigzagLow, low[zigzagLow], bar_index-zigzagHigh, high[zigzagHigh], color=c, style=line.style_solid, width=4)
  351. //if (zigzagDirection == zigzagDirection[1])
  352. //line.delete(zigzag[1])
  353.  
  354. zzPrevHigh = zigzagHigh[1]
  355. zzPrevLow = zigzagLow[1]
  356. if not na(zzPrevHigh[1])
  357. zzPrevHigh := zzPrevHigh[1] + 1
  358. if not na(zzPrevLow[1])
  359. zzPrevLow := zzPrevLow[1] + 1
  360. if zigzagDirection != zigzagDirection[1]
  361. if zigzagDirection == 1
  362. zzPrevHigh := zigzagHigh[1] + 1
  363. if zigzagDirection == 0
  364. zzPrevLow := zigzagLow[1] + 1
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371. //
  372. src = input(close, title="Source")
  373. //sma
  374. sma20 = sma(src, 20)
  375. smapoint = 0
  376. smapoint := src > sma20 ? smapoint + 1 : smapoint - 1
  377.  
  378.  
  379. //AO
  380. ao = sma(hl2,5) - sma(hl2,34)
  381. aopoint = ao > 0 ? 1 : ao < 0 ? -1 : 0
  382. //momentum
  383. mom = src - src[14]
  384. mompoint = mom > 0 ? 1 : mom < 0 ? -1 : 0
  385. //MACD
  386. fast_ma = ema(src, 12)
  387. slow_ma = ema(src, 26)
  388. macd = fast_ma - slow_ma
  389. signal = ema(macd, 9)
  390. hist = macd - signal
  391. histpoint = hist > hist[1] ? 3 : -3
  392.  
  393. //Bull bear
  394. Length = 30
  395. r1=iff(close[1]<open,max(open-close[1],high-low),high-low)
  396. r2=iff(close[1]>open,max(close[1]-open,high-low),high-low)
  397. bull=iff(close==open,iff(high-close==close-low,iff(close[1]>open,max(high-open,close-low),r1),iff(high-close>close-low,iff(close[1]<open, max(high-close[1],close-low), high-open),r1)),iff(close<open,iff(close[1]<open,max(high-close[1],close-low), max(high-open,close-low)),r1))
  398. bear=iff(close==open,iff(high-close==close-low,iff(close[1]<open,max(open-low,high-close),r2),iff(high-close>close-low,r2,iff(close[1]>open,max(close[1]-low,high-close), open-low))),iff(close<open,r2,iff(close[1]>open,max(close[1]-low,high-close),max(open-low,high-close))))
  399. colors=iff(sma(bull-bear,Length)>0, color.green, color.red)
  400. // barcolor(colors)
  401. bbpoint = sma(bull-bear,Length)>0 ? 1 : -1
  402. //UO
  403. length7 = 7,
  404. length14 = 14,
  405. length28 = 28
  406. average(bp, tr_, length) => sum(bp, length) / sum(tr_, length)
  407. high_ = max(high, src[1])
  408. low_ = min(low, src[1])
  409. bp = src - low_
  410. tr_ = high_ - low_
  411. avg7 = average(bp, tr_, length7)
  412. avg14 = average(bp, tr_, length14)
  413. avg28 = average(bp, tr_, length28)
  414. uoout = 100 * (4*avg7 + 2*avg14 + avg28)/7
  415. uopoint = uoout > 70 ? 1 : uoout < 30 ? -1 : 0
  416. //IC
  417. conversionPeriods = 9
  418. basePeriods = 26
  419. laggingSpan2Periods = 52
  420. displacement = 26
  421. donchian(len) => avg(lowest(len), highest(len))
  422. baseLine = donchian(basePeriods)
  423. icpoint = src > baseLine ? 1 : -1
  424.  
  425. //HMA
  426. hullma = wma(2*wma(src, 9/2)-wma(src, 21), round(sqrt(21)))
  427. hmapoint = src > hullma ? 2 : -2
  428. //
  429. //
  430. trendDetectionLength =4
  431. float trend = na
  432. float wave = na
  433. float vol = na
  434. mov = close>close[1] ? 1 : close<close[1] ? -1 : 0
  435. trend := (mov != 0) and (mov != mov[1]) ? mov : nz(trend[1])
  436. isTrending = rising(close, trendDetectionLength) or falling(close, trendDetectionLength)
  437. wave := (trend != nz(wave[1])) and isTrending ? trend : nz(wave[1])
  438. vol := wave == wave[1] ? (nz(vol[1])+volume) : volume
  439. up1 = wave == 1 ? vol : 0
  440. dn1 = wave == 1 ? 0 : vol
  441. Weis= up1 > dn1 ? 2 : -2
  442.  
  443.  
  444. //
  445.  
  446. stochlen = 14
  447. roclen =20
  448. ccilen =21
  449. dilen = 5
  450. dirmov(len) =>
  451. up = change(high)
  452. down = -change(low)
  453. truerange = rma(tr, len)
  454. plus = fixnan(100 * rma(up > down and up > 0 ? up : 0, len) / truerange)
  455. minus = fixnan(100 * rma(down > up and down > 0 ? down : 0, len) / truerange)
  456. [plus, minus]
  457.  
  458. f_draw_infopanel(_x, _y, _line, _text, _color)=>
  459. _rep_text = ""
  460. for _l = 0 to _line
  461. _rep_text := _rep_text + "\n"
  462. _rep_text := _rep_text + _text
  463. var label _la = na
  464. label.delete(_la)
  465. _la := label.new(
  466. x=_x, y=_y,
  467. text=_rep_text, xloc=xloc.bar_time, yloc=yloc.price,
  468. color=color.black, style=label.style_labelup, textcolor=_color, size=size.normal)
  469.  
  470. TD = 0
  471. TS = 0
  472. TD := close > close[4] ? nz(TD[1]) + 1 : 0
  473. TS := close < close[4] ? nz(TS[1]) + 1 : 0
  474. TDUp = TD - valuewhen(TD < TD[1], TD , 1 )
  475. TDDn = TS - valuewhen(TS < TS[1], TS , 1 )
  476. stoch = stoch(close, high, low, stochlen)
  477. roc = roc(close, roclen)
  478. Roc=roc > 0 ? 1 : -1
  479. cci = cci(close, ccilen)
  480. CCI=cci > 0? 2 : -2
  481. [plus, minus] = dirmov(dilen)
  482. dmi = plus - minus
  483. DMI= dmi >= 0? 2 : -2
  484. //
  485. Zig=a<b? 1 : -1
  486. //
  487. STT=trend10 == 1 ? 1 : -1
  488. //
  489. AF_initial = input(0.02)
  490. AF_increment = input(0.02)
  491. AF_maximum = input(0.2)
  492.  
  493.  
  494. // start with uptrend
  495. uptrend = true
  496. newtrend = false
  497. EP = high
  498. SAR = low
  499. AF = AF_initial
  500.  
  501. if not na(uptrend[1]) and not na(newtrend[1])
  502. if uptrend[1]
  503. EP := max(high, EP[1])
  504. else
  505. EP := min(low, EP[1])
  506. if newtrend[1]
  507. AF := AF_initial
  508. else
  509. if EP != EP[1]
  510. AF := min(AF_maximum, AF[1] + AF_increment)
  511. else
  512. AF := AF[1]
  513. SAR := SAR[1] + AF * (EP - SAR[1])
  514. if uptrend[1]
  515. if newtrend
  516. SAR := max(high, EP[1])
  517. EP := min(low, low[1])
  518. else
  519. SAR := min(SAR, low[1])
  520. if not na(low[2])
  521. SAR := min(SAR, low[2])
  522. if SAR > low
  523. uptrend := false
  524. newtrend := true
  525. SAR := max(high, EP[1])
  526. EP := min(low, low[1])
  527. else
  528. uptrend := true
  529. newtrend := false
  530. else
  531. if newtrend
  532. SAR := min(low, EP[1])
  533. EP := max(high, high[1])
  534. else
  535. SAR := max(SAR, high[1])
  536. if not na(high[2])
  537. SAR := max(SAR, high[2])
  538. if SAR < high
  539. uptrend := true
  540. newtrend := true
  541. SAR := min(low, EP[1])
  542. EP := max(high, high[1])
  543. else
  544. uptrend := false
  545. newtrend := false
  546.  
  547. x=close-SAR
  548. //
  549. sar=x>0? 3 : -3
  550. //
  551. totalpoints =sar+STT+Zig+Roc+DMI+ CCI+Weis+smapoint + aopoint + mompoint + histpoint + bbpoint + icpoint + hmapoint
  552. //
  553.  
  554.  
  555. disp_panels = input(true, title="Display info panels?")
  556. h=R1
  557. info_label_off1 = input(70, title="Info panel offset")
  558. info_label_size = input(size.normal, options=[size.tiny, size.small, size.normal, size.large, size.huge], title="Info panel label size")
  559. info_panel_x = timenow + round(change(time)*info_label_off1)
  560. info_panel_y = h
  561.  
  562. info_title= "-=-=-=-=- Info Panel -=-=-=-=-"
  563. info_div = "\n\n------------------------------"
  564. info_current_close = "\n\Total points : " + tostring(totalpoints)
  565.  
  566. info_text =info_title+info_current_close
  567. info_panel = disp_panels ? label.new(x=info_panel_x, y=info_panel_y, text=info_text, xloc=xloc.bar_time, yloc=yloc.price, color=color.yellow, style=label.style_labelup, textcolor=color.black, size=info_label_size) : na
  568. label.delete(info_panel[1])
  569.  
  570. //
  571. //
  572. info_label_off = input(30, title="Info panel offset")
  573. posx = timenow + round(change(time)*info_label_off)
  574. posy = R1
  575.  
  576.  
  577. f_draw_infopanel(posx, posy, 6, " Strong Buy",totalpoints>7 ? color.green : color.black)
  578. f_draw_infopanel(posx, posy, 4, "Strong Sell", totalpoints < -7 ? color.red : color.black)
  579. f_draw_infopanel(posx, posy, 2, "Buy",totalpoints>=1 and totalpoints<=7? color.lime : color.black)
  580. f_draw_infopanel(posx, posy, 0, "Sell", totalpoints <= -1 and totalpoints>=-7? color.orange : color.black)
Add Comment
Please, Sign In to add comment