-
What does the language operator [] do?
square brackets represent previous candles and has a number to show what number in the sequence it is. -
What does the input function do?
adds input to your script indicator -
What does the Strategy function do?
sets a number of strategy properties. -
What information does the Volume variable contain?
current bar volume.
-
What does the language operator [] do? (Hint: It’s not for regular arrays)
It returns previous values of a data set. -
What does the input function do? (Hint: Try it in Tradingview)
It adds an input to your script indicator. -
What does the Strategy function do?
The Strategy function sets a number of strategy properties. -
What information does the Volume variable contain?
Volume variable contains current bar volume.
Reading Assignment: Pinescript (Answers)
- Provides access to provide values of service.
- Add input to script editor.
- This function sets a number strategy properties.
- Current bar volume.
- What does the language operator [] do? (Hint: It’s not for regular arrays)
It provides values of the previous candle(s). For example open[1] checks for the open price of the previous candle - What does the input function do? (Hint: Try it in Tradingview)
It ads an input to the script where values can be set/edited for a variable - What does the Strategy function do?
Sets a number of strategy properties, for example name of it, margins, etc. - What information does the Volume variable contain?
It is an integer/float and it holds current bar volume
- What does the language operator [] do? (Hint: It’s not for regular arrays)
Gets the time serie value of the past
- What does the input function do? (Hint: Try it in Tradingview)
Adds a menu with parameters that can be customised by the user
- What does the Strategy function do?
You can backtest your strategy
What information does the Volume variable contain?
Current bar volume
- What does the language operator [] do? (Hint: It’s not for regular arrays)
- Addresses a specific value/candle in a set or in the future
- What does the input function do? (Hint: Try it in Tradingview)
- Specifies a user input/setting
- What does the Strategy function do?
- Sets various properties of our strategy. It’s kinda like a class/object
- What information does the Volume variable contain?
- trading volume of a bar
- provides access to pervious values of series
- adds new input
- this functions sets up a number of different strategy properties
- volume of current bar and previous bar
[] Series subscript. Provides access to previous values of series expr1
Adds an input to your script indicator.
The function sets a number of strategy properties.
Current bar volume.
-
What does the language operator [] do? (Hint: It’s not for regular arrays)
Gives you access to previous values on the series. You will be able to check the data to previos variables in the series. -
What does the input function do? (Hint: Try it in Tradingview)
Adds a value which can be input in the settings on the chart -
What does the Strategy function do?
This function sets a number of strategy properties -
What information does the Volume variable contain?
The current bar volume. Previous values can also be accessed with square brackets.
- [] accesses the previous values of whatever built-in variables you append it to e.g. volume[1] will return the previous candles volume value.
- input creates a input on your indicators settings, it can be of any type you configure it to be e.g. Number input, free-text, tick box.
- Strategy can set multiple strategy properties for creating a trading strategy using pinescript which you can then use for back-testing your strategy using the Strategy Tester.
- Volume returns the current bar volume - previous values can be accessed with the square brackets operator e.g. volume[2].
1.What does the language operator [] do? (Hint: It’s not for regular arrays)
It is 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]
Prevoius open candle: open[1].
2.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.
3.What does the Strategy function do?
The function sets a number of strategy properties. For example: title, when to close or open position.
4.What information does the Volume variable contain?
It contains information how much selling or buying presure is at the current time frame.
-
What does the language operator [] do? (Hint: It’s not for regular arrays)
It provides access to previous values of the series. -
What does the input function do? (Hint: Try it in Tradingview)
It adds an input to the script indicator. -
What does the Strategy function do?
The function sets a number of strategy properties. -
What information does the Volume variable contain?
It contains the current bar volume.
Pinescript – Questions
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.
expr1[expr2]
2. What does the input function do? (Hint: Try it in Tradingview)
The input function adds an input to the Inputs tab of your script’s Settings, which allows you to provide configuration options to script users. This function automatically detects the type of the argument used for ‘defval’ and uses the corresponding input widget.
3. What does the Strategy function do?
The strategy function sets a number of strategy properties.
4. What information does the Volume variable contain?
The current bar volume.
Previous values may be accessed with square brackets operator [], e.g. volume[1], volume[2].
- What does the language operator [] do? (Hint: It’s not for regular arrays)
Provides access to previous values - What does the input function do? (Hint: Try it in Tradingview)
Gives the use a possibility to add inputs in the script - What does the Strategy function do?
It sets a number of strategy properties and every script needs to call it once - What information does the Volume variable co
The current bar value
-
What does the language operator [] do?
- This is the “seriesSubscript”
- Provides access to previous values of series bein operated on. Basically this lets u access prev candles
-
What does the input function do?
- Allows for configuration options for script users
-
What does the Strategy function do?
- Accepts properties n parameters that allows the code to run n provide desired outputs
-
What information does the Volume variable contain?
- Contains tradin volume for the current bar
- [] lets you query past instances of a variable… example if you wanted to confirm current candle open is greater than the previous candle open: open > open[1]
- 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 values where applicable.
- The strategy function emulates entering and exiting positions for backtesting.
- Volume variable contains the buy/sell volume for the current bar.
-
[backward count] allows you to count backwards from the current data, e.g. close[4] gets the close price from 4 candles ago
-
x = input(variable info) is a way to build input variables (i guess something like an x variable if you want to test an algo on a certain domain? … i’ve not gotten it to do anything special in tradingview…)
-
the strategy function seems to take all possible input parameters necessary (e.g. look-back time-frame, tick-by-tick recomputation, entry/exit values, pyramiding parameters, etc) to automatically run a strategy… dare i say this is the algo that runs algos?
-
this may be a bigggggg surprise… but the volume variable contains… the volume. B_S out!
-
What does the language operator [] do? (Hint: It’s not for regular arrays)
[] operator provides access to previous numerical values in a series. -
What does the input function do? (Hint: Try it in Tradingview)
Adds an input value to your script. -
What does the Strategy function do?
It defines the type of strategy (arguments) used in the script. -
What information does the Volume variable contain?
It provides the current bar volume.
- You can putt there a number of previous candles to check an open price for example
- adds input to the script
- To set up different strategy properties
- Volume of current and previous bars
- This provides access to a previous value in a series named outside and prior to the brackets.
- Adds an input to the script editor.
- Every strategy script must have one of these functions. It uses a number of properties to implement a strategy.
- current bar volume