• Pine Script™ introduces methods (1, 2)! Much kuddos for the developers, Tradingview, and all who has worked on it! • This educational script will show the simplified way of writing built-in methods, not to create a new method.
• The basic principles are: · Find 1 point (close) x bars back from current bar (settings: 'x close back').
· Create a 'Flare' shaped object from that point to current bar or further (dependable of "Width of Flare"). · Calculate where current close is located versus the Flare lines. · On that bases, change colour and draw plotshapes. · Below bar if current close is located in the upper part of the Flare · Above bar if current close is located in the lower part of the Flare · Above & Below if located in the middle part of the Flare -> Above & Below colours has 3 different colours (adjustable), dependable on the position
🔶 EXAMPLES
· Neutral zone:
· Light Bullish zone:
· Bullish zone:
· Very Bullish / Overbought zone:
· Light Bearish zone:
· Bearish zone:
· Very Bearish / Oversold zone:
🔶 TECHNIQUES
🔹 I. Make a User Defined Type (UDT) Flare, with:
· 5x linefill[] - array of linefill · int iDir, which captures the direction (current location of close in Flare) · color cCol, this is a colour variable in relation to the direction.
🔹 II. Different functions will add a new Flare object, and update the values on each bar.
· Explanation of each function can be found in the script.
🔶 EXTRA's
· The input.color() is located in the function set_flare_B(flare obj) · Best to put the inputs at the beginning of the script, I included this alternative just to show it is possible (but mostly not ideal) · Background colour (settings: Bgcolor) can be enabled for better visibility of colours
진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.