Advertisement
cnws02

Candle Variable Midpoint

Oct 20th, 2022
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. //@version=5
  2. indicator("variable Midpoint", overlay=true)
  3.  
  4. percent =input.int(50,"% from lower",1,100)
  5.  
  6. midColor = color.rgb(255, 255, 255)
  7.  
  8. var float midPoint = 0
  9.  
  10. if open > close
  11. midPoint := ((open - close) * (percent / 100)) + close
  12. else
  13. midPoint := ((close - open) * (percent / 100)) + open
  14.  
  15. plotcandle(midPoint, midPoint, midPoint, midPoint, title = '', color = midColor,
  16. wickcolor = na, bordercolor = midColor, editable = false,
  17. display = display.all - display.status_line - display.data_window)
Tags: tradingview
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement