本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © AYEHAN
//@version=6
// @description Cryptonian Elliott Wave Language /1. Trader-facing terminology normalization. Internal development/state identifiers remain unchanged; this library maps them to standard Elliott Wave wording for panels, labels, tooltips and alerts.
library("CryptonianEWLanguage", overlay = true)
// Standard Elliott degree names.
export degreeName(string raw) =>
string result = raw
if raw == "PRIMARY"
result := "PRIMARY"
else if raw == "SECONDARY"
result := "INTERMEDIATE"
else if raw == "SUB-SECONDARY"
result := "SECONDARY"
result
// Forecast wave labels. Internal POT identifiers are never exposed.
export forecastWave(string raw) =>
string result = raw
if raw == "POT ②"
result := "WAVE 2 ANTICIPATED"
else if raw == "POT ③"
result := "WAVE 3 ANTICIPATED"
else if raw == "POT ④"
result := "WAVE 4 ANTICIPATED"
else if raw == "POT ⑤"
result := "WAVE 5 ANTICIPATED"
else if raw == "POT A"
result := "WAVE A ANTICIPATED"
else if raw == "POT B"
result := "WAVE B ANTICIPATED"
else if raw == "POT C"
result := "WAVE C ANTICIPATED"
result
// Forecast lifecycle wording.
export forecastState(string raw) =>
string result = raw
if raw == "ARMED"
result := "CONFIRMATION WATCH"
else if raw == "FORMING"
result := "DEVELOPING"
else if raw == "NONE"
result := "—"
result
// Correction family wording.
export correctionType(string raw) =>
string result = raw
if raw == "UNRESOLVED COMPLEX"
result := "COMPLEX CORRECTION · UNCONFIRMED"
else if raw == "NO SUPPORTED COMPLETE PATTERN"
result := "CORRECTIVE STRUCTURE UNCONFIRMED"
result
// Correction state wording. Preserve standard pattern names while replacing
// development-only shorthand with trader language.
export correctionState(string raw) =>
string result = raw
if raw == "NO SUPPORTED COMPLETE PATTERN"
result := "CORRECTIVE STRUCTURE UNCONFIRMED"
else if raw == "W-X-Y CANDIDATE · WAIT Y-B BREAK"
result := "W-X-Y CANDIDATE · WAIT CONFIRMATION"
else if str.contains(raw, "REASSESS")
result := str.replace_all(raw, "REASSESS", "COUNT REVIEW")
result
// Lower-degree provisional wording.
export lowerDegreeForecast(string timeframeLabel, int stage, string rawState, string scoreText) =>
string waveText = "MOTIVE STRUCTURE"
if stage == 3
waveText := "WAVE 3"
else if stage == 5
waveText := "WAVE 5"
"LOWER-DEGREE " + waveText + " · " + timeframeLabel + " · " + forecastState(rawState) + " · " + scoreText
export lowerDegreeLabel(int stage, string rawState, float score) =>
string waveText = "MOTIVE"
if stage == 3
waveText := "WAVE 3"
else if stage == 5
waveText := "WAVE 5"
string scoreText = na(score) ? "—" : str.tostring(score, "#.0")
"LOWER-DEGREE " + waveText + "\n" + forecastState(rawState) + " · " + scoreText
// Event wording. Internal lifecycle keys remain untouched; only display changes.
export event(string raw) =>
string result = raw
result := str.replace_all(result, "STRUCTURE CHANGED", "COUNT REVISED")
result := str.replace_all(result, "CORRECTION CHANGED", "CORRECTION REVISED")
result := str.replace_all(result, "COUNT INVALID", "COUNT INVALIDATED")
result := str.replace_all(result, "LOCAL W5", "LOWER-DEGREE WAVE 5")
result := str.replace_all(result, "POT C", "WAVE C")
result := str.replace_all(result, "POT B", "WAVE B")
result := str.replace_all(result, "POT A", "WAVE A")
result := str.replace_all(result, "POT ⑤", "WAVE 5")
result := str.replace_all(result, "POT ④", "WAVE 4")
result := str.replace_all(result, "POT ③", "WAVE 3")
result := str.replace_all(result, "POT ②", "WAVE 2")
result
// Standard trader-facing setup state.
export setupState(string raw) =>
string result = raw
result := str.replace_all(result, "COUNT INVALID", "COUNT INVALIDATED")
result := str.replace_all(result, "STRUCTURE CHANGED", "COUNT REVISED")
result
// Standard confirmation language.
export confirmationAction(bool confirmed, bool available, string basis, float level) =>
string result = "WAIT CONFIRMATION"
if confirmed
result := "CONFIRMED · BREAKOUT"
else if available
string levelText = na(level) ? "" : " " + str.tostring(level, format.mintick)
result := "WAIT BREAKOUT · " + basis + levelText
result