Reading Assignment: Pinescript

What does the language operator [] do? (Hint: It’s not for regular arrays)

provides access to previous values of series

What does the input function do? (Hint: Try it in Tradingview)

the input function allows you to create a setting menu where you can have different value inputs such as numbers, timeframes, etc.

What does the Strategy function do?

sets a number of strategy properties

What information does the Volume variable contain?

current bar volume, can also refer back to previous values with []

1 Like
  1. Square brackets [] access previous values of the specific series.
  2. Input function creates variables to be accessed via the settings parameter of the strategy or study.
  3. Strategy has different methods to perform trading actions on the ticker.
  4. Volume shows the number of units traded in the period.

1. What does the language operator [] do? (Hint: It’s not for regular arrays)
Provides access to previous values of series (previous candles of the actual), Example: open[2] mean check the open price of the 2nd previous candle.

2. What does the input function do? (Hint: Try it in Tradingview)
A set of custom values on a variable, can be used to assign/compare script indicator parameters.

3. What does the Strategy function do?
The function sets a number of strategy properties. Meaning different strategies that can be programmed to behave in different ways for market position.

4. What information does the Volume variable contain?
Current bar volume. Meaning, the market volume of the indexed candle (volume[1] will return the volume of the previous candle of the actual)

1 Like

1. What does the language operator [] do? (Hint: It’s not for regular arrays)
it refers to a previous candle from that position when value 1 is input it will refer to the previous candle. When the value 2 has been put as input it will be 2 candles back in time.

2. What does the input function do? (Hint: Try it in Tradingview)
Is a named constant for bool input type of input function.

3. What does the Strategy function do?
Strategy can for exmple open or close trades. It is a tool to apply a strategy to analyzed data.

  1. What information does the Volume variable contain?
    Current bar volume. previous candles can be determined by volume[1] for the previous candle as described previoulsy with the first question.
1 Like
  1. Provides access to previous values of series
  2. Adds an input to your script indicator.
  3. The function sets a number of strategy properties.
  4. It shows the current bar volume
1 Like
  1. What does the language operator [] do? (Hint: It’s not for regular arrays)
    It gives you a way to access data from previous candles. close[2] would get the close value from to candles in the past.

  2. What does the input function do? (Hint: Try it in Tradingview)
    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.

1 Like
  1. What does the language operator [] do? (Hint: It’s not for regular arrays)
    – It allows you to get a previous values from a series of previous values

  2. What does the input function do? (Hint: Try it in Tradingview)
    – The Input function makes it possible for script users to modify selected values which the script can then use in its calculation or logic, without the need to modify the script’s code.

  3. What does the Strategy function do?
    – A Strategy function can send, modify and cancel buy/sell orders.
    It allows you to perform back-testing using historical data and forward-testing using real-time data.

  4. What information does the Volume variable contain?
    – The Volume variable holds the currect bar volume

1 Like

1. What does the language operator [] do? (Hint: It’s not for regular arrays)
It defines the number of “candles” or “days” will be enclosed on the function

2. What does the input function do? (Hint: Try it in Tradingview)
As the word says, it allows to add an input value to the script.

3. What does the Strategy function do?
It is used to define the kind of strategy used in the script and its properties.

4. What information does the Volume variable contain?
It allows to enclose the traded volume in the strategy

1 Like

Response:

  1. The operator [] allows you access to the previous bars of the series where the # in the expression ‘expr#’ is the amount of bars from the past that it will read.

  2. The input function allows users to change the value from the dialog box of the indicator.

  3. When using Strategy function, it gives you the option of adding properties to describe said strategy such as name/title, format, currency, scale, formatting, etc

  4. Volume variable gives you the volume in the current bar unless specified.

1 Like
  1. What does the language operator [] do? (Hint: It’s not for regular arrays)
    [] provides access to previous number/data.
  2. What does the input function do? (Hint: Try it in Tradingview)
    The input function allows the user to see and edit inputs on format object dialog.
  3. What does the Strategy function do?
    Strategy function sets a number of strategy properties.
  4. What information does the Volume variable contain?
    The Volume variable contains the current bar volume.
1 Like
  1. The language operator [] provides access to previous numerical values of series expressions.

  2. The input function displays a lined curved graph in a section under the trading values (Candles), with specific plots (color, symbol, resolution etc.) for your referencing purposes.

  3. The strategy function sets a number of strategy properties (strategy.entry – strategy.exit), which are commands to carryout specific requirements of a trade.

  4. Volume variable talks to the quantity of trades which takes place at a specific time in reference to an asset or security at a specific price.

1 Like
  1. returns a series of values
  2. Adds an input to your script indicator
  3. function sets a number of strategy properties.
  4. current volume bar
1 Like
  1. Provides access to previous values of series expr1. expr2 is the number of bars back, and must be numerical.

  2. Adds an input to your 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. The function sets a number of strategy properties.

  4. Current bar volume.

2 Likes
  1. Series subscript. Provides access to previous values of series expr1. expr2 is the number of bars back, and must be numerical. Floats will be rounded down.
    Example: expr1[expr2]
  2. Adds an input to your 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. The Strategy function sets a number of strategy properties.
    Example: strategy(title=‘MyStrategy’)
  4. The Volume variable contains the current bar volume.
1 Like
  1. What does the language operator [] do? (Hint: It’s not for regular arrays)
    Square brackets represent the previous candles [1] is the candle before, [2] the candle before that, and so on.

  2. What does the input function do? (Hint: Try it in Tradingview)
    Adds an input to your script indicator.

  3. What does the Strategy function do?
    The function sets a number of strategy properties.

  4. What information does the Volume variable contain?
    Current bar volume.

1 Like
  1. What does the language operator [] do? (Hint: It’s not for regular arrays)
    Access to previous values of series expr1. expr2 is the number of bars back

  2. What does the input function do? (Hint: Try it in Tradingview)
    Makes possible to change variables or settings in chart values

  3. What does the Strategy function do?
    Sets the properties for a strategy

  4. What information does the Volume variable contain?
    Volume of current bar, or brackets for previous.

1 Like
  1. What does the language operator [] do? (Hint: It’s not for regular arrays)

[x] is used to access to a certain data in a series, where x is the index, with 0 is the last one in time.

  1. What does the input function do? (Hint: Try it in Tradingview)

input allows the user to enter a certain parameter in the indicator’s parameters panel

  1. What does the Strategy function do?

Strategy function activate the tradingview strategy module : this module let the user to take trades, and shows many statistics about them.

  1. What information does the Volume variable contain?

Volume variable contains the amount of asset traded during the selected timeframe.

1 Like
  1. Provides access to previous values of series.
  2. Adds an input to your script indicator which can later be edited.
  3. It sets strategy properties - title is Required so it must be present but others are not mandatory.
  4. The volume of the current bar.
1 Like
  1. What does the language operator [] do? (Hint: It’s not for regular arrays)
  • Series subscript. Provides access to previous values of series expr1. expr2 is the number of bars back, and must be numerical. Floats will be rounded down.
  1. What does the input function do? (Hint: Try it in Tradingview)
  • Adds an input to your 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.
  1. What does the Strategy function do?
  • The function sets a number of strategy properties.
  1. What information does the Volume variable contain?
  • It contains the buy/sell volume for the current bar
1 Like
  1. Series subscript. Provides access to previous values of series expr1. expr2 is the number of bars back, and must be numerical. Floats will be rounded down.
  2. Adds an input to your 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. The function sets a number of strategy properties.
  4. Current bar volume.
1 Like