fikira

Diamonds

✋ Experimental script where a diamond shape is created by making 4 lines around each bar which touches the edge of the bar.


𒀸 Example of how it works:
      Create the left upper line:
      
  • A) Calculate middle of the bar
          
  • B) Calculate which one is highest -> close or open
          
  •     'Draw' imaginary line from A to B (A starts 1 bar back)
          
  •      Adjust height of A by adding 2/3 of the difference between A & B
        𒓕 That's it!

𒀸 This technique can be developed further by anyone who's inspired.
     •  For now, I've just added an option where you can extend 2 lines of 1 specific bar
        𒓕 Settings ➺ extend lines ➺ toggle on/off ➺ type ➺ which bar back

𒀸 X bars back sets the max bars in history
    •  Since this script uses line.new()  , this results in maximum 500 lines to be drawn.
        Each Diamand Bar contains 4 lines, resulting in maximum 125 Diamond Bars.

𒀸 Standard Candles ~ Diamond Bars

Cheers!

LuxAlgo Dev: www.luxalgo.com
PineCoder: www.pinecoders.com

- We cannot control our emotions,
but we can control our keyboard -
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?