Reading Assignment: Pinescript


#1

In this reading assignment, it’s time to get familiarized with Pinescript and all of it’s functions. Check out the Reference Manual and answer the following questions. The Reference Manual is a great resource to use in the future as well any time you are looking for a specific function or indicator.

  1. What does the language operator [] do? (Hint: It’s not for regular arrays)
  2. What does the input function do? (Hint: Try it in Tradingview)
  3. What does the Strategy function do?
  4. What information does the Volume variable contain?

#2
  1. [] lets you query past instances of a variable… example if you wanted to confirm current candle open is greater than previous candle open: open > open[1]

  2. The input function provides an interface so you can edit the variable value via script settings. It also allows you to set the default, minimum and maximum allowed value where applicable.

  3. The strategy function emulates entering and exiting positions for back testing.

  4. Volume variable contains the buy/sell volume for the current bar.


#3
  1. What does the language operator [] do? (Hint: It’s not for regular arrays) [] lets to access to previous values of series , the number in the square backets indicates how many previous bars in the series the value is referred to.

  2. What does the input function do? (Hint: Try it in Tradingview) It adds an input to a script indicator. User can see and edit inputs on the Format Object dialog of the script study. Script inputs look and behave exactly the same as inputs of built-in Technical Analysis indicators.

  3. What does the Strategy function do? The function sets a number of strategy properties to applies the logic of the strategy to a series of data.

  4. What information does the Volume variable contain? It contains the current bar volume of trades.