Buscar en scripts para "股价站上60月线"
EMA (10,20,60) + Bollinger BandsCombination of bollinger bands and exponential moving averages (10, 20, 60)
The coloring is optimized for dark background, and it is editable
This indicator combined 3 exponential moving average lines and bollinger bands . The EMA lines can be add or deleted in pine editor, and its parameters can be changed too. Same to the bollinger bands . Defaulted value for BB is 20SMA with 2 standard deviations.
Useful as a supplmentary indicators
EMA30,60,100 EMA 30 (orange),60(red),100(green)
Bullish: green below the other two
Bearish: green above other two
when lines cross, no clear trend.
When Price touches the orange = entry point
Thanks to CFXtrader for the basic script
[STRATEGY]EMA 30/60 Cross Strategystrategy based on EMA 30/60 cross
works best on 4hr timeframes & high-midcaps
120/60 Trend ModelCombination of 120 & 60 EMAs used to determine entries as well as the over all trend.
Guppy MMA 3, 5, 8, 10, 12, 15 and 30, 35, 40, 45, 50, 60Guppy Multiple Moving Average 
Short Term EMA 3, 5, 8, 10, 12, 15 
Long Term EMA 30, 35, 40, 45, 50, 60 
Use for SFTS Class
HTF Candle Countdown Timer//@version=5
indicator("HTF Candle Countdown Timer", overlay=true)
// ============================================================================
// INPUTS - SETTINGS MENU
// ============================================================================
// --- Mode Selection ---
mode = input.string(title="Mode", defval="Auto", options= , 
     tooltip="Auto: Αυτόματη αντιστοίχιση timeframes\nCustom: Επιλέξτε το δικό σας timeframe")
// --- Custom Timeframe Selection ---
customTF = input.timeframe(title="Custom Timeframe", defval="15", 
     tooltip="Ενεργό μόνο σε Custom Mode")
// --- Table Position ---
tablePos = input.string(title="Table Position", defval="Bottom Right", 
     options= )
// --- Colors ---
textColor = input.color(title="Text Color", defval=color.white)
bgColor = input.color(title="Background Color", defval=color.black)
transparentBg = input.bool(title="Transparent Background", defval=false, 
     tooltip="Ενεργοποίηση διάφανου φόντου")
// --- Text Size ---
textSize = input.string(title="Text Size", defval="Normal", 
     options= )
// ============================================================================
// FUNCTIONS
// ============================================================================
// Μετατροπή string position σε table position constant
getTablePosition(pos) =>
    switch pos
        "Top Left" => position.top_left
        "Top Right" => position.top_right
        "Bottom Left" => position.bottom_left
        "Bottom Right" => position.bottom_right
        => position.bottom_right
// Μετατροπή string size σε size constant
getTextSize(size) =>
    switch size
        "Auto" => size.auto
        "Tiny" => size.tiny
        "Small" => size.small
        "Normal" => size.normal
        "Large" => size.large
        "Huge" => size.huge
        => size.normal
// Αυτόματη αντιστοίχιση timeframes
getAutoTimeframe() =>
    currentTF = timeframe.period
    string targetTF = ""
    
    if currentTF == "1"
        targetTF := "15"
    else if currentTF == "3"
        targetTF := "30"
    else if currentTF == "5"
        targetTF := "60"
    else if currentTF == "15"
        targetTF := "240"
    else if currentTF == "60"
        targetTF := "D"
    else if currentTF == "240"
        targetTF := "W"
    else
        // Default fallback για μη-mapped timeframes
        targetTF := "60"
    
    targetTF
// Μετατροπή timeframe string σε λεπτά για σύγκριση
timeframeToMinutes(tf) =>
    float minutes = 0.0
    
    if str.contains(tf, "D")
        multiplier = str.tonumber(str.replace(tf, "D", ""))
        minutes := na(multiplier) ? 1440.0 : multiplier * 1440.0
    else if str.contains(tf, "W")
        multiplier = str.tonumber(str.replace(tf, "W", ""))
        minutes := na(multiplier) ? 10080.0 : multiplier * 10080.0
    else if str.contains(tf, "M")
        multiplier = str.tonumber(str.replace(tf, "M", ""))
        minutes := na(multiplier) ? 43200.0 : multiplier * 43200.0
    else
        minutes := str.tonumber(tf)
    
    minutes
// Format countdown σε ώρες:λεπτά:δευτερόλεπτα ή λεπτά:δευτερόλεπτα
formatCountdown(milliseconds) =>
    totalSeconds = math.floor(milliseconds / 1000)
    hours = math.floor(totalSeconds / 3600)
    minutes = math.floor((totalSeconds % 3600) / 60)
    seconds = totalSeconds % 60
    
    string result = ""
    
    if hours > 0
        result := str.format("{0,number,00}:{1,number,00}:{2,number,00}", hours, minutes, seconds)
    else
        result := str.format("{0,number,00}:{1,number,00}", minutes, seconds)
    
    result
// Μετατροπή timeframe σε readable format
formatTimeframe(tf) =>
    string formatted = ""
    
    if str.contains(tf, "D")
        formatted := tf + "aily"
    else if str.contains(tf, "W")
        formatted := tf + "eekly"
    else if str.contains(tf, "M")
        formatted := tf + "onthly"
    else if tf == "60"
        formatted := "1H"
    else if tf == "240"
        formatted := "4H"
    else
        formatted := tf + "min"
    
    formatted
// ============================================================================
// MAIN LOGIC
// ============================================================================
// Επιλογή target timeframe βάσει mode
targetTimeframe = mode == "Auto" ? getAutoTimeframe() : customTF
// Validation: Έλεγχος αν το target timeframe είναι μεγαλύτερο από το τρέχον
currentTFMinutes = timeframeToMinutes(timeframe.period)
targetTFMinutes = timeframeToMinutes(targetTimeframe)
var string warningMessage = ""
if targetTFMinutes <= currentTFMinutes
    warningMessage := "⚠ HTF < Current TF"
else
    warningMessage := ""
// Υπολογισμός του χρόνου κλεισίματος του HTF candle
htfTime = request.security(syminfo.tickerid, targetTimeframe, time)
htfTimeClose = request.security(syminfo.tickerid, targetTimeframe, time_close)
// Υπολογισμός υπολειπόμενου χρόνου σε milliseconds
remainingTime = htfTimeClose - timenow
// Format countdown
countdown = warningMessage != "" ? warningMessage : formatCountdown(remainingTime)
// Format timeframe για εμφάνιση
displayTF = formatTimeframe(targetTimeframe)
// ============================================================================
// TABLE DISPLAY
// ============================================================================
// Δημιουργία table
var table countdownTable = table.new(
     position=getTablePosition(tablePos), 
     columns=2, 
     rows=2, 
     bgcolor=transparentBg ? color.new(bgColor, 100) : bgColor,
     frame_width=1,
     frame_color=color.gray,
     border_width=1)
// Update table content
if barstate.islast
    // Header
    table.cell(countdownTable, 0, 0, "Timeframe:", 
         text_color=textColor, 
         bgcolor=transparentBg ? color.new(bgColor, 100) : bgColor,
         text_size=getTextSize(textSize))
    
    table.cell(countdownTable, 1, 0, displayTF, 
         text_color=textColor, 
         bgcolor=transparentBg ? color.new(bgColor, 100) : bgColor,
         text_size=getTextSize(textSize))
    
    // Countdown
    table.cell(countdownTable, 0, 1, "Countdown:", 
         text_color=textColor, 
         bgcolor=transparentBg ? color.new(bgColor, 100) : bgColor,
         text_size=getTextSize(textSize))
    
    table.cell(countdownTable, 1, 1, countdown, 
         text_color=warningMessage != "" ? color.orange : textColor, 
         bgcolor=transparentBg ? color.new(bgColor, 100) : bgColor,
         text_size=getTextSize(textSize))
// ============================================================================
// END OF SCRIPT
// ============================================================================
RRG Sector Snapshot RRG Sector Snapshot · Clear UI — User Guide 
What this indicator does
Purpose: Visualize sector rotation by comparing each sector’s Relative Strength (RS-Ratio) and RS-Momentum versus a benchmark (e.g., VNINDEX).
Output: A quadrant map (table overlay) that positions each sector into one of four regimes:
LEADING (top-right): Strong and accelerating — leadership zone.
WEAKENING (bottom-right): Strong but decelerating — may be topping or consolidating.
LAGGING (bottom-left): Weak and decelerating — avoid unless mean-reverting.
IMPROVING (top-left): Weak but accelerating — candidates for next rotation into leadership.
How it works (under the hood)
X-axis (Strength): RS-Ratio = Sector Close / Benchmark Close, then normalized with a Z-Score over a lookback (normLen).
Y-axis (Momentum): Linear-regression slope of RS-Ratio over rsLen, then normalized with a Z-Score (normLen).
Mapping to grid: Both axes are Z-Scores scaled to a square grid (rrgSize × rrgSize) using a zoom factor (rrgScale). The center is neutral (0,0). Momentum increases upward (Y=0 is the top row in the table).
Quick start (3 minutes)
Add to chart:
TradingView → Pine Editor → paste the script → Save → Add to chart.
Set a benchmark: In inputs, choose Benchmark (X axis) — default INDEX:VNINDEX. Use VN30 or another index if it better reflects your universe.
Load sectors: Fill S1..S10 with sector or index symbols you track (up to 10). Set Slots to Use to the number you actually use.
Adjust view:
rrgSize (grid cells): 18–24 is a good starting point.
rrgScale (zoom): 2.5–3.5 typically; decrease to “zoom out” (points cluster near center), increase to “zoom in” (points spread to edges).
Read the map:
Prioritize sectors in LEADING; shortlist sectors in IMPROVING (could rotate into LEADING).
WEAKENING often marks late-cycle strength; LAGGING is typically avoid.
Inputs — what they do and how to change them
General
Analysis TF: Timeframe used to compute RRG (can be different from chart’s TF). Daily for swing, 1H/4H for tactical rotation, Weekly for macro view.
Benchmark (X axis): The index used for RS baseline (e.g., INDEX:VNINDEX, INDEX:VN30, major ETFs, or a custom composite).
RRG Calculation
RS Lookback (rsLen): Bars used for slope of RS (momentum).
Daily: 30–60 (default 40)
Intraday (1H/4H): 20–40
Weekly: 26–52
Normalization Lookback (Z-Score) (normLen): Window for Z-Score on both axes.
Daily: 80–120 (default 100)
Intraday: 40–80
Weekly: 52–104
Tip: Shorter lookbacks = more responsive but noisier; longer = smoother but slower.
RRG HUD (Table)
Show RRG Snapshot (rrgEnable): Toggle the table on/off.
Position (rrgPos): top_right | top_left | bottom_right | bottom_left.
Grid Size (Cells) (rrgSize): Table dimensions (N×N). Larger = more resolution but takes more space.
Z-Scale (Zoom) (rrgScale): Maps Z-Scores to the grid.
Smaller (2.0–2.5): Zoom out (more points near center).
Larger (3.5–4.0): Zoom in (emphasize outliers).
Appearance
Tag length (tagLen): Characters per sector tag. Use 4–6 for clarity.
Text size (textSizeOp): Tiny | Small | Normal | Large. Use Large for presentation screens or dense lists.
Axis thickness (axisThick): 1 = thin axis; 2 = thicker double-strip axis.
Quadrant alpha (bgAlpha): Transparency of quadrant backgrounds. 80–90 makes text pop.
Sectors (Max 10)
Slots to Use (sectorSlots): How many sector slots are active (≤10).
S1..S10: Each slot is a symbol (index, sector index, or ETF). Replace defaults to fit your market/universe.
How to interpret the map
Quadrants:
Leading (top-right): Relative strength above average and improving — trend-follow candidates.
Weakening (bottom-right): Still strong but momentum cooling — watch for distribution or pauses.
Lagging (bottom-left): Underperforming and still losing momentum — avoid unless doing mean-reversion.
Improving (top-left): Early recovery — candidates to transition into Leading if the move persists.
Overlapping sectors in one cell: The indicator shows “TAG +n” where TAG is the first tag, +n is the number of additional sectors sharing that cell. If many overlap:
Increase rrgSize, or
Decrease rrgScale to zoom out, or
Reduce Slots to Use to a smaller selection.
Suggested workflows
Daily swing
Benchmark: VNINDEX or VN30
rsLen 40–60, normLen 100–120, rrgSize 18–24, rrgScale 2.5–3.5
Routine:
Identify Leading sectors (top-right).
Spot Improving sectors near the midline moving toward top-right.
Confirm with price/volume/breakout on sector charts or top components.
Intraday (1H/4H) tactical
rsLen 20–40, normLen 60–100, rrgScale 2.0–3.0
Expect faster rotations and more noise; tighten filters with your own entry rules.
Weekly (macro rotation)
rsLen 26–52, normLen 52–104, rrgScale 3.0–4.0
Great for portfolio tilts and sector allocation.
Tuning tips
If everything clusters near center: Increase rrgScale (zoom in) or reduce normLen (more contrast).
If points are too spread: Decrease rrgScale (zoom out) or increase normLen (smoother normalization).
If the table is too big/small: Change rrgSize (cells).
If tags are hard to read: Increase textSizeOp to Large, tagLen to 5–6, and consider bgAlpha ~80–85.
Troubleshooting
No table on chart:
Ensure Show RRG Snapshot is enabled.
Change Position to a different corner.
Reduce Grid Size if the table exceeds the chart area.
Many sectors “missing”:
They’re likely overlapping in the same cell; the cell will show “TAG +n”.
Increase rrgSize, decrease rrgScale, or reduce Slots to Use.
Early bars show nothing:
You need enough data for rsLen and normLen. Scroll back or reduce lookbacks temporarily.
Best practices
Use RRG for context and rotation scouting, then confirm with your execution tools (trend structure, breakouts, volume, risk metrics).
Benchmark selection matters. If most of your watchlist tracks VN30, use INDEX:VN30 as the benchmark to get a truer relative read.
Revisit settings per timeframe. Intraday needs more responsiveness (shorter lookbacks, smaller Z-Scale); weekly needs stability (longer lookbacks, larger Z-Scale).
FAQ
Can I use ETFs or custom indices as sectors? Yes. Any symbol supported by TradingView works.
Can I track individual stocks instead of sectors? Yes (up to 10); just replace the S1..S10 symbols.
Why Z-Score? It standardizes each axis to “how unusual” the value is versus its own history — more robust than raw ratios across different scales.
 [ i] 
How to Set Up (Your Market Template) 
This is the most important part for customizing the indicator to any market.
Step 1: Choose Your TF & Benchmark
Open the indicator's Settings.
Analysis TF: Set the timeframe you want to analyze (e.g., D for medium-term, W for long-term).
Benchmark (Trục X): This is the index you want to compare against.
Vietnamese Market: Leave the default INDEX:VNINDEX.
US Market: Change to SP:SPX or NASDAQ:NDX.
Crypto Market: Change to TOTAL (entire market cap) or BTC.D (Bitcoin Dominance).
Step 2: Input Your "Universe" (The 10 Slots)
This is where you decide what to track. You have 10 slots (S1 to S10).
For Vietnamese Sectors (Default):
Leave the default sector codes like INDEX:VNFINLEAD (Finance), INDEX:VNREAL (Real Estate), INDEX:VNIND (Industry), etc.
Template for Crypto "Sectors":
S1: BTC.D
S2: ETH.D
S3: TOTAL2 (Altcoin Market Cap)
S4: TOTAL.DEFI (DeFi)
S5: CRYPTOCAP:GAME (GameFi)
...and so on.
Template for Blue Chip Stocks:
Benchmark: INDEX:VN30
S1: HOSE:FPT
S2: HOSE:VCB
S3: HOSE:HPG
S4: HOSE:MWG
...and so on.
Template for Commodities:
Benchmark: TVC:DXY (US Dollar Index)
S1: TVC:GOLD
S2: TVC:USOIL
S3: TVC:SILVER
S4: COMEX:HG1! (Copper)
...and so on.
Step 3: Fine-Tuning
RS Lookback: A larger number (e.g., 100) gives a smoother, long-term view. A smaller number (e.g., 20) is more sensitive to short-term changes.
Z-Scale (Zoom): This is the "magnification" of the map.
If all your sectors are crowded in the middle, increase this number (e.g., 4.0) to "zoom in."
If your sectors are stuck on the edges, decrease this number (e.g., 2.0) to "zoom out."
Tag length: How many letters to display for the ticker (e.g., 4 will show VNFI).
VWMA Series (Dynamic) mtf - Dual Gradient Colored"VWMA Series (Dynamic) mtf - Dual Gradient Colored" is a multi-timeframe (MTF) Volume-Weighted Moving Average (VWMA) ribbon indicator that plots up to 60 sequential VWMAs with arithmetic progression periods (e.g., 1, 4, 7, 10…).  Each VWMA line is dual-gradient colored:  Base hue = Greenish (#2dd204) if close > VWMA (bullish), Magenta (#ff00c8) if close < VWMA (bearish)  
Brightness gradient = fades from base → white as period increases (short → long-term)
Uses daily resolution by default (timeframe="D"), making it ideal for higher-timeframe trend filtering on lower charts.Key FeaturesFeature
Description
Dynamic Periods
Start + i × Increment → e.g., 1, 4, 7, 10… up to 60 terms
Dual Coloring
Bull/Bear + Gradient (short = vivid, long = pale)
MTF Ready
Plots daily VWMAs on any lower timeframe (1H, 15M, etc.)
No Lag on Long Sets
Predefined "best setups" eliminate repainting/lag
Transparency Control
Adjustable line opacity for clean visuals
Scalable
Up to 60 VWMAs (max iterations)
Recommended Setups (No Lag)Type
Example Sequence (Start, Inc, Iter)
Long-Term Trend
1, 3, 30 → 1, 4, 7 … 88
93, 3, 30 → 93, 96 … 180
372, 6, 30 → 372, 378 … 546
Short-Term Momentum
1, 1, 30 → 1, 2, 3 … 30
94, 2, 30 → 94, 96 … 152
1272, 5, 30 → 1272, 1277 … 1417
Key Use CasesUse Case
How to Use
1. Multi-Timeframe Trend Alignment
On 1H chart, use 1, 3, 30 daily VWMAs → price above all green lines = strong uptrend
2. Dynamic Support/Resistance
Cluster of long-term pale VWMAs = major S/R zone
3. Early Trend Change Detection
Short-term vivid lines flip from red → green before longer ones = early bullish signal
4. Ribbon Compression/Expansion
Tight bundle → consolidation; fanning out → trend acceleration
5. Mean Reversion Entries
Price far from long-term VWMA cluster + short-term reversal = pullback trade
6. Volume-Weighted Fair Value
Long-period VWMAs reflect true average price paid over weeks/months
Visual Summary
Price ↑
  ████  ← Short VWMA (vivid green = close > VWMA)
   ███
    ██
     █
    . . . fading to white
     █
    ██
   ███
  ████  ← Long VWMA (pale = institutional average)
Green lines = price above VWMA (bullish bias)  
Magenta lines = price below VWMA (bearish bias)  
Gradient = shorter (left) → brighter; longer (right) → whiter  
Ribbon thickness = trend strength (wide = strong, narrow = weak)
Best For  Swing traders using daily trend on intraday charts  
Volume-based strategies (VWMA > SMA)  
Clean, colorful trend visualization without clutter  
Institutional fair value anchoring via long-period VWMAs
Pro Tip:
Use Start=1, Increment=3, Iterations=30 on a 4H chart with timeframe="D" → perfect daily trend filter with zero lag and beautiful gradient flow.
PineConnectorLibrary   "PineConnector" 
This library is a comprehensive alert webhook text generator for PineConnector. It contains every possible alert syntax variation from the documentation, along with some debugging functions.
To use it, just import the library (eg. "import ZenAndTheArtOfTrading/PineConnector/1 as pc") and use pc.buy(licenseID) to send an alert off to PineConnector - assuming all your webhooks etc are set up correctly.
View the PineConnector documentation for more information on how to send the commands you're looking to send (all of this library's function names match the documentation).
 all() 
  Usage: pc.buy(pc_id, freq=pc.all())
  Returns: "all"
 once_per_bar() 
  Usage: pc.buy(pc_id, freq=pc.once_per_bar())
  Returns: "once_per_bar"
 once_per_bar_close() 
  Usage: pc.buy(pc_id, freq=pc.once_per_bar_close())
  Returns: "once_per_bar_close"
 na0(value) 
  Checks if given value is either 'na' or 0. Useful for streamlining scripts with float user setting inputs which default values to 0 since na is unavailable as a user input default.
  Parameters:
     value (float) : The value to check
  Returns: True if the given value is 0 or na
 getDecimals() 
  Calculates how many decimals are on the quote price of the current market.
  Returns: The current decimal places on the market quote price
 truncate(number, decimals) 
  Truncates the given number. Required params: mumber.
  Parameters:
     number (float) : Number to truncate
     decimals (int) : Decimal places to cut down to
  Returns: The input number, but as a string truncated to X decimals
 getPipSize(multiplier) 
  Calculates the pip size of the current market.
  Parameters:
     multiplier (int) : The mintick point multiplier (1 by default, 10 for FX/Crypto/CFD but can be used to override when certain markets require)
  Returns: The pip size for the current market
 toWhole(number) 
  Converts pips into whole numbers. Required params: number.
  Parameters:
     number (float) : The pip number to convert into a whole number
  Returns: The converted number
 toPips(number) 
  Converts whole numbers back into pips. Required params: number.
  Parameters:
     number (float) : The whole number to convert into pips
  Returns: The converted number
 debug(txt, tooltip, displayLabel) 
  Prints to console and generates a debug label with the given text. Required params: txt.
  Parameters:
     txt (string) : Text to display
     tooltip (string) : Tooltip to display (optional)
     displayLabel (bool) : Turns on/off chart label (default: off)
  Returns: Nothing
 order(licenseID, command, symbol, parameters, accfilter, comment, secret, freq, debug) 
  Generates an alert string. Required params: licenseID, command.
  Parameters:
     licenseID (string) : Your PC license ID
     command (string) : Command to send
     symbol (string) : The symbol to trigger this order on
     parameters (string) : Other optional parameters to include
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: An alert string with valid PC syntax based on supplied parameters
 market_order(licenseID, buy, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Generates a market entry alert with relevant syntax commands. Required params: licenseID, buy, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     buy (bool) : true=buy/long, false=sell/short
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A market order alert string with valid PC syntax based on supplied parameters
 buy(licenseID, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Generates a market buy alert with relevant syntax commands. Required params: licenseID, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A market order alert string with valid PC syntax based on supplied parameters
 sell(licenseID, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Generates a market sell alert with relevant syntax commands. Required params: licenseID, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A market order alert string with valid PC syntax based on supplied parameters
 closeall(licenseID, comment, secret, freq, debug) 
  Closes all open trades at market regardless of symbol. Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 closealleaoff(licenseID, comment, secret, freq, debug) 
  Closes all open trades at market regardless of symbol, and turns the EA off. Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 closelong(licenseID, symbol, comment, secret, freq, debug) 
  Closes all long trades at market for the given symbol. Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     symbol (string) : Symbol to act on (defaults to current symbol)
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 closeshort(licenseID, symbol, comment, secret, freq, debug) 
  Closes all open short trades at market for the given symbol. Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     symbol (string) : Symbol to act on (defaults to current symbol)
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 closelongshort(licenseID, symbol, comment, secret, freq, debug) 
  Closes all open trades at market for the given symbol. Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     symbol (string) : Symbol to act on (defaults to current symbol)
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 closelongbuy(licenseID, risk, symbol, comment, secret, freq, debug) 
  Close all long positions and open a new long at market for the given symbol with given risk/contracts. Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     risk (float) : Risk or contracts (according to EA settings)
     symbol (string) : Symbol to act on (defaults to current symbol)
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 closeshortsell(licenseID, risk, symbol, comment, secret, freq, debug) 
  Close all short positions and open a new short at market for the given symbol with given risk/contracts. Required params: licenseID, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     risk (float) : Risk or contracts (according to EA settings)
     symbol (string) : Symbol to act on (defaults to current symbol)
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 newsltplong(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug) 
  Updates the stop loss and/or take profit of any open long trades on the given symbol with the given values. Required params: licenseID, sl and/or tp.
  Parameters:
     licenseID (string) : Your PC license ID
     sl (float) : Stop loss pips or price (according to EA settings)
     tp (float) : Take profit pips or price (according to EA settings)
     symbol (string) : Symbol to act on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 newsltpshort(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug) 
  Updates the stop loss and/or take profit of any open short trades on the given symbol with the given values. Required params: licenseID, sl and/or tp.
  Parameters:
     licenseID (string) : Your PC license ID
     sl (float) : Stop loss pips or price (according to EA settings)
     tp (float) : Take profit pips or price (according to EA settings)
     symbol (string) : Symbol to act on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 closelongpct(licenseID, symbol, comment, secret, freq, debug) 
  Close a percentage of open long positions (according to EA settings). Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     symbol (string) : Symbol to act on (defaults to current symbol)
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 closeshortpct(licenseID, symbol, comment, secret, freq, debug) 
  Close a percentage of open short positions (according to EA settings). Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     symbol (string) : Symbol to act on (defaults to current symbol)
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 closelongvol(licenseID, risk, symbol, comment, secret, freq, debug) 
  Close all open long contracts on the current symbol until the given risk value is remaining. Required params: licenseID, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     risk (float) : The quantity to leave remaining
     symbol (string) : Symbol to act on (defaults to current symbol)
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 closeshortvol(licenseID, risk, symbol, comment, secret, freq, debug) 
  Close all open short contracts on the current symbol until the given risk value is remaining. Required params: licenseID, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     risk (float) : The quantity to leave remaining
     symbol (string) : Symbol to act on (defaults to current symbol)
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 limit_order(licenseID, buy, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Generates a limit order alert with relevant syntax commands. Required params: licenseID, buy, price, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     buy (bool) : true=buy/long, false=sell/short
     price (float) : Price or pips to set limit order (according to EA settings)
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A limit order alert string with valid PC syntax based on supplied parameters
 buylimit(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Generates a buylimit order alert with relevant syntax commands. Required params: licenseID, price, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     price (float) : Price or pips to set limit order (according to EA settings)
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A limit order alert string with valid PC syntax based on supplied parameters
 selllimit(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Generates a selllimit order alert with relevant syntax commands. Required params: licenseID, price, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     price (float) : Price or pips to set limit order (according to EA settings)
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A limit order alert string with valid PC syntax based on supplied parameters
 stop_order(licenseID, buy, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Generates a stop order alert with relevant syntax commands. Required params: licenseID, buy, price, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     buy (bool) : true=buy/long, false=sell/short
     price (float) : Price or pips to set limit order (according to EA settings)
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A stop order alert string with valid PC syntax based on supplied parameters
 buystop(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Generates a buystop order alert with relevant syntax commands. Required params: licenseID, price, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     price (float) : Price or pips to set limit order (according to EA settings)
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A stop order alert string with valid PC syntax based on supplied parameters
 sellstop(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Generates a sellstop order alert with relevant syntax commands. Required params: licenseID, price, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     price (float) : Price or pips to set limit order (according to EA settings)
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A stop order alert string with valid PC syntax based on supplied parameters
 cancel_neworder(licenseID, order, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Cancel + place new order template function.
  Parameters:
     licenseID (string) : Your PC license ID
     order (string) : Cancel order type
     price (float) : Price or pips to set limit order (according to EA settings)
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A stop order alert string with valid PC syntax based on supplied parameters
 cancellongbuystop(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Cancels all long orders with the specified symbol and places a new buystop order. Required params: licenseID, price, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     price (float) : Price or pips to set limit order (according to EA settings)
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A stop order alert string with valid PC syntax based on supplied parameters
 cancellongbuylimit(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Cancels all long orders with the specified symbol and places a new buylimit order. Required params: licenseID, price, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     price (float) : Price or pips to set limit order (according to EA settings)
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A stop order alert string with valid PC syntax based on supplied parameters
 cancelshortsellstop(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Cancels all short orders with the specified symbol and places a sellstop order. Required params: licenseID, price, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     price (float) : Price or pips to set limit order (according to EA settings)
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A stop order alert string with valid PC syntax based on supplied parameters
 cancelshortselllimit(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Cancels all short orders with the specified symbol and places a selllimit order. Required params: licenseID, price, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     price (float) : Price or pips to set limit order (according to EA settings)
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A stop order alert string with valid PC syntax based on supplied parameters
 cancellong(licenseID, symbol, accfilter, comment, secret, freq, debug) 
  Cancels all pending long orders with the specified symbol. Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     symbol (string) : Symbol to act on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A cancel long alert command
 cancelshort(licenseID, symbol, accfilter, comment, secret, freq, debug) 
  Cancels all pending short orders with the specified symbol. Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     symbol (string) : Symbol to act on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A cancel short alert command
 newsltpbuystop(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug) 
  Updates the stop loss and/or take profit of any pending buy stop orders on the given symbol. Required params: licenseID, sl and/or tp.
  Parameters:
     licenseID (string) : Your PC license ID
     sl (float) : Stop loss pips or price (according to EA settings)
     tp (float) : Take profit pips or price (according to EA settings)
     symbol (string) : Symbol to act on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 newsltpbuylimit(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug) 
  Updates the stop loss and/or take profit of any pending buy limit orders on the given symbol. Required params: licenseID, sl and/or tp.
  Parameters:
     licenseID (string) : Your PC license ID
     sl (float) : Stop loss pips or price (according to EA settings)
     tp (float) : Take profit pips or price (according to EA settings)
     symbol (string) : Symbol to act on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 newsltpsellstop(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug) 
  Updates the stop loss and/or take profit of any pending sell stop orders on the given symbol. Required params: licenseID, sl and/or tp.
  Parameters:
     licenseID (string) : Your PC license ID
     sl (float) : Stop loss pips or price (according to EA settings)
     tp (float) : Take profit pips or price (according to EA settings)
     symbol (string) : Symbol to act on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 newsltpselllimit(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug) 
  Updates the stop loss and/or take profit of any pending sell limit orders on the given symbol. Required params: licenseID, sl and/or tp.
  Parameters:
     licenseID (string) : Your PC license ID
     sl (float) : Stop loss pips or price (according to EA settings)
     tp (float) : Take profit pips or price (according to EA settings)
     symbol (string) : Symbol to act on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 eaoff(licenseID, secret, freq, debug) 
  Turns the EA off. Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 eaon(licenseID, secret, freq, debug) 
  Turns the EA on. Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
VN30 Effort-vs-Result Multi-Scanner — LinhVN30 Effort-vs-Result Multi-Scanner (Pine v5)
Cross-section scanner for Vietnam’s VN30 stocks that surfaces Effort vs Result footprints and related accumulation/distribution and volatility tells. It renders a ranked table (Top-N) with per-ticker signals and key metrics.
What it does
    Scans up to 30 tickers (editable input.symbol slots) using one security() call per symbol → stays under Pine’s 40-call limit and runs reliably on any chart.
    Scores each ticker by counting active signals, then ranks and lists the top names.
    Optional metrics columns: zVol(60), zTR(60), ATR(20), HL/ATR(20).
Signals (toggleable)
Price/Volume – Effort vs Result
    EVR Squeeze (stealth): z(Vol,60) > 4 & z(TR,60) < −0.5
    5σ Vol, ≤1σ Ret: z(Vol,60) > 5 & |z(Return,60)| < 1
    Wide Effort, Opposite Result: z(Vol,60) > 3 & close < open & z(CLV×Vol,60) > 1
    Spread Compression, Heavy Tape: (H−L)/ATR(20) < 0.6 & z(Vol,60) > 3
    No-Supply / No-Demand: close < close  & range < 0.6×ATR(20) & vol < 0.5×SMA(20)
Momentum & Volatility
    Vol-of-Vol Kink: z(ATR20,200) rising & z(ATR5,60) falling
    BB Squeeze → Expansion: BBWidth(20) in low regime (z<−1.3) then close > upper band & z(Vol,60) > 2
    RSI Non-Confirmation: Price LL/HH with RSI HL/LH & z(Vol,60) > 1
Accumulation/Distribution
    OBV Divergence w/ Flat Price: OBV slope > 0 & |z(ret20,260)| < 0.3
    Accumulation Days Cluster: ≥3/5 bars: up close, higher vol, close near high
    Effort-Result Inversion (Down): big vol on down day then next day close > prior high
How to use
    Set the timeframe (works best on 1D for EOD scans).
    Edit the 30 symbol slots to your VN30 constituents.
    Choose Top N, toggle Show metrics/Only matches and enable/disable scenarios.
    Read the table: Rank, Ticker, (metrics), Score, and comma-separated Signals fired.
Method notes
    Z-scores use a population-std estimate; CLV×Vol is used for effort/location.
    Rolling counts avoid ta.sum; OBV is computed manually; all logic is Pine v5-safe.
    Intraday-only ideas (true VWAP magnets, auction volume, flows, futures/options) are not included—Pine can’t cross-scan those datasets.
Disclaimer: Educational tool, not financial advice. Always confirm signals on the chart and with your process.
RSI mura visionOverview
 
The Enhanced RSI with Custom 40/60 Zones is a Pine Script™ v6 open-source indicator that builds on the classic Relative Strength Index by adding two additional horizontal levels at 40 and 60, alongside the standard 30/70. These extra zones help you identify early momentum shifts and distinguish trending markets from ranging ones with greater precision.
 Key Features & Originality 
* Custom Mid-Zones (40/60): Standard RSI signals can be noisy around the 50 midpoint. By marking 40 as a “weak momentum” threshold and 60 as a “strong momentum” confirmation, you get clearer entry and exit cues.
* Color-Coded Zones: The RSI line changes color when crossing 40, 50, 60, 70, and 30, letting you visually spot momentum acceleration or deceleration.
* Configurable Alerts: Built-in alert conditions fire when RSI crosses 40 or 60 in either direction, so you never miss a potential trend onset or exhaustion.
* Lightweight & Clean: No external dependencies, no look-ahead bias, and minimal repainting—ideal for both novice and professional traders.
 How It Works 
1. Momentum Decomposition: The standard 14-period RSI measures overbought/oversold extremes. Adding 40/60 lets you see when momentum shifts from neutral to bullish (crossing above 60) or bearish (dropping below 40) earlier than the classic 70/30 thresholds.
2. Trend Confirmation vs. Pullbacks: Readings between 40–60 often correspond to healthy pullbacks within a trend. A bounce off 40 suggests continuation; a rejection at 60 warns of a deeper pullback or reversal.
 Usage & Inputs 
* RSI Length (default 14): Period for calculating RSI.
* Level Inputs: Customize levels for overbought (70), support (60), neutral (50), weak (40), and oversold (30).
* Alert Toggles: Enable/disable alerts on each cross.
 Why This Adds Value 
* Early Signals: Capture trend beginnings before the market reaches extreme overbought/oversold levels.
* Noise Reduction: Filter sideways chop by watching the 40–60 corridor.
* Flexibility: Works on any timeframe or ticker.
Pine Script™ Version: v6
Open-Source License: MPL-2.0
Feel free to fork, modify, and share.
多周期趋势动量面板加强版(Multi-Timeframe Trend Momentum Panel - User Guide)多周期趋势动量面板(Multi-Timeframe Trend Momentum Panel - User Guide)(english explanation follows.)
📖 指标功能详解 (精简版):
🎯 核心功能:
1. 多周期趋势分析 同时监控8个时间周期(1m/5m/15m/1H/4H/D/W/M)
2. 4维度投票系统 MA趋势+RSI动量+MACD+布林带综合判断
3. 全球交易时段 可视化亚洲/伦敦/纽约交易时间
4. 趋势强度评分 0100%量化市场力量
5. 智能警报 强势多空信号自动推送
________________________________________
📚 重要名词解释:
🔵 趋势状态 (MA均线分析):
名词 含义 信号强度
强势多头 快MA远高于慢MA(差值≥0.35%) ⭐⭐⭐⭐⭐ 做多
多头倾向 快MA略高于慢MA(差值<0.35%) ⭐⭐⭐ 谨慎做多
震荡 快慢MA缠绕,无明确方向 ⚠️ 观望
空头倾向 快MA略低于慢MA ⭐⭐⭐ 谨慎做空
强势空头 快MA远低于慢MA ⭐⭐⭐⭐⭐ 做空
简单理解: 快MA就像短跑运动员(反应快),慢MA是长跑运动员(稳定)。短跑远超长跑=强势多头,反之=强势空头。
________________________________________
🟠 动量状态 (RSI力度分析):
名词 含义 操作建议
动量上攻↗ RSI>60且快速上升 强烈买入信号
动量高位 RSI>60但上升变慢 警惕回调,可减仓
动量中性 RSI在4060之间,平稳 等待方向明确
动量低位 RSI<40但下跌变慢 警惕反弹,可止盈
动量下压↘ RSI<40且快速下降 强烈卖出信号
简单理解: RSI就像汽车速度表。"动量上攻"=油门踩到底加速,"动量高位"=已经很快但不再加速了。
________________________________________
🟣 辅助信号:
MACD:
• MACD多头 = 柱状图>0 = 买方力量强
• MACD空头 = 柱状图<0 = 卖方力量强
布林带(BB):
• BB超买 = 价格在布林带上轨附近 = 可能回调
• BB超卖 = 价格在布林带下轨附近 = 可能反弹
• BB中轨 = 价格在中间位置 = 平衡状态
________________________________________
💡 快速上手 3步看懂面板:
第1步: 看"综合结论标签" (K线上方)
• 绿色"多头占优" → 可以做多
• 红色"空头占优" → 可以做空
• 橙色"震荡/均衡" → 观望
第2步: 看"票数 多/空" (面板最下方)
• 多头票数远大于空头 (差距>2) → 趋势强
• 票数接近 (差距<1) → 震荡市
第3步: 看"趋势强度" (综合标签中)
• 强度>70% → 强势趋势,可重仓
• 强度5070% → 中等趋势,正常仓位
• 强度<50% → 弱势,轻仓或观望
________________________________________
🎨 时段背景色含义:
• 紫色背景 = 亚洲时段 (东京交易时间) 波动较小
• 橙色背景 = 伦敦时段 (欧洲交易时间) 波动增大
• 蓝色背景 = 纽约凌晨 美盘准备阶段
• 红色背景 = 纽约关键5分钟 (09:3009:35) ⚠️ 最重要! 市场最活跃,趋势易形成
• 绿色背景 = 纽约上午后段 延续早盘趋势
交易建议: 重点关注红色关键时段,这5分钟往往决定全天方向!
________________________________________
⚙️ 三大市场推荐设置
🥇 黄金: Hull MA 12/EMA 34, 阈值0.250.35%
₿ 比特币: EMA 21/EMA 55, 阈值0.801.20%
💎 以太坊: TEMA 21/EMA 55, 阈值0.600.80%
参数优化建议
黄金 (XAUUSD)
快速MA: Hull MA 12 (超灵敏捕捉黄金快速波动)
慢速MA: EMA 34 (斐波那契数列)
RSI周期: 9 (加快反应)
强趋势阈值: 0.25%
周期: 5, 15, 60, 240, 1440
比特币 (BTCUSD)
快速MA: EMA 21
慢速MA: EMA 55
RSI周期: 14
强趋势阈值: 0.8% (波动大,阈值需提高)
周期: 15, 60, 240, D, W
外汇 EUR/USD
快速MA: TEMA 10 (快速响应)
慢速MA: T3 30, 因子0.7 (平滑噪音)
RSI周期: 14
强趋势阈值: 0.08% (外汇波动小)
周期: 5, 15, 60, 240, 1440
📖 Indicator Function Details (Concise Version):
🎯 Core Functions:
1. MultiTimeframe Trend Analysis Monitors 8 timeframes simultaneously (1m/5m/15m/1H/4H/D/W/M)
2. 4Dimensional Voting System Comprehensive judgment based on MA trend + RSI momentum + MACD + Bollinger Bands
3. Global Trading Sessions Visualizes Asia/London/New York trading hours
4. Trend Strength Score Quantifies market strength from 0100%
5. Smart Alerts Automatically pushes strong bullish/bearish signals
📚 Key Term Explanations:
🔵 Trend Status (MA Analysis):
| Term | Meaning | Signal Strength |
| | | |
| Strong Bull | Fast MA significantly > Slow MA (Diff ≥0.35%) | ⭐⭐⭐⭐⭐ Long |
| Bullish Bias | Fast MA slightly > Slow MA (Diff <0.35%) | ⭐⭐⭐ Caution Long |
| Ranging | MAs intertwined, no clear direction | ⚠️ Wait & See |
| Bearish Bias | Fast MA slightly < Slow MA | ⭐⭐⭐ Caution Short |
| Strong Bear | Fast MA significantly < Slow MA | ⭐⭐⭐⭐⭐ Short |
Simple Understanding: Fast MA = sprinter (fast reaction), Slow MA = longdistance runner (stable). Sprinter far ahead = Strong Bull, opposite = Strong Bear.
🟠 Momentum Status (RSI Analysis):
| Term | Meaning | Trading Suggestion |
| | | |
| Momentum Up ↗ | RSI >60 & rising rapidly | Strong Buy Signal |
| Momentum High | RSI >60 but rising slower | Watch for pullback, consider reducing position |
| Momentum Neutral | RSI between 4060, stable | Wait for clearer direction |
| Momentum Low | RSI <40 but falling slower | Watch for rebound, consider taking profit |
| Momentum Down ↘ | RSI <40 & falling rapidly | Strong Sell Signal |
Simple Understanding: RSI = car speedometer. "Momentum Up" = full throttle acceleration, "Momentum High" = already fast but not accelerating further.
🟣 Auxiliary Signals:
MACD:
MACD Bullish = Histogram >0 = Strong buyer power
MACD Bearish = Histogram <0 = Strong seller power
Bollinger Bands (BB):
BB Overbought = Price near upper band = Possible pullback
BB Oversold = Price near lower band = Possible rebound
BB Middle = Price near middle band = Balanced state
💡 Quick Start 3 Steps to Understand the Panel:
Step 1: Check "Composite Conclusion Label" (Above the chart)
Green "Bulls Favored" → Consider Long
Red "Bears Favored" → Consider Short
Orange "Ranging/Balanced" → Wait & See
Step 2: Check "Votes Bull/Bear" (Bottom of the panel)
Bull votes significantly > Bear votes (Difference >2) → Strong Trend
Votes close (Difference <1) → Ranging Market
Step 3: Check "Trend Strength" (In the composite label)
Strength >70% → Strong Trend, consider heavier position
Strength 5070% → Moderate Trend, normal position size
Strength <50% → Weak Trend, light position or wait & see
🎨 Trading Session Background Color Meanings:
Purple = Asian Session (Tokyo hours) Lower volatility
Orange = London Session (European hours) Increased volatility
Blue = NY Early Morning US session preparation phase
Red = NY Critical 5 Minutes (09:3009:35) ⚠️ Most Important! Market most active, trends easily form
Green = NY Late Morning Continuation of early session trend
Trading Tip: Focus on the red critical period; these 5 minutes often determine the day's direction!
⚙️ Recommended Settings for Three Major Markets
🥇 Gold (XAUUSD):
Fast MA: Hull MA 12 (Highly sensitive for gold's fast moves)
Slow MA: EMA 34 (Fibonacci number)
RSI Period: 9 (Faster reaction)
Strong Trend Threshold: 0.25%
Timeframes: 5, 15, 60, 240, 1440
₿ Bitcoin (BTCUSD):
Fast MA: EMA 21
Slow MA: EMA 55
RSI Period: 14
Strong Trend Threshold: 0.8% (High volatility, requires higher threshold)
Timeframes: 15, 60, 240, D, W
💎 Ethereum (ETHUSD):
Fast MA: TEMA 21
Slow MA: EMA 55
RSI Period: 14
Strong Trend Threshold: 0.600.80%
Timeframes: 15, 60, 240, D, W
💱 Forex EUR/USD:
Fast MA: TEMA 10 (Fast response)
Slow MA: T3 30, Factor 0.7 (Smooths noise)
RSI Period: 14
Strong Trend Threshold: 0.08% (Forex has low volatility)
Timeframes: 5, 15, 60, 240, 1440
多周期趋势动量面板(Multi-Timeframe Trend Momentum Panel - User Guide)多周期趋势动量面板(Multi-Timeframe Trend Momentum Panel - User Guide)(english explanation follows.)
📖 指标功能详解 (精简版):
🎯 核心功能:
1.	多周期趋势分析  同时监控8个时间周期(1m/5m/15m/1H/4H/D/W/M)
2.	4维度投票系统  MA趋势+RSI动量+MACD+布林带综合判断
3.	全球交易时段  可视化亚洲/伦敦/纽约交易时间
4.	趋势强度评分  0100%量化市场力量
5.	智能警报  强势多空信号自动推送
________________________________________
📚 重要名词解释:
🔵 趋势状态 (MA均线分析):
名词	含义	信号强度
强势多头	快MA远高于慢MA(差值≥0.35%)	⭐⭐⭐⭐⭐ 做多
多头倾向	快MA略高于慢MA(差值<0.35%)	⭐⭐⭐ 谨慎做多
震荡	快慢MA缠绕,无明确方向	⚠️ 观望
空头倾向	快MA略低于慢MA	⭐⭐⭐ 谨慎做空
强势空头	快MA远低于慢MA	⭐⭐⭐⭐⭐ 做空
简单理解: 快MA就像短跑运动员(反应快),慢MA是长跑运动员(稳定)。短跑远超长跑=强势多头,反之=强势空头。
________________________________________
🟠 动量状态 (RSI力度分析):
名词	含义	操作建议
动量上攻↗	RSI>60且快速上升	强烈买入信号
动量高位	RSI>60但上升变慢	警惕回调,可减仓
动量中性	RSI在4060之间,平稳	等待方向明确
动量低位	RSI<40但下跌变慢	警惕反弹,可止盈
动量下压↘	RSI<40且快速下降	强烈卖出信号
简单理解: RSI就像汽车速度表。"动量上攻"=油门踩到底加速,"动量高位"=已经很快但不再加速了。
________________________________________
🟣 辅助信号:
MACD:
•	MACD多头 = 柱状图>0 = 买方力量强
•	MACD空头 = 柱状图<0 = 卖方力量强
布林带(BB):
•	BB超买 = 价格在布林带上轨附近 = 可能回调
•	BB超卖 = 价格在布林带下轨附近 = 可能反弹
•	BB中轨 = 价格在中间位置 = 平衡状态
________________________________________
💡 快速上手  3步看懂面板:
第1步: 看"综合结论标签" (K线上方)
•	绿色"多头占优" → 可以做多
•	红色"空头占优" → 可以做空
•	橙色"震荡/均衡" → 观望
第2步: 看"票数 多/空" (面板最下方)
•	多头票数远大于空头 (差距>2) → 趋势强
•	票数接近 (差距<1) → 震荡市
第3步: 看"趋势强度" (综合标签中)
•	强度>70% → 强势趋势,可重仓
•	强度5070% → 中等趋势,正常仓位
•	强度<50% → 弱势,轻仓或观望
________________________________________
🎨 时段背景色含义:
•	紫色背景 = 亚洲时段 (东京交易时间)  波动较小
•	橙色背景 = 伦敦时段 (欧洲交易时间)  波动增大
•	蓝色背景 = 纽约凌晨  美盘准备阶段
•	红色背景 = 纽约关键5分钟 (09:3009:35) ⚠️ 最重要! 市场最活跃,趋势易形成
•	绿色背景 = 纽约上午后段  延续早盘趋势
交易建议: 重点关注红色关键时段,这5分钟往往决定全天方向!
________________________________________
⚙️ 三大市场推荐设置
🥇 黄金: Hull MA 12/EMA 34, 阈值0.250.35%
₿ 比特币: EMA 21/EMA 55, 阈值0.801.20%
💎 以太坊: TEMA 21/EMA 55, 阈值0.600.80%
 参数优化建议
 黄金 (XAUUSD)
快速MA: Hull MA 12 (超灵敏捕捉黄金快速波动)
慢速MA: EMA 34 (斐波那契数列)
RSI周期: 9 (加快反应)
强趋势阈值: 0.25%
周期: 5, 15, 60, 240, 1440
 比特币 (BTCUSD)
快速MA: EMA 21
慢速MA: EMA 55
RSI周期: 14
强趋势阈值: 0.8% (波动大,阈值需提高)
周期: 15, 60, 240, D, W
 外汇 EUR/USD
快速MA: TEMA 10 (快速响应)
慢速MA: T3 30, 因子0.7 (平滑噪音)
RSI周期: 14
强趋势阈值: 0.08% (外汇波动小)
周期: 5, 15, 60, 240, 1440
📖 Indicator Function Details (Concise Version):
🎯 Core Functions:
1.  MultiTimeframe Trend Analysis  Monitors 8 timeframes simultaneously (1m/5m/15m/1H/4H/D/W/M)
2.  4Dimensional Voting System  Comprehensive judgment based on MA trend + RSI momentum + MACD + Bollinger Bands
3.  Global Trading Sessions  Visualizes Asia/London/New York trading hours
4.  Trend Strength Score  Quantifies market strength from 0100%
5.  Smart Alerts  Automatically pushes strong bullish/bearish signals
📚 Key Term Explanations:
🔵 Trend Status (MA Analysis):
| Term             | Meaning                                      | Signal Strength        |
|  |  |  |
| Strong Bull      | Fast MA significantly > Slow MA (Diff ≥0.35%)  | ⭐⭐⭐⭐⭐ Long       |
| Bullish Bias     | Fast MA slightly > Slow MA (Diff <0.35%)       | ⭐⭐⭐ Caution Long   |
| Ranging          | MAs intertwined, no clear direction          | ⚠️ Wait & See        |
| Bearish Bias     | Fast MA slightly < Slow MA                   | ⭐⭐⭐ Caution Short |
| Strong Bear      | Fast MA significantly < Slow MA              | ⭐⭐⭐⭐⭐ Short      |
Simple Understanding: Fast MA = sprinter (fast reaction), Slow MA = longdistance runner (stable). Sprinter far ahead = Strong Bull, opposite = Strong Bear.
🟠 Momentum Status (RSI Analysis):
| Term               | Meaning                            | Trading Suggestion                  |
|  |  |  |
| Momentum Up ↗      | RSI >60 & rising rapidly           | Strong Buy Signal                   |
| Momentum High      | RSI >60 but rising slower          | Watch for pullback, consider reducing position |
| Momentum Neutral   | RSI between 4060, stable          | Wait for clearer direction          |
| Momentum Low       | RSI <40 but falling slower         | Watch for rebound, consider taking profit |
| Momentum Down ↘    | RSI <40 & falling rapidly          | Strong Sell Signal                  |
Simple Understanding: RSI = car speedometer. "Momentum Up" = full throttle acceleration, "Momentum High" = already fast but not accelerating further.
🟣 Auxiliary Signals:
MACD:
 MACD Bullish = Histogram >0 = Strong buyer power
 MACD Bearish = Histogram <0 = Strong seller power
Bollinger Bands (BB):
 BB Overbought = Price near upper band = Possible pullback
 BB Oversold = Price near lower band = Possible rebound
 BB Middle = Price near middle band = Balanced state
💡 Quick Start  3 Steps to Understand the Panel:
Step 1: Check "Composite Conclusion Label" (Above the chart)
 Green "Bulls Favored" → Consider Long
 Red "Bears Favored" → Consider Short
 Orange "Ranging/Balanced" → Wait & See
Step 2: Check "Votes Bull/Bear" (Bottom of the panel)
 Bull votes significantly > Bear votes (Difference >2) → Strong Trend
 Votes close (Difference <1) → Ranging Market
Step 3: Check "Trend Strength" (In the composite label)
 Strength >70% → Strong Trend, consider heavier position
 Strength 5070% → Moderate Trend, normal position size
 Strength <50% → Weak Trend, light position or wait & see
🎨 Trading Session Background Color Meanings:
 Purple = Asian Session (Tokyo hours)  Lower volatility
 Orange = London Session (European hours)  Increased volatility
 Blue = NY Early Morning  US session preparation phase
 Red = NY Critical 5 Minutes (09:3009:35) ⚠️ Most Important! Market most active, trends easily form
 Green = NY Late Morning  Continuation of early session trend
Trading Tip: Focus on the red critical period; these 5 minutes often determine the day's direction!
⚙️ Recommended Settings for Three Major Markets
🥇 Gold (XAUUSD):
 Fast MA: Hull MA 12 (Highly sensitive for gold's fast moves)
 Slow MA: EMA 34 (Fibonacci number)
 RSI Period: 9 (Faster reaction)
 Strong Trend Threshold: 0.25%
 Timeframes: 5, 15, 60, 240, 1440
₿ Bitcoin (BTCUSD):
 Fast MA: EMA 21
 Slow MA: EMA 55
 RSI Period: 14
 Strong Trend Threshold: 0.8% (High volatility, requires higher threshold)
 Timeframes: 15, 60, 240, D, W
💎 Ethereum (ETHUSD):
 Fast MA: TEMA 21
 Slow MA: EMA 55
 RSI Period: 14
 Strong Trend Threshold: 0.600.80%
 Timeframes: 15, 60, 240, D, W
💱 Forex EUR/USD:
 Fast MA: TEMA 10 (Fast response)
 Slow MA: T3 30, Factor 0.7 (Smooths noise)
 RSI Period: 14
 Strong Trend Threshold: 0.08% (Forex has low volatility)
 Timeframes: 5, 15, 60, 240, 1440
Chuck Dukas Market Phases of Trends (based on 2 Moving Averages)This script is based on the article “Defining The Bull And The Bear” by Chuck Duckas, published in Stocks & Commodities V. 25:13 (14-22); (S&C Bonus Issue, 2007).
The article “Defining The Bull And The Bear” discusses the concepts of “bullish” and “bearish” in relation to the price behavior of financial instruments. Chuck Dukas explains the importance of analyzing price trends and provides a framework for categorizing price activity into six phases. These phases, including recovery, accumulation, bullish, warning, distribution, and bearish, help to assess the quality of the price structure and guide decision-making in trading. Moving averages are used as tools for determining the context preceding the current price action, and the slope of a moving average is seen as an indicator of trend and price phase analysis.
 The six phases of trends 
 // Definitions of Market Phases
recovery_phase = src > ma050 and src < ma200 and ma050 < ma200 // color: blue
accumulation_phase = src > ma050 and src > ma200 and ma050 < ma200 // color: purple
bullish_phase = src > ma050 and src > ma200 and ma050 > ma200 // color: green
warning_phase = src < ma050 and src > ma200 and ma050 > ma200 // color: yellow
distribution_phase = src < ma050 and src < ma200 and ma050 > ma200 // color: orange
bearish_phase = src < ma050 and src < ma200 and ma050 < ma200 // color red 
 
 Recovery Phase : This phase marks the beginning of a new trend after a period of consolidation or downtrend. It is characterized by the gradual increase in prices as the market starts to recover from previous losses.
 Accumulation Phase : In this phase, the market continues to build a base as prices stabilize before making a significant move. It is a period of consolidation where buying and selling are balanced.
 Bullish Phase : The bullish phase indicates a strong upward trend in prices with higher highs and higher lows. It is a period of optimism and positive sentiment in the market.
 Warning Phase : This phase occurs when the bullish trend starts to show signs of weakness or exhaustion. It serves as a cautionary signal to traders and investors that a potential reversal or correction may be imminent.
 Distribution Phase : The distribution phase is characterized by the market topping out as selling pressure increases. It is a period where supply exceeds demand, leading to a potential shift in trend direction.
 Bearish Phase : The bearish phase signifies a strong downward trend in prices with lower lows and lower highs. It is a period of pessimism and negative sentiment in the market.
 
These rules of the six phases outline the cyclical nature of market trends and provide traders with a framework for understanding and analyzing price behavior to make informed trading decisions based on the current market phase.
 60-period channel 
The 60-period channel should be applied differently in each phase of the market cycle.
 
 Recovery Phase : In this phase, the 60-period channel can help identify the beginning of a potential uptrend as price stabilizes or improves. Traders can look for new highs frequently in the 60-period channel to confirm the trend initiation or continuation.
 Accumulation Phase : During the accumulation phase, the 60-period channel can highlight that the current price is sufficiently strong to be above recent price and longer-term price. Traders may observe new highs frequently in the 60-period channel as the slope of the 50-period moving average (SMA) trends upwards while the 200-period moving average (SMA) slope is losing its downward slope.
 Bullish Phase : In the bullish phase, the 60-period channel showing a series of higher highs is crucial for confirming the uptrend. Additionally, traders should observe an upward-sloping 50-period SMA above an upward-sloping 200-period SMA for further validation of the bullish phase.
 Warning Phase : When in the warning phase, the 60-period channel can provide insights into whether the current price is weaker than recent prices. Traders should pay attention to the relationship between the price close, the 50-period SMA, and the 200-period SMA to gauge the strength of the phase.
 Distribution Phase : In the distribution phase, traders should look for new lows frequently in the 60-period channel, hinting at a weakening trend. It is crucial to observe that the 50-period SMA is still above the 200-period SMA in this phase.
 Bearish Phase : Lastly, in the bearish phase, the 60-period channel reflecting a series of lower lows confirms the downtrend. Traders should also note that the price close is below both the 50-period SMA and the 200-period SMA, with the relationship of the 50-period SMA being less than the 200-period SMA.
 
By carefully analyzing the 60-period channel in each phase, traders can better understand market trends and make informed decisions regarding their investments.
USD Session 8FX - LDN & NY (TF-invariant, Live + Table)What changed
Flexible session window
Removed the old fixed NY end-time selector.
Added new inputs so you can pick start time and length:
London: ldnStartSel (default 08:00) and ldnLenSel with options 45/60/90 minutes.
New York: nyStartSel (default 15:30) and nyLenSel with options 45/60/90 minutes.
The session string used by time(refTF, sess, tz) is now built dynamically as "HHMM-HHMM" from start + length (e.g., 1530-1630).
The label shown in the table (winTxt) auto-formats to HH:MM–HH:MM.
New time helpers
addMinutesHHMM() computes the end time from a "HHMM" start plus a minute length.
makeSess() produces the session string "HHMM-HHMM".
prettySess() converts "HHMM-HHMM" → "HH:MM-HH:MM".
(Kept on one line to avoid the “end of line without line continuation” error.)
Stability & UI fixes
Main table now uses table.new(f_pos(tablePos), ...) directly (no undeclared pos variable).
Trade Gate panel uses a properly initialized gatePosEnum before table.new(...) (fixes “Undeclared identifier”).
Minor cleanups; no logic changes.
What did NOT change
Scoring logic: returns → optional ATR normalization → weights → anti-USD vs USD-base averages → final score.
Thresholds: minAbsScore and live intrath alerts are unchanged.
VWAP Gate logic is the same (price vs VWAP consistency depending on USD Strong/Weak).
Freeze/Lock of values at session end is unchanged.
Alerts (session close bias, live threshold cross, and “Entry hint”) are unchanged.
Why this helps (practical impact)
Longer windows (e.g., NY 60/90, LDN 60/90) usually make the score more robust, filtering noise and reducing false signals—at the cost of a slightly slower signal.
You can now A/B test:
London: 45 vs 60 vs 90
New York: 45 vs 60 vs 90
without touching anything else; the indicator adapts automatically.
How to use
Choose Session (London / New York).
Set the start and length for that session.
The background highlight, the winTxt, and the entry/exit logic all follow the dynamic window.
Quick tips to reduce false signals
Try NY 60 or NY 90 and LDN 60 when volatility is choppy.
Keep ATR normalization ON (useATRnorm = true) for more comparable returns.
Consider raising minAbsScore slightly (e.g., from 0.12 → 0.15–0.20) if you still see noise.
Use the VWAP Gate panel: only act when Bias OK and at least one of the Top-3 pairs shows VWAP OK.
If you want, I can add quick presets (buttons) to jump between LDN 45/60/90 and NY 45/60/90, or plot two Scores side by side for direct comparison.






















