Plot Arrow
Yaser Rahmati | یاسر رحمتی
Last updated
Yaser Rahmati | یاسر رحمتی
Last updated
This script creates a custom indicator called "Plot Arrow" that plots arrows based on the difference between the closing and opening prices of each bar. If the closing price is higher than the opening price, a green upward arrow is plotted. If the closing price is lower than the opening price, a red downward arrow is plotted. The arrows have a fixed height of 50 units.
This line specifies that the script is written in Pine Script version 5.
This line declares an indicator with the name "Plot Arrow". This name will appear on the chart when the indicator is added.
This line defines a variable arrowType
which is calculated as the difference between the closing price (close
) and the opening price (open
) of each bar (candlestick).
plotarrow
is a function used to plot arrows on the chart.
arrowType
: The data series based on which the arrows are plotted. Positive values will plot upwards arrows, and negative values will plot downwards arrows.
title = "ARROW"
: Sets the title of the plotted arrows to "ARROW".
colorup = color.green
: Specifies that the arrows pointing upwards (when arrowType
is positive) will be green.
colordown = color.red
: Specifies that the arrows pointing downwards (when arrowType
is negative) will be red.
minheight = 50
and maxheight = 50
: Set the minimum and maximum height of the arrows to 50 units. This keeps the arrow size constant regardless of the value of arrowType
.
pine script
, trading view
, script editor
, indicators
, strategies
, backtesting
, alerts
, custom scripts
, stock analysis
, charting tools
, technical analysis
, built-in functions
, pine script syntax
, trading bots
, automated trading
, scripting language
, market data
, trading signals
, financial markets
, programming trading strategies
, یاسر رحمتی