TR_HighLow_LibLibrary "TR_HighLow_Lib"
TODO: add library description here
ShowLabel(_Text, _X, _Y, _Style, _Size, _Yloc, _Color)
TODO: Function to display labels
Parameters:
_Text : TODO: text (series string) Label text.
_X : TODO: x (series int) Bar index.
_Y : TODO: y (series int/float) Price of the label position.
_Style : TODO: style (series string) Label style.
_Size : TODO: size (series string) Label size.
_Yloc : TODO: yloc (series string) Possible values are yloc.price, yloc.abovebar, yloc.belowbar.
_Color : TODO: color (series color) Color of the label border and arrow
Returns: TODO: No return values
GetColor(_Index)
TODO: Function to take out 12 colors in order
Parameters:
_Index : TODO: color number.
Returns: TODO: color code
Tbl_position(_Pos)
TODO: Table display position function
Parameters:
_Pos : TODO: position.
Returns: TODO: Table position
DeleteLine()
TODO: Delete Line
Parameters:
: TODO: No parameter
Returns: TODO: No return value
DeleteLabel()
TODO: Delete Label
Parameters:
: TODO: No parameter
Returns: TODO: No return value
ZigZag(_a_PHiLo, _a_IHiLo, _a_FHiLo, _a_DHiLo, _Histories, _Provisional_PHiLo, _Provisional_IHiLo, _Color1, _Width1, _Color2, _Width2, _ShowLabel, _ShowHighLowBar, _HighLowBarWidth, _HighLow_LabelSize)
TODO: Draw a zig-zag line.
Parameters:
_a_PHiLo : TODO: High-Low price array
_a_IHiLo : TODO: High-Low INDEX array
_a_FHiLo : TODO: High-Low flag array sequence 1:High 2:Low
_a_DHiLo : TODO: High-Low Price Differential Array
_Histories : TODO: Array size (High-Low length)
_Provisional_PHiLo : TODO: Provisional High-Low Price
_Provisional_IHiLo : TODO: Provisional High-Low INDEX
_Color1 : TODO: Normal High-Low color
_Width1 : TODO: Normal High-Low width
_Color2 : TODO: Provisional High-Low color
_Width2 : TODO: Provisional High-Low width
_ShowLabel : TODO: Label display flag True: Displayed False: Not displayed
_ShowHighLowBar : TODO: High-Low bar display flag True:Show False:Hide
_HighLowBarWidth : TODO: High-Low bar width
_HighLow_LabelSize : TODO: Label Size
Returns: TODO: No return value
TrendLine(_a_PHiLo, _a_IHiLo, _Histories, _MultiLine, _StartWidth, _EndWidth, _IncreWidth, _StartTrans, _EndTrans, _IncreTrans, _ColorMode, _Color1_1, _Color1_2, _Color2_1, _Color2_2, _Top_High, _Top_Low, _Bottom_High, _Bottom_Low)
TODO: Draw a Trend Line
Parameters:
_a_PHiLo : TODO: High-Low price array
_a_IHiLo : TODO: High-Low INDEX array
_Histories : TODO: Array size (High-Low length)
_MultiLine : TODO: Draw a multiple Line.
_StartWidth : TODO: Line width start value
_EndWidth : TODO: Line width end value
_IncreWidth : TODO: Line width increment value
_StartTrans : TODO: Transparent rate start value
_EndTrans : TODO: Transparent rate finally
_IncreTrans : TODO: Transparent rate increase value
_ColorMode : TODO: 0:Nomal 1:Gradation
_Color1_1 : TODO: Gradation Color 1_1
_Color1_2 : TODO: Gradation Color 1_2
_Color2_1 : TODO: Gradation Color 2_1
_Color2_2 : TODO: Gradation Color 2_2
_Top_High : TODO: _Top_High Value for Gradation
_Top_Low : TODO: _Top_Low Value for Gradation
_Bottom_High : TODO: _Bottom_High Value for Gradation
_Bottom_Low : TODO: _Bottom_Low Value for Gradation
Returns: TODO: No return value
Fibonacci(_a_Fibonacci, _a_PHiLo, _Provisional_PHiLo, _Index, _FrontMargin, _BackMargin)
TODO: Draw a Fibonacci line
Parameters:
_a_Fibonacci : TODO: Fibonacci Percentage Array
_a_PHiLo : TODO: High-Low price array
_Provisional_PHiLo : TODO: Provisional High-Low price (when _Index is 0)
_Index : TODO: Where to draw the Fibonacci line
_FrontMargin : TODO: Fibonacci line front-margin
_BackMargin : TODO: Fibonacci line back-margin
Returns: TODO: No return value
Fibonacci(_a_Fibonacci, _a_PHiLo, _Provisional_PHiLo, _Index1, _FrontMargin1, _BackMargin1, _Transparent1, _Index2, _FrontMargin2, _BackMargin2, _Transparent2)
TODO: Draw a Fibonacci line
Parameters:
_a_Fibonacci : TODO: Fibonacci Percentage Array
_a_PHiLo : TODO: High-Low price array
_Provisional_PHiLo : TODO: Provisional High-Low price (when _Index is 0)
_Index1 : TODO: Where to draw the Fibonacci line 1
_FrontMargin1 : TODO: Fibonacci line front-margin 1
_BackMargin1 : TODO: Fibonacci line back-margin 1
_Transparent1 : TODO: Transparent rate 1
_Index2 : TODO: Where to draw the Fibonacci line 2
_FrontMargin2 : TODO: Fibonacci line front-margin 2
_BackMargin2 : TODO: Fibonacci line back-margin 2
_Transparent2 : TODO: Transparent rate 2
Returns: TODO: No return value
High_Low_Judgment(_Length, _Extension, _Difference)
TODO: Judges High-Low
Parameters:
_Length : TODO: High-Low Confirmation Length
_Extension : TODO: Length of extension when the difference did not open
_Difference : TODO: Difference size
Returns: TODO: _HiLo=High-Low flag 0:Neither high nor low、1:High、2:Low、3:High-Low
_PHi=high price、_PLo=low price、_IHi=High Price Index、_ILo=Low Price Index、
_Cnt=count、_ECnt=Extension count、
_DiffHi=Difference from Start(High)、_DiffLo=Difference from Start(Low)、
_StartHi=Start value(High)、_StartLo=Start value(Low)
High_Low_Data_AddedAndUpdated(_HiLo, _Histories, _PHi, _PLo, _IHi, _ILo, _DiffHi, _DiffLo, _a_PHiLo, _a_IHiLo, _a_FHiLo, _a_DHiLo)
TODO: Adds and updates High-Low related arrays from given parameters
Parameters:
_HiLo : TODO: High-Low flag
_Histories : TODO: Array size (High-Low length)
_PHi : TODO: Price Hi
_PLo : TODO: Price Lo
_IHi : TODO: Index Hi
_ILo : TODO: Index Lo
_DiffHi : TODO: Difference in High
_DiffLo : TODO: Difference in Low
_a_PHiLo : TODO: High-Low price array
_a_IHiLo : TODO: High-Low INDEX array
_a_FHiLo : TODO: High-Low flag array 1:High 2:Low
_a_DHiLo : TODO: High-Low Price Differential Array
Returns: TODO: _PHiLo price array、_IHiLo indexed array、_FHiLo flag array、_DHiLo price-matching array、
Provisional_PHiLo Provisional price、Provisional_IHiLo 暫定インデックス
High_Low(_a_PHiLo, _a_IHiLo, _a_FHiLo, _a_DHiLo, _a_Fibonacci, _Length, _Extension, _Difference, _Histories, _ShowZigZag, _ZigZagColor1, _ZigZagWidth1, _ZigZagColor2, _ZigZagWidth2, _ShowZigZagLabel, _ShowHighLowBar, _ShowTrendLine, _TrendMultiLine, _TrendStartWidth, _TrendEndWidth, _TrendIncreWidth, _TrendStartTrans, _TrendEndTrans, _TrendIncreTrans, _TrendColorMode, _TrendColor1_1, _TrendColor1_2, _TrendColor2_1, _TrendColor2_2, _ShowFibonacci1, _FibIndex1, _FibFrontMargin1, _FibBackMargin1, _FibTransparent1, _ShowFibonacci2, _FibIndex2, _FibFrontMargin2, _FibBackMargin2, _FibTransparent2, _ShowInfoTable1, _TablePosition1, _ShowInfoTable2, _TablePosition2)
TODO: Draw the contents of the High-Low array.
Parameters:
_a_PHiLo : TODO: High-Low price array
_a_IHiLo : TODO: High-Low INDEX array
_a_FHiLo : TODO: High-Low flag sequence 1:High 2:Low
_a_DHiLo : TODO: High-Low Price Differential Array
_a_Fibonacci : TODO: Fibonacci Gnar Matching
_Length : TODO: Length of confirmation
_Extension : TODO: Extension Length of extension when the difference did not open
_Difference : TODO: Difference size
_Histories : TODO: High-Low Length
_ShowZigZag : TODO: ZigZag Display
_ZigZagColor1 : TODO: Colors of ZigZag1
_ZigZagWidth1 : TODO: Width of ZigZag1
_ZigZagColor2 : TODO: Colors of ZigZag2
_ZigZagWidth2 : TODO: Width of ZigZag2
_ShowZigZagLabel : TODO: ZigZagLabel Display
_ShowHighLowBar : TODO: High-Low Bar Display
_ShowTrendLine : TODO: Trend Line Display
_TrendMultiLine : TODO: Trend Multi Line Display
_TrendStartWidth : TODO: Line width start value
_TrendEndWidth : TODO: Line width end value
_TrendIncreWidth : TODO: Line width increment value
_TrendStartTrans : TODO: Starting transmittance value
_TrendEndTrans : TODO: Transmittance End Value
_TrendIncreTrans : TODO: Increased transmittance value
_TrendColorMode : TODO: color mode
_TrendColor1_1 : TODO: Trend Color 1_1
_TrendColor1_2 : TODO: Trend Color 1_2
_TrendColor2_1 : TODO: Trend Color 2_1
_TrendColor2_2 : TODO: Trend Color 2_2
_ShowFibonacci1 : TODO: Fibonacci1 Display
_FibIndex1 : TODO: Fibonacci1 Index No.
_FibFrontMargin1 : TODO: Fibonacci1 Front margin
_FibBackMargin1 : TODO: Fibonacci1 Back Margin
_FibTransparent1 : TODO: Fibonacci1 Transmittance
_ShowFibonacci2 : TODO: Fibonacci2 Display
_FibIndex2 : TODO: Fibonacci2 Index No.
_FibFrontMargin2 : TODO: Fibonacci2 Front margin
_FibBackMargin2 : TODO: Fibonacci2 Back Margin
_FibTransparent2 : TODO: Fibonacci2 Transmittance
_ShowInfoTable1 : TODO: InfoTable1 Display
_TablePosition1 : TODO: InfoTable1 position
_ShowInfoTable2 : TODO: InfoTable2 Display
_TablePosition2 : TODO: InfoTable2 position
Returns: TODO: 無し
Techindicator
TR_HighLowLibrary "TR_HighLow"
TODO: add library description here
ShowLabel(_Text, _X, _Y, _Style, _Size, _Yloc, _Color)
TODO: Function to display labels
Parameters:
_Text : TODO: text (series string) Label text.
_X : TODO: x (series int) Bar index.
_Y : TODO: y (series int/float) Price of the label position.
_Style : TODO: style (series string) Label style.
_Size : TODO: size (series string) Label size.
_Yloc : TODO: yloc (series string) Possible values are yloc.price, yloc.abovebar, yloc.belowbar.
_Color : TODO: color (series color) Color of the label border and arrow
Returns: TODO: No return values
GetColor(_Index)
TODO: Function to take out 12 colors in order
Parameters:
_Index : TODO: color number.
Returns: TODO: color code
Tbl_position(_Pos)
TODO: Table display position function
Parameters:
_Pos : TODO: position.
Returns: TODO: Table position
DeleteLine()
TODO: Delete Line
Parameters:
: TODO: No parameter
Returns: TODO: No return value
DeleteLabel()
TODO: Delete Label
Parameters:
: TODO: No parameter
Returns: TODO: No return value
ZigZag(_a_PHiLo, _a_IHiLo, _a_FHiLo, _a_DHiLo, _Histories, _Provisional_PHiLo, _Provisional_IHiLo, _Color1, _Width1, _Color2, _Width2, _ShowLabel, _ShowHighLowBar, _HighLowBarWidth, _HighLow_LabelSize)
TODO: Draw a zig-zag line.
Parameters:
_a_PHiLo : TODO: High-Low price array
_a_IHiLo : TODO: High-Low INDEX array
_a_FHiLo : TODO: High-Low flag array sequence 1:High 2:Low
_a_DHiLo : TODO: High-Low Price Differential Array
_Histories : TODO: Array size (High-Low length)
_Provisional_PHiLo : TODO: Provisional High-Low Price
_Provisional_IHiLo : TODO: Provisional High-Low INDEX
_Color1 : TODO: Normal High-Low color
_Width1 : TODO: Normal High-Low width
_Color2 : TODO: Provisional High-Low color
_Width2 : TODO: Provisional High-Low width
_ShowLabel : TODO: Label display flag True: Displayed False: Not displayed
_ShowHighLowBar : TODO: High-Low bar display flag True:Show False:Hide
_HighLowBarWidth : TODO: High-Low bar width
_HighLow_LabelSize : TODO: Label Size
Returns: TODO: No return value
TrendLine(_a_PHiLo, _a_IHiLo, _Histories, _MultiLine, _StartWidth, _EndWidth, _IncreWidth, _StartTrans, _EndTrans, _IncreTrans, _ColorMode, _Color1_1, _Color1_2, _Color2_1, _Color2_2, _Top_High, _Top_Low, _Bottom_High, _Bottom_Low)
TODO: Draw a Trend Line
Parameters:
_a_PHiLo : TODO: High-Low price array
_a_IHiLo : TODO: High-Low INDEX array
_Histories : TODO: Array size (High-Low length)
_MultiLine : TODO: Draw a multiple Line.
_StartWidth : TODO: Line width start value
_EndWidth : TODO: Line width end value
_IncreWidth : TODO: Line width increment value
_StartTrans : TODO: Transparent rate start value
_EndTrans : TODO: Transparent rate finally
_IncreTrans : TODO: Transparent rate increase value
_ColorMode : TODO: 0:Nomal 1:Gradation
_Color1_1 : TODO: Gradation Color 1_1
_Color1_2 : TODO: Gradation Color 1_2
_Color2_1 : TODO: Gradation Color 2_1
_Color2_2 : TODO: Gradation Color 2_2
_Top_High : TODO: _Top_High Value for Gradation
_Top_Low : TODO: _Top_Low Value for Gradation
_Bottom_High : TODO: _Bottom_High Value for Gradation
_Bottom_Low : TODO: _Bottom_Low Value for Gradation
Returns: TODO: No return value
Fibonacci(_a_Fibonacci, _a_PHiLo, _Provisional_PHiLo, _Index, _FrontMargin, _BackMargin)
TODO: Draw a Fibonacci line
Parameters:
_a_Fibonacci : TODO: Fibonacci Percentage Array
_a_PHiLo : TODO: High-Low price array
_Provisional_PHiLo : TODO: Provisional High-Low price (when _Index is 0)
_Index : TODO: Where to draw the Fibonacci line
_FrontMargin : TODO: Fibonacci line front-margin
_BackMargin : TODO: Fibonacci line back-margin
Returns: TODO: No return value
Fibonacci(_a_Fibonacci, _a_PHiLo, _Provisional_PHiLo, _Index1, _FrontMargin1, _BackMargin1, _Transparent1, _Index2, _FrontMargin2, _BackMargin2, _Transparent2)
TODO: Draw a Fibonacci line
Parameters:
_a_Fibonacci : TODO: Fibonacci Percentage Array
_a_PHiLo : TODO: High-Low price array
_Provisional_PHiLo : TODO: Provisional High-Low price (when _Index is 0)
_Index1 : TODO: Where to draw the Fibonacci line 1
_FrontMargin1 : TODO: Fibonacci line front-margin 1
_BackMargin1 : TODO: Fibonacci line back-margin 1
_Transparent1 : TODO: Transparent rate 1
_Index2 : TODO: Where to draw the Fibonacci line 2
_FrontMargin2 : TODO: Fibonacci line front-margin 2
_BackMargin2 : TODO: Fibonacci line back-margin 2
_Transparent2 : TODO: Transparent rate 2
Returns: TODO: No return value
High_Low_Judgment(_Length, _Extension, _Difference)
TODO: Judges High-Low
Parameters:
_Length : TODO: High-Low Confirmation Length
_Extension : TODO: Length of extension when the difference did not open
_Difference : TODO: Difference size
Returns: TODO: _HiLo=High-Low flag 0:Neither high nor low、1:High、2:Low、3:High-Low
_PHi=high price、_PLo=low price、_IHi=High Price Index、_ILo=Low Price Index、
_Cnt=count、_ECnt=Extension count、
_DiffHi=Difference from Start(High)、_DiffLo=Difference from Start(Low)、
_StartHi=Start value(High)、_StartLo=Start value(Low)
High_Low_Data_AddedAndUpdated(_HiLo, _Histories, _PHi, _PLo, _IHi, _ILo, _DiffHi, _DiffLo, _a_PHiLo, _a_IHiLo, _a_FHiLo, _a_DHiLo)
TODO: Adds and updates High-Low related arrays from given parameters
Parameters:
_HiLo : TODO: High-Low flag
_Histories : TODO: Array size (High-Low length)
_PHi : TODO: Price Hi
_PLo : TODO: Price Lo
_IHi : TODO: Index Hi
_ILo : TODO: Index Lo
_DiffHi : TODO: Difference in High
_DiffLo : TODO: Difference in Low
_a_PHiLo : TODO: High-Low price array
_a_IHiLo : TODO: High-Low INDEX array
_a_FHiLo : TODO: High-Low flag array 1:High 2:Low
_a_DHiLo : TODO: High-Low Price Differential Array
Returns: TODO: _PHiLo price array、_IHiLo indexed array、_FHiLo flag array、_DHiLo price-matching array、
Provisional_PHiLo Provisional price、Provisional_IHiLo 暫定インデックス
High_Low(_a_PHiLo, _a_IHiLo, _a_FHiLo, _a_DHiLo, _a_Fibonacci, _Length, _Extension, _Difference, _Histories, _ShowZigZag, _ZigZagColor1, _ZigZagWidth1, _ZigZagColor2, _ZigZagWidth2, _ShowZigZagLabel, _ShowHighLowBar, _ShowTrendLine, _TrendMultiLine, _TrendStartWidth, _TrendEndWidth, _TrendIncreWidth, _TrendStartTrans, _TrendEndTrans, _TrendIncreTrans, _TrendColorMode, _TrendColor1_1, _TrendColor1_2, _TrendColor2_1, _TrendColor2_2, _ShowFibonacci1, _FibIndex1, _FibFrontMargin1, _FibBackMargin1, _FibTransparent1, _ShowFibonacci2, _FibIndex2, _FibFrontMargin2, _FibBackMargin2, _FibTransparent2, _ShowInfoTable1, _TablePosition1, _ShowInfoTable2, _TablePosition2)
TODO: Draw the contents of the High-Low array.
Parameters:
_a_PHiLo : TODO: High-Low price array
_a_IHiLo : TODO: High-Low INDEX array
_a_FHiLo : TODO: High-Low flag sequence 1:High 2:Low
_a_DHiLo : TODO: High-Low Price Differential Array
_a_Fibonacci : TODO: Fibonacci Gnar Matching
_Length : TODO: Length of confirmation
_Extension : TODO: Extension Length of extension when the difference did not open
_Difference : TODO: Difference size
_Histories : TODO: High-Low Length
_ShowZigZag : TODO: ZigZag Display
_ZigZagColor1 : TODO: Colors of ZigZag1
_ZigZagWidth1 : TODO: Width of ZigZag1
_ZigZagColor2 : TODO: Colors of ZigZag2
_ZigZagWidth2 : TODO: Width of ZigZag2
_ShowZigZagLabel : TODO: ZigZagLabel Display
_ShowHighLowBar : TODO: High-Low Bar Display
_ShowTrendLine : TODO: Trend Line Display
_TrendMultiLine : TODO: Trend Multi Line Display
_TrendStartWidth : TODO: Line width start value
_TrendEndWidth : TODO: Line width end value
_TrendIncreWidth : TODO: Line width increment value
_TrendStartTrans : TODO: Starting transmittance value
_TrendEndTrans : TODO: Transmittance End Value
_TrendIncreTrans : TODO: Increased transmittance value
_TrendColorMode : TODO: color mode
_TrendColor1_1 : TODO: Trend Color 1_1
_TrendColor1_2 : TODO: Trend Color 1_2
_TrendColor2_1 : TODO: Trend Color 2_1
_TrendColor2_2 : TODO: Trend Color 2_2
_ShowFibonacci1 : TODO: Fibonacci1 Display
_FibIndex1 : TODO: Fibonacci1 Index No.
_FibFrontMargin1 : TODO: Fibonacci1 Front margin
_FibBackMargin1 : TODO: Fibonacci1 Back Margin
_FibTransparent1 : TODO: Fibonacci1 Transmittance
_ShowFibonacci2 : TODO: Fibonacci2 Display
_FibIndex2 : TODO: Fibonacci2 Index No.
_FibFrontMargin2 : TODO: Fibonacci2 Front margin
_FibBackMargin2 : TODO: Fibonacci2 Back Margin
_FibTransparent2 : TODO: Fibonacci2 Transmittance
_ShowInfoTable1 : TODO: InfoTable1 Display
_TablePosition1 : TODO: InfoTable1 position
_ShowInfoTable2 : TODO: InfoTable2 Display
_TablePosition2 : TODO: InfoTable2 position
Returns: TODO: 無し
SumOfCandlesLibrary "SumOfCandles"
This function returns sum of candlestick's body.
calc(_open, _close, _len, _malen, _usema)
Returns the sum of candlestick body.
Parameters:
_open : Source
_close : Source
_len : Period
_malen : MA Period
_usema : A flag of using MA
Returns: sum
calc(_len, _malen, _usema)
Returns the sum of candlestick body.
Parameters:
_len : Period
_malen : MA period
_usema : A flag of using MA
Returns: sum
PointofControlLibrary "PointofControl"
POC_f()
The genesis of this project was to create a POC library that would be available to deliver volume profile information via pine to other scripts of indicators and strategies.
This is the indicator version of the library function.
A few things that would be unique with the built in
- it allows you to choose the kind of reset of the period, day/week or bars. This is simple enough to expand to other conditions
- it resets on bar count starting from the beginning of the data set (bar index =0) vs bars back from the end of the data set
- A 'period' in this context is the time between resets - the start of the POC until it resets (for example at the beginning of a new day or week)
- it will calculate an increment level rather than the user specifying ticks or price brackets
- it does not allow for setting the # of rows and then calculating the implied price levels
- When a period is complete it is often useful to look back at the POCs of historical periods, or extend them forward.
- This script will find the historical POCs around the current price and display them rather than extend all the historical POC lines to the right
- This script also looks across all the period POCs and identifies the master POC or what I call the Grand POC, and also the next 3 runner up POCs
There is a matching indicator to this library
loxxvarietyrsiLibrary "loxxvarietyrsi"
7 varieties of RSI used in Loxx's indicators and strategies. Default is "rsi_rsi" which is just TV's built int ta.rsi() function.
"rsi_rsi" is regular ta.rsi()
"rsi_slo" is slowed down version of regular RSI
"rsi_rap" is ta.rsi() but uses SMA instead of RMA, this is the same as Cuttlers RSI
"rsi_har" is Michael Harris RSI, but a word of "warning". I left the Harris' rsi in the choices of rsi, but be advised that, due to the way how Harris rsi is calculated, if price filtering is used (ie: some randomness is taken away from price series) Harris RSI tends to produce results that can be "surprising" at the least in some cases. Even though Harris RSI is good when it comes to natural (semi-random) price usage, keep in mind what happens if the prices are filtered and why it happens
"rsi_rsx" is Jurik's RSX
"rsi_cut" is ta.rsi() but uses SMA instead of RMA, this is the same as Rapid RSI
"rsi_ehl" is Ehles' Smoothed RSI
rsiVariety(rsiMode, src, per)
method for returning 1 of 7 different RSI calculation outputs.
Parameters:
rsiMode : string, rsi mode, can be 1 of 7 of the following: "rsi_rsi", "rsi_slo", "rsi_rap", "rsi_har", "rsi_rsx", "rsi_cut", "rsi_ehl"; defaults to "rsi_rsi"
src : float, source, either regular source type or some other caculated value.
per : int, period lookback.
Returns: float RSI.
usage:
rsiVariety("rsi_rsi", src, per)
EchoMorphicAverageLibrary "EchoMorphicAverage"
Original Self Referencing Moving Average which references
it's own output agsainst itself and the incoming source to dynamically
alter smoothness and length internally per calculation cycle.
@kaigouthro
Inputs are float length series.
Contact Me for More Dynamic Float Length Indicators.
wema(src, mod, len)
Waited Echo-Morphic Average
Parameters:
src : (float) input value
mod : (float) modifier(0-1) mix of current value
len : (float) length
Returns: output processed smoothed value
wemaStack(src, mod, len)
Stacked Multipass Waited Echo-Morphic Average
Parameters:
src : (float) input value
mod : (float) modifier(0-1) mix of current value
len : (float) length
Returns: output processed smoothed value
loxxdynamiczoneLibrary "loxxdynamiczone"
Dynamic Zones
Derives Leo Zamansky and David Stendahl's Dynamic Zone,
see "Stocks & Commodities V15:7 (306-310): Dynamic Zones by Leo Zamansky, Ph .D., and David Stendahl"
What are Dynamic Zones?
As explained in "Stocks & Commodities V15:7 (306-310): Dynamic Zones by Leo Zamansky, Ph .D., and David Stendahl"
Most indicators use a fixed zone for buy and sell signals. Here’ s a concept based on zones that are responsive to past levels of the indicator.
One approach to active investing employs the use of oscillators to exploit tradable market trends. This investing style follows a very simple form of logic: Enter the market only when an oscillator has moved far above or below traditional trading lev- els. However, these oscillator- driven systems lack the ability to evolve with the market because they use fixed buy and sell zones. Traders typically use one set of buy and sell zones for a bull market and substantially different zones for a bear market. And therein lies the problem.
Once traders begin introducing their market opinions into trading equations, by changing the zones, they negate the system’s mechanical nature. The objective is to have a system automatically define its own buy and sell zones and thereby profitably trade in any market — bull or bear. Dynamic zones offer a solution to the problem of fixed buy and sell zones for any oscillator-driven system.
An indicator’s extreme levels can be quantified using statistical methods. These extreme levels are calculated for a certain period and serve as the buy and sell zones for a trading system. The repetition of this statistical process for every value of the indicator creates values that become the dynamic zones. The zones are calculated in such a way that the probability of the indicator value rising above, or falling below, the dynamic zones is equal to a given probability input set by the trader.
To better understand dynamic zones, let's first describe them mathematically and then explain their use. The dynamic zones definition:
Find V such that:
For dynamic zone buy: P{X <= V}=P1
For dynamic zone sell: P{X >= V}=P2
where P1 and P2 are the probabilities set by the trader, X is the value of the indicator for the selected period and V represents the value of the dynamic zone.
The probability input P1 and P2 can be adjusted by the trader to encompass as much or as little data as the trader would like. The smaller the probability, the fewer data values above and below the dynamic zones. This translates into a wider range between the buy and sell zones. If a 10% probability is used for P1 and P2, only those data values that make up the top 10% and bottom 10% for an indicator are used in the construction of the zones. Of the values, 80% will fall between the two extreme levels. Because dynamic zone levels are penetrated so infrequently, when this happens, traders know that the market has truly moved into overbought or oversold territory.
Calculating the Dynamic Zones
The algorithm for the dynamic zones is a series of steps. First, decide the value of the lookback period t. Next, decide the value of the probability Pbuy for buy zone and value of the probability Psell for the sell zone.
For i=1, to the last lookback period, build the distribution f(x) of the price during the lookback period i. Then find the value Vi1 such that the probability of the price less than or equal to Vi1 during the lookback period i is equal to Pbuy. Find the value Vi2 such that the probability of the price greater or equal to Vi2 during the lookback period i is equal to Psell. The sequence of Vi1 for all periods gives the buy zone. The sequence of Vi2 for all periods gives the sell zone.
In the algorithm description, we have: Build the distribution f(x) of the price during the lookback period i. The distribution here is empirical namely, how many times a given value of x appeared during the lookback period. The problem is to find such x that the probability of a price being greater or equal to x will be equal to a probability selected by the user. Probability is the area under the distribution curve. The task is to find such value of x that the area under the distribution curve to the right of x will be equal to the probability selected by the user. That x is the dynamic zone.
dZone(type, src, pval, per)
method for retrieving the dynamic zone levels from input source.
Parameters:
type : string, value of either 'buy' or 'sell'.
src : float, source, either regular source type or some other caculated value.
pval : float, probability defined by extension over/under source, a number <= 1.0.
per : int, period lookback.
Returns: float dynamic zone level.
usage:
dZone("buy", close, 0.2, 70)
McNichollBandsLibrary "McNichollBands"
This is a library which only functions to make the McNicholl's Bollinger Bands modifications. It's also my first library, so I'll probably screw some things up.
mcNichollBands(alpha, useLogScale, widthMultiplier)
Calculates the McNicholl's Bollinger Bands modifications.
Parameters:
alpha : The alpha constant to be used on the EMA calculations.
useLogScale : Whether to use the log version of the prices or not.
widthMultiplier : The number that shall be multiplied by the volatility to form the bands.
Returns: A tuple containing the lower band, the center line, and the upper band.
loxxrsxLibrary "loxxrsx"
loxxrsx: Jurik RSX
rsx(src, len)
rsx
Parameters:
src : float
len : int
Returns: result float
loxxpaaspecialLibrary "loxxpaaspecial"
loxxpaaspecial: Ehlers Phase Accumulation Dominant Cycle Period with multiplier and filter
paa(src, mult, filt)
(src, mult, filt)
Parameters:
src : float
mult : float
filt : float
Returns: result float
loxxfsrrdspfiltsLibrary "loxxfsrrdspfilts"
loxxfsrrdspfilts : FATL, SATL, RFTL, & RSTL Digital Signal Filters
fatl(src)
fatl
Parameters:
src : float
Returns: result float
rftl(src)
rftl
Parameters:
src : float
Returns: result float
satl(src)
satl
Parameters:
src : float
Returns: result float
rstl(src)
rstl
Parameters:
src : float
Returns: result float
loxxjuriktoolsLibrary "loxxjuriktools"
loxxjuriktools: Jurik tools used in Loxx's idicators and strategies
jcfbaux(src, len)
jcfbaux
Parameters:
src : float
len : int
Returns: result float
jcfb(src, len, len)
jcfb
Parameters:
src : float
len : int
len : int
Returns: result float
jurik_filt(src, len, phase)
jurik_filt
Parameters:
src : float
len : int
phase : float
Returns: result float
loxxmas - moving averages used in Loxx's indis & stratsLibrary "loxxmas"
TODO:loxx moving averages used in indicators
kama(src, len, kamafastend, kamaslowend)
KAMA Kaufman adaptive moving average
Parameters:
src : float
len : int
kamafastend : int
kamaslowend : int
Returns: array
ama(src, len, fl, sl)
AMA, adaptive moving average
Parameters:
src : float
len : int
fl : int
sl : int
Returns: array
t3(src, len)
T3 moving average, adaptive moving average
Parameters:
src : float
len : int
Returns: array
adxvma(src, len)
ADXvma - Average Directional Volatility Moving Average
Parameters:
src : float
len : int
Returns: array
ahrma(src, len)
Ahrens Moving Average
Parameters:
src : float
len : int
Returns: array
alxma(src, len)
Alexander Moving Average - ALXMA
Parameters:
src : float
len : int
Returns: array
dema(src, len)
Double Exponential Moving Average - DEMA
Parameters:
src : float
len : int
Returns: array
dsema(src, len)
Double Smoothed Exponential Moving Average - DSEMA
Parameters:
src : float
len : int
Returns: array
ema(src, len)
Exponential Moving Average - EMA
Parameters:
src : float
len : int
Returns: array
fema(src, len)
Fast Exponential Moving Average - FEMA
Parameters:
src : float
len : int
Returns: array
hma(src, len)
Hull moving averge
Parameters:
src : float
len : int
Returns: array
ie2(src, len)
Early T3 by Tim Tilson
Parameters:
src : float
len : int
Returns: array
frama(src, len, FC, SC)
Fractal Adaptive Moving Average - FRAMA
Parameters:
src : float
len : int
FC : int
SC : int
Returns: array
instant(src, float)
Instantaneous Trendline
Parameters:
src : float
float : alpha
Returns: array
ilrs(src, int)
Integral of Linear Regression Slope - ILRS
Parameters:
src : float
int : len
Returns: array
laguerre(src, float)
Laguerre Filter
Parameters:
src : float
float : alpha
Returns: array
leader(src, int)
Leader Exponential Moving Average
Parameters:
src : float
int : len
Returns: array
lsma(src, int, int)
Linear Regression Value - LSMA (Least Squares Moving Average)
Parameters:
src : float
int : len
int : offset
Returns: array
lwma(src, int)
Linear Weighted Moving Average - LWMA
Parameters:
src : float
int : len
Returns: array
mcginley(src, int)
McGinley Dynamic
Parameters:
src : float
int : len
Returns: array
mcNicholl(src, int)
McNicholl EMA
Parameters:
src : float
int : len
Returns: array
nonlagma(src, int)
Non-lag moving average
Parameters:
src : float
int : len
Returns: array
pwma(src, int, float)
Parabolic Weighted Moving Average
Parameters:
src : float
int : len
float : pwr
Returns: array
rmta(src, int)
Recursive Moving Trendline
Parameters:
src : float
int : len
Returns: array
decycler(src, int)
Simple decycler - SDEC
Parameters:
src : float
int : len
Returns: array
sma(src, int)
Simple Moving Average
Parameters:
src : float
int : len
Returns: array
swma(src, int)
Sine Weighted Moving Average
Parameters:
src : float
int : len
Returns: array
slwma(src, int)
linear weighted moving average
Parameters:
src : float
int : len
Returns: array
smma(src, int)
Smoothed Moving Average - SMMA
Parameters:
src : float
int : len
Returns: array
super(src, int)
Ehlers super smoother
Parameters:
src : float
int : len
Returns: array
smoother(src, int)
Smoother filter
Parameters:
src : float
int : len
Returns: array
tma(src, int)
Triangular moving average - TMA
Parameters:
src : float
int : len
Returns: array
tema(src, int)
Tripple exponential moving average - TEMA
Parameters:
src : float
int : len
Returns: array
vwema(src, int)
Volume weighted ema - VEMA
Parameters:
src : float
int : len
Returns: array
vwma(src, int)
Volume weighted moving average - VWMA
Parameters:
src : float
int : len
Returns: array
zlagdema(src, int)
Zero-lag dema
Parameters:
src : float
int : len
Returns: array
zlagma(src, int)
Zero-lag moving average
Parameters:
src : float
int : len
Returns: array
zlagtema(src, int)
Zero-lag tema
Parameters:
src : float
int : len
Returns: array
threepolebuttfilt(src, int)
Three-pole Ehlers Butterworth
Parameters:
src : float
int : len
Returns: array
threepolesss(src, int)
Three-pole Ehlers smoother
Parameters:
src : float
int : len
Returns: array
twopolebutter(src, int)
Two-pole Ehlers Butterworth
Parameters:
src : float
int : len
Returns: array
twopoless(src, int)
Two-pole Ehlers smoother
Parameters:
src : float
int : len
Returns: array
Moving_AveragesLibrary "Moving_Averages"
This library contains majority important moving average functions with int series support. Which means that they can be used with variable length input. For conventional use, please use tradingview built-in ta functions for moving averages as they are more precise. I'll use functions in this library for my other scripts with dynamic length inputs.
ema(src, len)
Exponential Moving Average (EMA)
Parameters:
src : Source
len : Period
Returns: Exponential Moving Average with Series Int Support (EMA)
alma(src, len, a_offset, a_sigma)
Arnaud Legoux Moving Average (ALMA)
Parameters:
src : Source
len : Period
a_offset : Arnaud Legoux offset
a_sigma : Arnaud Legoux sigma
Returns: Arnaud Legoux Moving Average (ALMA)
covwema(src, len)
Coefficient of Variation Weighted Exponential Moving Average (COVWEMA)
Parameters:
src : Source
len : Period
Returns: Coefficient of Variation Weighted Exponential Moving Average (COVWEMA)
covwma(src, len)
Coefficient of Variation Weighted Moving Average (COVWMA)
Parameters:
src : Source
len : Period
Returns: Coefficient of Variation Weighted Moving Average (COVWMA)
dema(src, len)
DEMA - Double Exponential Moving Average
Parameters:
src : Source
len : Period
Returns: DEMA - Double Exponential Moving Average
edsma(src, len, ssfLength, ssfPoles)
EDSMA - Ehlers Deviation Scaled Moving Average
Parameters:
src : Source
len : Period
ssfLength : EDSMA - Super Smoother Filter Length
ssfPoles : EDSMA - Super Smoother Filter Poles
Returns: Ehlers Deviation Scaled Moving Average (EDSMA)
eframa(src, len, FC, SC)
Ehlrs Modified Fractal Adaptive Moving Average (EFRAMA)
Parameters:
src : Source
len : Period
FC : Lower Shift Limit for Ehlrs Modified Fractal Adaptive Moving Average
SC : Upper Shift Limit for Ehlrs Modified Fractal Adaptive Moving Average
Returns: Ehlrs Modified Fractal Adaptive Moving Average (EFRAMA)
ehma(src, len)
EHMA - Exponential Hull Moving Average
Parameters:
src : Source
len : Period
Returns: Exponential Hull Moving Average (EHMA)
etma(src, len)
Exponential Triangular Moving Average (ETMA)
Parameters:
src : Source
len : Period
Returns: Exponential Triangular Moving Average (ETMA)
frama(src, len)
Fractal Adaptive Moving Average (FRAMA)
Parameters:
src : Source
len : Period
Returns: Fractal Adaptive Moving Average (FRAMA)
hma(src, len)
HMA - Hull Moving Average
Parameters:
src : Source
len : Period
Returns: Hull Moving Average (HMA)
jma(src, len, jurik_phase, jurik_power)
Jurik Moving Average - JMA
Parameters:
src : Source
len : Period
jurik_phase : Jurik (JMA) Only - Phase
jurik_power : Jurik (JMA) Only - Power
Returns: Jurik Moving Average (JMA)
kama(src, len, k_fastLength, k_slowLength)
Kaufman's Adaptive Moving Average (KAMA)
Parameters:
src : Source
len : Period
k_fastLength : Number of periods for the fastest exponential moving average
k_slowLength : Number of periods for the slowest exponential moving average
Returns: Kaufman's Adaptive Moving Average (KAMA)
kijun(_high, _low, len, kidiv)
Kijun v2
Parameters:
_high : High value of bar
_low : Low value of bar
len : Period
kidiv : Kijun MOD Divider
Returns: Kijun v2
lsma(src, len, offset)
LSMA/LRC - Least Squares Moving Average / Linear Regression Curve
Parameters:
src : Source
len : Period
offset : Offset
Returns: Least Squares Moving Average (LSMA)/ Linear Regression Curve (LRC)
mf(src, len, beta, feedback, z)
MF - Modular Filter
Parameters:
src : Source
len : Period
beta : Modular Filter, General Filter Only - Beta
feedback : Modular Filter Only - Feedback
z : Modular Filter Only - Feedback Weighting
Returns: Modular Filter (MF)
rma(src, len)
RMA - RSI Moving average
Parameters:
src : Source
len : Period
Returns: RSI Moving average (RMA)
sma(src, len)
SMA - Simple Moving Average
Parameters:
src : Source
len : Period
Returns: Simple Moving Average (SMA)
smma(src, len)
Smoothed Moving Average (SMMA)
Parameters:
src : Source
len : Period
Returns: Smoothed Moving Average (SMMA)
stma(src, len)
Simple Triangular Moving Average (STMA)
Parameters:
src : Source
len : Period
Returns: Simple Triangular Moving Average (STMA)
tema(src, len)
TEMA - Triple Exponential Moving Average
Parameters:
src : Source
len : Period
Returns: Triple Exponential Moving Average (TEMA)
thma(src, len)
THMA - Triple Hull Moving Average
Parameters:
src : Source
len : Period
Returns: Triple Hull Moving Average (THMA)
vama(src, len, volatility_lookback)
VAMA - Volatility Adjusted Moving Average
Parameters:
src : Source
len : Period
volatility_lookback : Volatility lookback length
Returns: Volatility Adjusted Moving Average (VAMA)
vidya(src, len)
Variable Index Dynamic Average (VIDYA)
Parameters:
src : Source
len : Period
Returns: Variable Index Dynamic Average (VIDYA)
vwma(src, len)
Volume-Weighted Moving Average (VWMA)
Parameters:
src : Source
len : Period
Returns: Volume-Weighted Moving Average (VWMA)
wma(src, len)
WMA - Weighted Moving Average
Parameters:
src : Source
len : Period
Returns: Weighted Moving Average (WMA)
zema(src, len)
Zero-Lag Exponential Moving Average (ZEMA)
Parameters:
src : Source
len : Period
Returns: Zero-Lag Exponential Moving Average (ZEMA)
zsma(src, len)
Zero-Lag Simple Moving Average (ZSMA)
Parameters:
src : Source
len : Period
Returns: Zero-Lag Simple Moving Average (ZSMA)
evwma(src, len)
EVWMA - Elastic Volume Weighted Moving Average
Parameters:
src : Source
len : Period
Returns: Elastic Volume Weighted Moving Average (EVWMA)
tt3(src, len, a1_t3)
Tillson T3
Parameters:
src : Source
len : Period
a1_t3 : Tillson T3 Volume Factor
Returns: Tillson T3
gma(src, len)
GMA - Geometric Moving Average
Parameters:
src : Source
len : Period
Returns: Geometric Moving Average (GMA)
wwma(src, len)
WWMA - Welles Wilder Moving Average
Parameters:
src : Source
len : Period
Returns: Welles Wilder Moving Average (WWMA)
ama(src, _high, _low, len, ama_f_length, ama_s_length)
AMA - Adjusted Moving Average
Parameters:
src : Source
_high : High value of bar
_low : Low value of bar
len : Period
ama_f_length : Fast EMA Length
ama_s_length : Slow EMA Length
Returns: Adjusted Moving Average (AMA)
cma(src, len)
Corrective Moving average (CMA)
Parameters:
src : Source
len : Period
Returns: Corrective Moving average (CMA)
gmma(src, len)
Geometric Mean Moving Average (GMMA)
Parameters:
src : Source
len : Period
Returns: Geometric Mean Moving Average (GMMA)
ealf(src, len, LAPercLen_, FPerc_)
Ehler's Adaptive Laguerre filter (EALF)
Parameters:
src : Source
len : Period
LAPercLen_ : Median Length
FPerc_ : Median Percentage
Returns: Ehler's Adaptive Laguerre filter (EALF)
elf(src, len, LAPercLen_, FPerc_)
ELF - Ehler's Laguerre filter
Parameters:
src : Source
len : Period
LAPercLen_ : Median Length
FPerc_ : Median Percentage
Returns: Ehler's Laguerre Filter (ELF)
edma(src, len)
Exponentially Deviating Moving Average (MZ EDMA)
Parameters:
src : Source
len : Period
Returns: Exponentially Deviating Moving Average (MZ EDMA)
pnr(src, len, rank_inter_Perc_)
PNR - percentile nearest rank
Parameters:
src : Source
len : Period
rank_inter_Perc_ : Rank and Interpolation Percentage
Returns: Percentile Nearest Rank (PNR)
pli(src, len, rank_inter_Perc_)
PLI - Percentile Linear Interpolation
Parameters:
src : Source
len : Period
rank_inter_Perc_ : Rank and Interpolation Percentage
Returns: Percentile Linear Interpolation (PLI)
rema(src, len)
Range EMA (REMA)
Parameters:
src : Source
len : Period
Returns: Range EMA (REMA)
sw_ma(src, len)
Sine-Weighted Moving Average (SW-MA)
Parameters:
src : Source
len : Period
Returns: Sine-Weighted Moving Average (SW-MA)
vwap(src, len)
Volume Weighted Average Price (VWAP)
Parameters:
src : Source
len : Period
Returns: Volume Weighted Average Price (VWAP)
mama(src, len)
MAMA - MESA Adaptive Moving Average
Parameters:
src : Source
len : Period
Returns: MESA Adaptive Moving Average (MAMA)
fama(src, len)
FAMA - Following Adaptive Moving Average
Parameters:
src : Source
len : Period
Returns: Following Adaptive Moving Average (FAMA)
hkama(src, len)
HKAMA - Hilbert based Kaufman's Adaptive Moving Average
Parameters:
src : Source
len : Period
Returns: Hilbert based Kaufman's Adaptive Moving Average (HKAMA)
bullratioLibrary "bullratio"
Calculate the profit/loss ratio of a permabull for configurable time range
bullratio(len)
calculates the profit/loss ratio for a permabull of age len
Parameters:
len : the number of candles to include in the running bull ratio - 0 for all time
Returns: series float of profit/loss percentage
CarlLibLibrary "CarlLib"
LastLowRedHighGreen(open, close, high, close, reqChangePerc) returns values representing the high of the most recent green and the low of the most recent red
Parameters:
open : open series
close : close series
high : high series
close : close series
reqChangePerc : the minimum require change percentage for the values to switch to new ones.
Returns:
fontilabLibrary "fontilab"
Provides function's indicators for pivot - trend - resistance.
pivots(src, lenght, isHigh) Detecting pivot points (and returning price + bar index.
Parameters:
src : The chart we analyse.
lenght : Used for the calcul.
isHigh : lookging for high if true, low otherwise.
Returns: The bar index and the price of the pivot.
calcDevThreshold(tresholdMultiplier, closePrice) Calculate deviation threshold for identifying major swings.
Parameters:
tresholdMultiplier : Usefull to equilibrate the calculate.
closePrice : Close price of the chart wanted.
Returns: The deviation threshold.
calcDev(basePrice, price) Custom function for calculating price deviation for validating large moves.
Parameters:
basePrice : The reference price.
price : The price tested.
Returns: The deviation.
pivotFoundWithLines(dev, isHigh, index, price, dev_threshold, isHighLast, pLast, iLast, lineLast) Detecting pivots that meet our deviation criteria.
Parameters:
dev : The deviation wanted.
isHigh : The type of pivot tested (high or low).
index : The Index of the pivot tested.
price : The chart price wanted.
dev_threshold : The deviation treshold.
isHighLast : The type of last pivot.
pLast : The pivot price last.
iLast : Index of the last pivot.
lineLast : The lst line.
Returns: The Line and bool is pivot High.
getDeviationPivots(thresholdMultiplier, depth, lineLast, isHighLast, iLast, pLast, deleteLines, closePrice, highPrice, lowPrice) Get pivot that meet our deviation criteria.
Parameters:
thresholdMultiplier : The treshold multiplier.
depth : The depth to calculate pivot.
lineLast : The last line.
isHighLast : The type of last pivot
iLast : Index of the last pivot.
pLast : The pivot price last.
deleteLines : If the line are draw or not.
closePrice : The chart close price.
highPrice : The chart high price.
lowPrice : The chart low price.
Returns: All pivot the informations.
getElIntArrayFromEnd() Get the last element of an int array.
getElFloatArrayFromEnd() Get the last element of an float array.
getElBoolArrayFromEnd() Get the last element of a bool array.
isTrendContinuation(isTrendUp, arrayBounds, lastPrice, precision) Check if last price is between bounds array.
Parameters:
isTrendUp : Is actual trend up.
arrayBounds : The trend array.
lastPrice : The pivot Price that just be found.
precision : The percent we add to actual bounds to validate a move.
Returns: na if price is between bounds, true if continuation, false if not.
getTrendPivots(trendBarIndexes, trendPrices, trendPricesIsHigh, interBarIndexes, interPrices, interPricesIsHigh, isTrendHesitate, isTrendUp, trendPrecision, pLast, iLast, isHighLast) Function to update array and trend related to pivot trend interpretation.
Parameters:
trendBarIndexes : The array trend bar index.
trendPrices : The array trend price.
trendPricesIsHigh : The array trend is high.
interBarIndexes : The array inter bar index.
interPrices : The array inter price.
interPricesIsHigh : The array inter ishigh.
isTrendHesitate : The actual status of is trend hesitate.
isTrendUp : The actual status of is trend up.
trendPrecision : The var precision to add in "iscontinuation" function.
pLast : The last pivot price.
iLast : The last pivot bar index.
isHighLast : The last pivot "isHigh".
Returns: trend & inter arrays, is trend hesitate, is trend up.
drawBoundLines(startIndex, startPrice, endIndex, endPrice, breakingPivotIndex, breakingPivotPrice, isTrendUp) Draw bounds and breaking line of the trend.
Parameters:
startIndex : Index of the first bound line.
startPrice : Price of first bound line.
endIndex : Index of second bound line.
endPrice : price of second bound line.
breakingPivotIndex : The breaking line index.
breakingPivotPrice : The breaking line price.
isTrendUp : The actual status of the trend.
Returns: The lines bounds and breaking line.
WpProbabilisticLibLibrary "WpProbabilisticLib"
Library that contains functions to calculate probabilistic based on historical candle analysis
CandleType(open, close) This function check what type of candle is, based on its close and open prices
Parameters:
open : series float (open price)
close : series float (close price)
Returns: This function return the candle type (1 for Bullish, -1 Bearish, 0 as Doji candle)
CandleTypePercentDiff(open, close, qtd_candles_before, consider_dojis) This function calculates the percentage difference between Bullish and Bearish in a candlestick range back in time and which is the type with the least occurrences
Parameters:
open : series float (open price series)
close : series float (close price series)
qtd_candles_before : simple int (Number of candles before to calculate)
consider_dojis : simple string (How to consider dojis (no consider "NO", as bearish "AS_RED", as bullish "AS_GREEN"))
Returns: tuple(float, int) (Returns the percentage difference between Bullish and Bearish candles and which type of candle has the least occurrences)
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
ADX FunctionsLibrary "ADX"
adx(dilen, adxLen)
Parameters:
dilen : Length of the Directional Index.
adxLen : Length (smoothing) of the Average Directional Index.
Returns:
honest personal libraryLibrary "honestpersonallibrary"
thestratnumber() this will return the number 1,2 or 3 using the logic from Rob Smiths #thestrat which uses these type of bars for setups
getBodySize() Gets the current candle's body size (in POINTS, divide by 10 to get pips)
Returns: The current candle's body size in POINTS
getTopWickSize() Gets the current candle's top wick size (in POINTS, divide by 10 to get pips)
Returns: The current candle's top wick size in POINTS
getBottomWickSize() Gets the current candle's bottom wick size (in POINTS, divide by 10 to get pips)
Returns: The current candle's bottom wick size in POINTS
getBodyPercent() Gets the current candle's body size as a percentage of its entire size including its wicks
Returns: The current candle's body size percentage
strictBearPinBar(float, float) This it to find pinbars with a very long wick compared to the body that are bearish
Parameters:
float : minTopMulitplier (default=4) The minimum number of times that the top wick has to be bigger than the candle body size
float : maxBottomMultiplier (default=2) The maximum number of times that the bottom wick can be bigger than the candle body size
Returns: a bool function true if current candle is withing the parameters
strictBullPinBar(float, float) This it to find pinbars with a very long wick compared to the body that are bearish
Parameters:
float : minTopMulitplier (default=4) The minimum number of times that the top wick has to be bigger than the candle body size
float : maxBottomMultiplier (default=2) The maximum number of times that the bottom wick can be bigger than the candle body size
Returns: a bool function true if current candle is withing the parameters