COT_OscillatorThe COT Ocsillator Indicator is a quantitative analysis tool that uses the positioning of so-called Commercials from the weekly Commitments of Traders (COT) report published by the CFTC. It is designed to detect extreme hedging behavior by institutional participants and translates it into a normalized scale from 0 to 100. The goal is to provide early indication of potential market reversals or overextensions.
What is the "Commercial Index"?
Commercials are market participants with a direct connection to the underlying asset – such as producers, processors, or large-scale users of commodities. They are often referred to as "Smart Money" due to their fundamental market insight and hedging purpose.
The Commercial Index measures where the current net position of Commercials (Long - Short) stands within a user-defined historical lookback window:
Index = 100: the most bullish net position in the selected period.
Index = 0: the most bearish net position.
How does the indicator work?
Data Source: The script uses the latest TradingView/LibraryCOT/4, which provides structured access to official COT data.
Calculation:
Weekly long and short positions of Commercials are requested based on the selected root symbol (e.g., "HG" for Copper).
Net position is calculated as: Net = Long - Short.
This value is normalized within the selected historical range (e.g., 150 weeks) between the highest and lowest net positions.
Result: A smooth oscillator ranging from 0 to 100 is plotted.
How to use the indicator?
Select your target future market (e.g., "GC" for Gold, "CL" for Crude Oil, "HG" for Copper).
Optionally adjust the three time windows to observe short-, mid-, and long-term sentiment (e.g., 125, 250, 500 weeks).
Watch for extreme readings:
Above 80–100: Commercials are heavily net long.
Below 20–0: Commercials are heavily net short.
These extremes are especially relevant when combined with price action, seasonality, or technical signals.
What makes this script unique?
Objective sentiment evaluation based on real institutional positioning.
Three timeframes shown in parallel for multi-horizon analysis.
No smoothing or distortion – raw positioning is visualized cleanly.
Useful in futures markets, where hedging behavior is a major driver.
Tips for Use:
Best viewed on weekly daily or charts (e.g., COMEX:HG1!, NYMEX:CL1!, CBOT:ZW1!).
Combine with technical setups or external sentiment tools for confirmation.
Can be used as a core building block in COT-based strategies or signal generation systems.
This indicator helps you track the footprints of Smart Money – and anticipate where the market might turn.
Indicatori e strategie
RJLibrary "RJ"
The library is searching the FVG
find_bull_rj(provided_RJs, low_1, high_1, time_3, bar_closed, close_2, open_2, low_2)
Parameters:
provided_RJs (array type from maksym_hayovets/POITypes/6)
low_1 (float)
high_1 (float)
time_3 (int)
bar_closed (bool)
close_2 (float)
open_2 (float)
low_2 (float)
FVGLibrary "FVG"
The library is searching the FVG
find_bull_fvg(provided_fvgs, monthly_low_1, monthly_high_3, monthly_time_3, monthly_bar_closed, monthly_high_1)
Parameters:
provided_fvgs (array type from maksym_hayovets/POITypes/1)
monthly_low_1 (float)
monthly_high_3 (float)
monthly_time_3 (int)
monthly_bar_closed (bool)
monthly_high_1 (float)
find_bear_fvg(provided_fvgs, monthly_low_3, monthly_high_1, monthly_time_3, monthly_bar_closed, monthly_low_1)
Parameters:
provided_fvgs (array type from maksym_hayovets/POITypes/1)
monthly_low_3 (float)
monthly_high_1 (float)
monthly_time_3 (int)
monthly_bar_closed (bool)
monthly_low_1 (float)
POITypesLibrary "POITypes"
TODO: add library description here
ZonePOI
Fields:
right (series int)
top (series float)
left (series int)
bottom (series float)
is_tested (series bool)
start_time_test_4H (series int)
end_time_test_4H (series int)
is_covered (series bool)
is_drawn (series bool)
COT_OscilatorThe COT Ocsilator Indicator is a quantitative analysis tool that uses the positioning of so-called Commercials from the weekly Commitments of Traders (COT) report published by the CFTC . It is designed to detect extreme hedging behavior by institutional participants and translates it into a normalized scale from 0 to 100. The goal is to provide early indication of potential market reversals or overextensions.
What is the "Commercial Index"?
Commercials are market participants with a direct connection to the underlying asset – such as producers, processors, or large-scale users of commodities. They are often referred to as "Smart Money" due to their fundamental market insight and hedging purpose.
The Commercial Index measures where the current net position of Commercials (Long - Short) stands within a user-defined historical lookback window:
Index = 100 : the most bullish net position in the selected period.
Index = 0 : the most bearish net position.
How does the indicator work?
Data Source: The script uses the latest TradingView/LibraryCOT/4, which provides structured access to official COT data.
Calculation:
Weekly long and short positions of Commercials are requested based on the selected root symbol (e.g., "HG" for Copper).
Net position is calculated as: Net = Long - Short .
This value is normalized within the selected historical range (e.g., 150 weeks) between the highest and lowest net positions.
Result : A smooth oscillator ranging from 0 to 100 is plotted.
How to use the indicator?
Select your target future market (e.g., "GC" for Gold, "CL" for Crude Oil, "HG" for Copper).
Optionally adjust the three time windows to observe short-, mid-, and long-term sentiment (e.g., 125, 250, 500 weeks).
Watch for extreme readings:
Above 80–100: Commercials are heavily net long.
Below 20–0: Commercials are heavily net short.
These extremes are especially relevant when combined with price action, seasonality, or technical signals.
What makes this script unique?
Objective sentiment evaluation based on real institutional positioning.
Three timeframes shown in parallel for multi-horizon analysis.
No smoothing or distortion – raw positioning is visualized cleanly.
Useful in futures markets, where hedging behavior is a major driver.
Tips for Use:
Best viewed on weekly daily or charts (e.g., COMEX:HG1!, NYMEX:CL1!, CBOT:ZW1!).
Combine with technical setups or external sentiment tools for confirmation.
Can be used as a core building block in COT-based strategies or signal generation systems.
This indicator helps you track the footprints of Smart Money – and anticipate where the market might turn.
moving_averages_library_public🔍 Overview
A comprehensive open‑source Pine Script library offering a wide variety of moving average functions, including dynamic int-series support for variable-length MA calculations
Reddit
✨ Features
Dozens of moving averages supported:
SMA, EMA, WMA, TMA
Advanced types: ALMA, VRAMA, EFRAMA, EHMA, THMA, etc.
Each function supports both fixed-length and series-length input
Easily integrated into other indicators and strategies via dynamic length parameters
⚙️ How to Use
Import the library:
import T69/Moving_Averages/1 as ma
Call your desired MA function using source and length:
ma.hma(src, len)
ma.frama(src, len)
For dynamic integration, use an input type and pass to the matching function.
🛠 Example Code
src = input.source(close, "Source")
len = input.int(14, "Length")
type = input.string("HMA", "MA Type", options= )
ma_value = switch type
"EMA" => ma.ema(src,len)
"HMA" => ma.hma(src,len)
"FRAMA" => ma.frama(src,len)
=> na
plot(ma_value, color=color.blue)
⚠️ Limitations
Internal calculation precision may differ slightly from TradingView’s built‑in MA functions
Users must manually map input strings to MA functions
Does not include built‑in GUI dropdowns for selecting type
💡 Tips
Use adaptive MAs like VIDYA, JMA, or KAMA for volatility-aware smoothing
Combine with oscillators or ATR bands to define trend strength or entry zones
Utilize series‑based MA inputs for backtesting variability or optimization
📘 Credits
Author: MightyZinger
Published: June 2022 (Public Library), regularly updated
License: Open‑source. Reuse subject to TradingView House Rules
//====================TECHNICAL STUFFS====================
Library "moving_averages_library_public"
TODO: add library description here
new_def_teyoparams()
get_all_ma_enums()
get_ma_out(p_type, src, len, update_instances)
TODO: add function description here
Parameters:
p_type (series ma_type)
src (float) : TODO: Source of the candle for computation
len (simple int) : TODO: Length of lookback of the candle for computation
update_instances (teyo_parameters)
Returns: TODO: add what function returns
==============================================================================
Moving Average Selector
==============================================================================
teyo_parameters
Fields:
p1 (series float)
p2 (series float)
p3 (series float)
p4 (series float)
p5 (series float)
p6 (series float)
p7 (series float)
p8 (series float)
p9 (series float)
p10 (series float)
p11 (series float)
p12 (series float)
p13 (series float)
p14 (series float)
p15 (series float)
p16 (series float)
p17 (series float)
p18 (series float)
p19 (series float)
p20 (series float)
OHLC_DayLibrary "OHLC_Day"
TODO: add library description here
openD(x)
Parameters:
x (int)
highD(x)
Parameters:
x (int)
lowD(x)
Parameters:
x (int)
closeD(x)
Parameters:
x (int)
calculate_quantityLibrary "calculate_quantity"
calcualate quantity for each kind of a chart
calculate_position(entry_level, lowest_low, rr)
Parameters:
entry_level (float)
lowest_low (float)
rr (int)
PivotLibrary222Library "PivotLibrary222"
f_determinePivotStrength(_pivotCandidateRelativeIndex, _type, _maxStrength)
Determines the strength of a pivot (low or high).
Parameters:
_pivotCandidateRelativeIndex (int) : The relative bar index of the pivot candidate.
_type (string) : "low" for a pivot low, "high" for a pivot high.
_maxStrength (int) : The maximum number of bars to check on either side for strength.
Returns: An array containing .
f_getPlotColorForStrength(_strength)
Gets a plotting color based on pivot strength.
Parameters:
_strength (int) : The calculated pivot strength.
Returns: A color for plotting.
f_updateExistingPivotLow(f_pivotLows, f_pivotLowInfoIndex, f_newStrength, f_showLabels)
Updates an existing pivot LOW's strength and its corresponding chart label.
Parameters:
f_pivotLows (array) : The array of pivotLowInfo objects.
f_pivotLowInfoIndex (int) : The index of the pivot to update in the array.
f_newStrength (int) : The new (increased) strength of the pivot.
f_showLabels (bool) : A boolean to control if labels should be updated.
f_updateExistingPivotHigh(f_pivotHighs, f_pivotHighInfoIndex, f_newStrength, f_showLabels)
Updates an existing pivot HIGH's strength and its corresponding chart label.
Parameters:
f_pivotHighs (array) : The array of pivotHighInfo objects.
f_pivotHighInfoIndex (int) : The index of the pivot to update in the array.
f_newStrength (int) : The new (increased) strength of the pivot.
f_showLabels (bool) : A boolean to control if labels should be updated.
f_findPivotLows(f_pivotLows, f_minStrength, f_maxStrength, f_showLabels)
Finds and processes pivot lows.
Parameters:
f_pivotLows (array) : The array of pivotLowInfo objects to read from and modify.
f_minStrength (int) : Minimum strength required for a new pivot to be recorded.
f_maxStrength (int) : Maximum strength to search for when determining pivot strength.
f_showLabels (bool) : A boolean to control if new labels should be created.
f_findPivotHighs(f_pivotHighs, f_minStrength, f_maxStrength, f_showLabels)
Finds and processes pivot highs.
Parameters:
f_pivotHighs (array) : The array of pivotHighInfo objects to read from and modify.
f_minStrength (int) : Minimum strength required for a new pivot to be recorded.
f_maxStrength (int) : Maximum strength to search for when determining pivot strength.
f_showLabels (bool) : A boolean to control if new labels should be created.
pivotHighInfo
Represents a detected pivot high.
Fields:
abs_index (series int)
price (series float)
strength (series int)
label_id (series label)
pivotLowInfo
Represents a detected pivot low.
Fields:
abs_index (series int)
price (series float)
strength (series int)
label_id (series label)
myLMAsLibrary "myLMAs"
SMA(sourceData, maxLength)
Dynamic SMA
Parameters:
sourceData (float)
maxLength (int)
EMA(src, length)
Dynamic EMA
Parameters:
src (float)
length (int)
DEMA(src, length)
Dynamic DEMA
Parameters:
src (float)
length (int)
TEMA(src, length)
Dynamic TEMA
Parameters:
src (float)
length (int)
WMA(src, length)
Dynamic WMA
Parameters:
src (float)
length (int)
HMA(src, length)
Dynamic HMA
Parameters:
src (float)
length (int)
VWMA(src, volsrc, length)
Dynamic VWMA
Parameters:
src (float)
volsrc (float)
length (int)
SMMA(src, length)
Dynamic SMMA
Parameters:
src (float)
length (int)
LSMA(src, length, offset)
Dynamic LSMA
Parameters:
src (float)
length (int)
offset (int)
RMA(src, length)
Dynamic RMA
Parameters:
src (float)
length (int)
ALMA(src, length, offset_sigma, sigma)
Dynamic ALMA
Parameters:
src (float)
length (int)
offset_sigma (float)
sigma (float)
ZLSMA(src, length)
Dynamic ZLSMA
Parameters:
src (float)
length (int)
FRAMA(src, length)
Parameters:
src (float)
length (int)
KAMA(src, length)
Dynamic KAMA
Parameters:
src (float)
length (int)
JMA(src, length, phase)
Dynamic JMA
Parameters:
src (float)
length (int)
phase (float)
T3(src, length, volumeFactor)
Dynamic T3
Parameters:
src (float)
length (int)
volumeFactor (float)
DoublePatternsDetects Double Top and Double Bottom patterns from pivot points using structural symmetry, valley/peak depth, and extreme validation. Returns a detailed result object including similarity score, target price, and breakout quality.
WedgePatternsDetects Rising and Falling Wedge chart patterns using pivot points, trendline convergence, and volume confirmation. Includes adaptive wedge length analysis and a quality score for each match. Returns full wedge geometry and classification via WedgeResult.
HeadShouldersPatternsDetects Head & Shoulders and Inverse Head & Shoulders chart patterns from pivot point arrays. Includes neckline validation, shoulder symmetry checks, and head extremeness filtering. Returns a detailed result object with structure points, bar indices, and projected price target.
XABCD_HarmonicsLibrary for detecting harmonic patterns using ZigZag pivots or custom swing points. Supports Butterfly, Gartley, Bat, and Crab patterns with automatic Fibonacci ratio validation and optional D-point projection using extremes. Returns detailed PatternResult including structure points and target projection. Ideal for technical analysis, algorithmic detection, or overlay visualizations.
TextLibrary "Text"
library to format text in different fonts or cases plus a sort function.
🔸 Credits and Usage
This library is inspired by the work of three authors (in chronological order of publication date):
Unicode font function - JD - Duyck
UnicodeReplacementFunction - wlhm
font - kaigouthro
🔹 Fonts
Besides extra added font options, the toFont(fromText, font) method uses a different technique. On the first runtime bar (whether it is barstate.isfirst , barstate.islast , or between) regular letters and numbers and mapped with the chosen font. After this, each character is replaced using the build-in key - value pair map function .
Also an enum Efont is included.
Note: Some fonts are not complete, for example there isn't a replacement for every character in Superscript/Subscript.
Example of usage (besides the included table example):
import fikira/Text/1 as t
i_font = input.enum(t.Efont.Blocks)
if barstate.islast
sentence = "this sentence contains words"
label.new(bar_index, 0, t.toFont(fromText = sentence, font = str.tostring(i_font)), style=label.style_label_lower_right)
label.new(bar_index, 0, t.toFont(fromText = sentence, font = "Circled" ), style=label.style_label_lower_left )
label.new(bar_index, 0, t.toFont(fromText = sentence, font = "Wiggly" ), style=label.style_label_upper_right)
label.new(bar_index, 0, t.toFont(fromText = sentence, font = "Upside Latin" ), style=label.style_label_upper_left )
🔹 Cases
The script includes a toCase(fromText, case) method to transform text into snake_case, UPPER SNAKE_CASE, kebab-case, camelCase or PascalCase, as well as an enum Ecase .
Example of usage (besides the included table example):
import fikira/Text/1 as t
i_case = input.enum(t.Ecase.camel)
if barstate.islast
sentence = "this sentence contains words"
label.new(bar_index, 0, t.toCase(fromText = sentence, case = str.tostring(i_case)), style=label.style_label_lower_right)
label.new(bar_index, 0, t.toCase(fromText = sentence, case = "snake_case" ), style=label.style_label_lower_left )
label.new(bar_index, 0, t.toCase(fromText = sentence, case = "PascalCase" ), style=label.style_label_upper_right)
label.new(bar_index, 0, t.toCase(fromText = sentence, case = "SNAKE_CASE" ), style=label.style_label_upper_left )
🔹 Sort
The sort(strings, order, sortByUnicodeDecimalNumbers) method returns a sorted array of strings.
strings: array of strings, for example words = array.from("Aword", "beyond", "Space", "salt", "pepper", "swing", "someThing", "otherThing", "12345", "_firstWord")
order: "asc" / "desc" (ascending / descending)
sortByUnicodeDecimalNumbers: true/false; default = false
_____
• sortByUnicodeDecimalNumbers: every Unicode character is linked to a Unicode Decimal number ( wikipedia.org/wiki/List_of_Unicode_characters ), for example:
1 49
2 50
3 51
...
A 65
B 66
...
S 83
...
_ 95
` 96
a 97
b 98
...
o 111
p 112
q 113
r 114
s 115
...
This means, if we sort without adjusting ( sortByUnicodeDecimalNumbers = true ), in ascending order, the letter b (98 - small) would be after S (83 - Capital).
By disabling sortByUnicodeDecimalNumbers , Capital letters are intermediate transformed to str.lower() after which the Unicode Decimal number is retrieved from the small number instead of the capital number. For example S (83) -> s (115), after which the number 115 is used to sort instead of 83.
Example of usage (besides the included table example):
import fikira/Text/1 as t
if barstate.islast
aWords = array.from("Aword", "beyond", "Space", "salt", "pepper", "swing", "someThing", "otherThing", "12345", "_firstWord")
label.new(bar_index, 0, str.tostring(t.sort(strings= aWords, order = 'asc' , sortByUnicodeDecimalNumbers = false)), style=label.style_label_lower_right)
label.new(bar_index, 0, str.tostring(t.sort(strings= aWords, order = 'desc', sortByUnicodeDecimalNumbers = false)), style=label.style_label_lower_left )
label.new(bar_index, 0, str.tostring(t.sort(strings= aWords, order = 'asc' , sortByUnicodeDecimalNumbers = true )), style=label.style_label_upper_right)
label.new(bar_index, 0, str.tostring(t.sort(strings= aWords, order = 'desc', sortByUnicodeDecimalNumbers = true )), style=label.style_label_upper_left )
🔸 Methods/functions
method toFont(fromText, font)
toFont : Transforms text into the selected font
Namespace types: series string, simple string, input string, const string
Parameters:
fromText (string)
font (string)
Returns: `fromText` transformed to desired `font`
method toCase(fromText, case)
toCase : formats text to snake_case, UPPER SNAKE_CASE, kebab-case, camelCase or PascalCase
Namespace types: series string, simple string, input string, const string
Parameters:
fromText (string)
case (string)
Returns: `fromText` formatted to desired `case`
method sort(strings, order, sortByUnicodeDecimalNumbers)
sort : sorts an array of strings, ascending/descending and by Unicode Decimal numbers or not.
Namespace types: array
Parameters:
strings (array)
order (string)
sortByUnicodeDecimalNumbers (bool)
Returns: Sorted array of strings
MarketCapLibrary2Library "MarketCapLibrary2"
setMarketCapMap(m)
Parameters:
m (map)
getMarketCap(ticker)
Parameters:
ticker (string)
MarketCapLibrary1Library "MarketCapLibrary1"
setMarketCapMap(m)
Parameters:
m (map)
getMarketCap(ticker)
Parameters:
ticker (string)
AnnualizedReturnCalculatorLibrary "AnnualizedReturnCalculator"
TODO: add library description here
calculateAnnualizedReturn(isStartTime, enableLog)
Parameters:
isStartTime (bool) : 开始时间的BOOL值变量(用于标记策略开始时间)
enableLog (bool) : 是否输出日志
Returns:
返回持仓基准年化收益率、资金基准年化收益率、总收益、平均资金占用
PineVersatilitiesBundleEnhanced the dynamic_MA function by adding five more MA types to the eight existing types.
Added neo_heikin_ashi_ohlc function for Customised or Standard Heikin-Ashi OHLC values tuple.
Library "PineVersatilitiesBundle"
Versatilities (aka, Versatile Utilities) Pack includes:
- Price Variants bundled in a Map,
- Smoothing Variants bundled in a Map,
- Standard and customised Heikin-Ashi values in a tuple,
- Visualisations that plot some indications in the pane and others, including candles/bars, on the chart.
price_variants(lb, hop, op, cl, fmean, hi, lo, mid, pvt, cmean)
Computes Several different averages using current and previous OHLC values
Parameters:
lb (int) : lookback distance for combining OHLC values from the past; optional input, default is 1
hop (int) : skip bars while looking back; optional input, default is 0
op (float) : open value; optional input, default is open
cl (float) : close value; optional input, default is close
fmean (float) : bar average; optional input, default is ohlc4
hi (float) : high value; optional input, default is high
lo (float) : low value; optional input, default is low
mid (float) : range middle; optional input, default is hl2
pvt (float) : active pivot; optional input, default is hlc3
cmean (float) : active average; optional input, default is hlcc4
Returns: Map of, rounded-to-mintick, combinations of single and two-bar OHLC averages
dynamic_MA(masrc, malen, almasgm, almaoff, almaflr, lsmaoff, volfctr)
Dynamically computes Eight different MAs and returns a Map containing Nine MAs
Parameters:
masrc (float) : source series to compute MA
malen (simple int) : lookback distance for MA
almasgm (simple float) : ALMA sigma; optional input, default is 5
almaoff (simple float) : ALMA offset; optional input, default is 0.5
almaflr (simple bool) : ALMA floor flag; optional input, default is false
lsmaoff (simple int) : LSMA offset; optional input, default is 0
volfctr (simple float) : T3/Tilson MA volume factor; optional input, default is 0.5
Returns: Map of, rounded-to-mintick, MAs - 'ALMA', 'DEMA', 'EMA', 'FRAMA', 'HMA', 'LSMA', 'RMA',
'SMA', 'SWMA', 'T3MA', 'TEMA', 'TRIMA', 'WMA', plus an 'ALL' for the average of all other MAs
neo_heikin_ashi_ohlc(customised, standard, op, cl, avbar, hi, lo, avrng, pivot, pvtcl)
Computes customised or standard Heikin Ashi candles/bars OHLC values
Parameters:
customised (bool) : toggle for computing customised Heikin Ashi OHLC; optional input, default is true; ignores standard setting
standard (bool) : toggle for computing standard Heikin Ashi OHLC; optional input, default is false
op (float) : open value; optional input, default is open
cl (float) : close value; optional input, default is close
avbar (float) : bar average; optional input, default is ohlc4
hi (float) : high value; optional input, default is high
lo (float) : low value; optional input, default is low
avrng (float) : range middle; optional input, default is hl2
pivot (float) : active pivot; optional input, default is hlc3
pvtcl (float) : active average; optional input, default is hlcc4
Returns: Tuple of, rounded-to-mintick, Customised or Standard Heikin-Ashi OHLC and its common averages
LiliALHUNTERSystem_v2📚 **Library: LiliALHUNTERSystem_v2**
This library provides a powerful target management system for Pine Script developers.
It includes advanced calculators for EMA, RMA, and Supertrend, and introduces a central `createTargets()` function to dynamically render target lines and labels based on long/short trade logic.
🛠️ **Main Features:**
– Dynamic horizontal & vertical target lines
– Dual target configuration (Target 1 & Target 2)
– Directional logic via `isLong1`, `isLong2`
– Integrated Supertrend validation
– Visual dashboard and label display
– Works seamlessly with custom indicators
🎯 **Purpose:**
The `LiliALHUNTERSystem_v2` Library enables Pine coders to manage and visualize targets consistently across all trading strategies and indicators. It simplifies target logic while maintaining visual clarity and modular usage.
⚠️ **Disclaimer:**
This script is intended for educational and analytical purposes only. It does not constitute financial advice.
Library "LiliALHUNTERSystem_v2"
ema_calc(len, source)
Parameters:
len (simple int)
source (float)
rma_calc(len, source)
Parameters:
len (simple int)
source (float)
supertrend_calc(length, factor)
Parameters:
length (simple int)
factor (float)
createTargets(config, state, source1A, source1B, source2A, source2B)
Parameters:
config (TargetConfig)
state (TargetState)
source1A (float)
source1B (float)
source2A (float)
source2B (float)
showDashboard(state, dashLoc, textSize)
Parameters:
state (TargetState)
dashLoc (string)
textSize (string)
TargetConfig
Fields:
enableTarget1 (series bool)
enableTarget2 (series bool)
isLong1 (series bool)
isLong2 (series bool)
target1Condition (series string)
target2Condition (series string)
target1Color (series color)
target2Color (series color)
target1Style (series string)
target2Style (series string)
distTarget1 (series float)
distTarget2 (series float)
distOptions1 (series string)
distOptions2 (series string)
showLabels (series bool)
showDash (series bool)
TargetState
Fields:
target1LineV (series line)
target1LineH (series line)
target2LineV (series line)
target2LineH (series line)
target1Lbl (series label)
target2Lbl (series label)
target1Active (series bool)
target2Active (series bool)
target1Value (series float)
target2Value (series float)
countTargets1 (series int)
countTgReached1 (series int)
countTargets2 (series int)
countTgReached2 (series int)
MyLibrary神启MT牛熊指数指标 ### Bull and Bear Wave Trend Indicator:
#### Indicator Interpretation
- **Green Fast Line (WT1) and Red Slow Line (WT2)**:
- When the green line crosses the red line from bottom to top, it is usually regarded as a bullish signal, especially when it occurs in the oversold zone (below -50), the signal strength is higher.
- When the green line crosses the red line from top to bottom, it is usually regarded as a bearish signal, especially when it occurs in the overbought zone (above +50), the signal strength is higher.
- **Overbought/Oversold Zones**:
- When both lines enter **above the red dotted line (overbought zone)**, it indicates that the market may be overheated and there is a risk that the upward momentum will be exhausted.
- When both lines enter **below the blue dotted line (oversold zone)**, it indicates that the market may be oversold, which is a potential bottom or rebound area.
- **Custom Settings**:
You can click the small gear icon next to the indicator name to enter "Settings" and adjust the "Channel Length", "Average Length" and "Overbought/Oversold Levels" according to your own trading style.
EventFilterLib🧠 EventFilterLib – Summary & Usage
📘 Purpose
EventFilterLib helps suppress trading signals around sensitive market times, improving signal quality and reducing risk during volatile or illiquid periods.
🔢 Included Event Filters
🟥 Tier 1 – High Impact Events (3h buffer default)
--FOMC Meetings
--NFP
--CPI
--Fed Chair Speeches
--US Federal Holidays
🟧 Tier 2 – Medium Impact Events (2h buffer default)
--ADP Employment Reports
--Retail Sales
--PPI Releases
--ISM Reports
--Crude Oil Inventories
🟦 Tier 3 – Session-Based Filters (built-in)
--NY Open/Close (±30min)
--Asia–London Overlap (07:00–09:00 UTC)
--NY Lunch (17:00–18:00 UTC)
--Midnight GMT Volatility Spike (00:00–00:30 UTC)
🟨 Weekend Filter
--Full-day block on Saturday/Sunday
--Optional buffer (e.g. Friday after 3pm)
The library returns 4 Booleans, . You can call the function in your script using the following snippet:
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
barTime = time
// === Inputs
weekendMode = input.bool(true, "Enable Weekend Filter")
bufferT1Before = input.int(180, "Tier 1 Buffer Before (min)")
bufferT1After = input.int(180, "Tier 1 Buffer After (min)")
bufferT2Before = input.int(120, "Tier 2 Buffer Before (min)")
bufferT2After = input.int(120, "Tier 2 Buffer After (min)")
bufferWBefore = input.int(180, "Weekend Buffer Before (min)")
bufferWAfter = input.int(180, "Weekend Buffer After (min)")
// === Call Function
= EventFilterLib.isInQuietPeriod(
barTime, weekendMode, bufferT1Before, bufferT1After,
bufferWBefore, bufferWAfter, bufferT2Before, bufferT2After
)
// === Apply to Visualization or Signal Filter
bgcolor(tier1 ? color.red : na, title="Tier 1 Quiet")
bgcolor(tier2 ? color.orange : na, title="Tier 2 Quiet")
bgcolor(weekend ? color.blue : na, title="Weekend Quiet")
bgcolor(session ? color.purple : na, title="Session Quiet")
// Example Trade Block
allowTrade = not (tier1 or tier2 or weekend or session)
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
/Novo Algo Team
OneMonthFVGLibrary "OneMonthFVG"
The library is searching the open 1M FVG
find_one_m_fvg(provided_bull_fvgs)
Parameters:
provided_bull_fvgs (array)
BullFVG
Fields:
right (series int)
top (series float)
left (series int)
bottom (series float)