Reading Assignment: Pinescript
1. What does the language operator [] do? (Hint: It’s not for regular arrays)
open[1], it’ returns the open price on the previous candle.
2.What does the input function do? (Hint: Try it in Tradingview)
The input annotation function makes it possible for script users to modify selected values, which the script can use in its calculation or logic, without the need to modify the script’s code. As an example you can set the length of the moving average in the tradingview GUI to test out different values of the MA. Specific widgets are supplied in the Settings/Inputs dialog box for each type of input
3.What does the Strategy function do?
Strategies allow you to perform backtesting (emulation of a strategy trading on historical data) . So you can determinate if your idea working or not.
4.What information does the Volume variable contain?
The traded (buy/sell) numbers of contract a per candle.