Multi conditions matricesLibrary "multi_conditions_matrices"
: facilitate including multiple AND / OR conditions to a script such as two entry / exit inputs groups.
method addConditions(conditions, conditionPair)
Helper to append conditions to a matrix condition array
Namespace types: matrix
Parameters:
conditions (matrix)
conditionPair (array) : array A condition pair , an input can be passed directly to enable
method check(conditions, operatorAnd)
check several condition within given operator
Namespace types: matrix
Parameters:
conditions (matrix)
operatorAnd (bool) : bool true if the operator between condition is AND (default OR)
Returns: bool Evaluates conditions
isWeekend()
isNightSignal(nightHour, morningHour, timezone)
Parameters:
nightHour (int)
morningHour (int)
timezone (string)
Input
How To Input And Offset CSV DataExample method of how to use an input text area to import, offset, and plot CSV data using an array. Note that when using this method there is a limit of 4096 total characters per input.
For working with data sets larger than 4096 total characters an alternative method of pasting CSV data directly within the script can be seen below :
NOTICE: This is an example script and not meant to be used as an actual strategy. By using this script or any portion thereof, you acknowledge that you have read and understood that this is for research purposes only and I am not responsible for any financial losses you may incur by using this script!
functionStringToMatrixLibrary "functionStringToMatrix"
Provides unbound methods (no error checking) to parse a string into a float or int matrix.
to_matrix_float(str, interval_sep, start_tk, end_tk)
Parse a string into a float matrix.
Parameters:
str : , string, the formated string to parse.
interval_sep : , string, cell interval separator token.
start_tk : , string, row start token.
end_tk : , string, row end token.
Returns: matrix, parsed float matrix.
to_matrix_int(str, interval_sep, start_tk, end_tk)
Parse a string into a int matrix.
Parameters:
str : , string, the formated string to parse.
interval_sep : , string, cell interval separator token.
start_tk : , string, row start token.
end_tk : , string, row end token.
Returns: matrix, parsed int matrix.
PriceTimeInteractive█ OVERVIEW
This library was intended to Get price of given time.input
█ CREDITS
Credits to TradingView for CAGR Custom Range.
█ FUNCTIONS
ohlc_time()
: Get OHLC price of given time.input
Parameters:
: : Time (t) must be using time.input
Returns: : OHLC
hlc_time()
: Get HLC price of given time.input
Parameters:
: : Time (t) must be using time.input
Returns: : HLC
hl_time()
: Get HL price of given time.input
Parameters:
: : Time (t) must be using time.input
Returns: : HL
external_input_utilsLibrary "external_input_utils"
Collection of external input utilities for conversion and other hacky functions
str_to_src(value) str_to_src - Convert the string value to the coresponding source series. It can be used to limit the "input.source" choices provided to the end user.
The most interesting part is that it can be used to overcome the "one input.source call limitation" for external inputs to your script
Parameters:
value : - The string equivalent to the source to be converted
Returns: series of the coresponding source
eval_cond(input, operator, value, defval) eval_cond - Evaluate the condition given an operator
Parameters:
input : - The input to be compared with. It can be an external input or a regular one
operator : - The string operator that describe the coparison operation
value : - The value to compare with the input. This can be a serries or a constant
defval : - The boolean value to return when 'noop' is selected
Returns: series of bool the result of the operation evaluation
Input Text Area to Array then Reshape Table█ OVERVIEW
Simple method to convert from input.text_area to array using str.split.
Reshape table using switch, not necessary must use matrix.reshape.
Might be useful pine script to replace input.symbol.
█ FEATURES
Table can positioned by any position and font size can be resized.
Reshape table and sorting array if necessary.
█ CREDITS
Credits to TradingView for new update of input.text_area.
Fed and ECB Calendar by KziHello traders,
Here is a script that i've done for testing the timestamp and the input.time fonction.
You can see verticals lines blue and yellow.
The blue are the ECB meeting date (7 dates)
The yellow are the FED meeting date. (10 Dates)
// In the parameter you can enter the next rolling month date for ECB and FED
// I don't figure out how to add label / Txt on the lines
// And be carreful i don't put the real hours of the meeting.
Hx 9 Moving AveragesThis script is designed to handle and provide quick and easy access to up to 9 different moving averages in one indicator and one tab.
Basically, it leverages the 'inline' and 'group' arguments of the 'input' function to provide you with a simple and straightforward way to:
- define your favorite moving averages by choosing type, length, source and color in the same tab and
- decide which moving averages to display in one click on a checkbox.
I do not like to have to select the color of an indicator in another tab. So, I put everything in the Inputs tab.
In addition, I like to "linewidth code" my moving averages so that a sma has a different thickness than an ema for example.
To do so, just define the line width that you want to associate with a moving average type in the "LINE WIDTH" section.
Once parameters are set to your liking, just check / uncheck the moving averages you want to display / hide (and save your settings as default).
This script handles 9 different moving averages and implements sma, wma, ema, vwma, rma (RSI) and hma (Hull).
It can easily be modified to change the number of available moving averages or include other types of moving averages.
The default settings provide an example of commonly used moving averages with associated colors ranked from Hot (more nervous) to Cold (less nervous) with the exception of Hull moving average displayed in gray.
These settings are just an example and are NOT meant to be used as a trading system! DYOR!
Hope it will be useful.
Enjoy and please let me know what you think in the comments.
Line Chart SourceThis line charts uses simple input.source.
By default, use close, can choose open, low, high, etc.