PINE LIBRARY
Actualizado CryptonianEWRuntime

Library "CryptonianEWRuntime"
Cryptonian Elliott Wave Runtime /1. Owns adaptive MTF profile selection, compact context/bridge request expressions, lower-timeframe confirmation processing, MTF trade gates, bottom-up bootstrap assembly, Context EW forecast assembly, HTF trade-bridge request expressions, nested-pivot request expressions, production gates and final engine-state packing. Methodology is preserved from Elliott Wave Engine 11.8b2; this library is an architecture migration, not a rules rewrite.
autoContextTimeframe(chartSeconds)
Parameters:
chartSeconds (int)
autoConfirmationTimeframe(chartSeconds)
Parameters:
chartSeconds (int)
autoBridgeTimeframe(chartSeconds)
Parameters:
chartSeconds (int)
profileState(enabled, autoProfile, manualContextTimeframe, manualExecutionTimeframe, manualConfirmationTimeframe, chartTimeframe, chartSeconds)
Builds the timeframe/profile portion of Model.MtfState.
It deliberately does not perform any data request.
Parameters:
enabled (bool)
autoProfile (bool)
manualContextTimeframe (string)
manualExecutionTimeframe (string)
manualConfirmationTimeframe (string)
chartTimeframe (string)
chartSeconds (int)
bridgeTimeframe(autoProfile, manualConfirmationTimeframe, chartSeconds)
Returns the active lower bridge timeframe used by the existing
bottom-up Elliott bootstrap. This remains separate because Model /1 MtfState
intentionally stores only Context / Execution / Confirmation.
Parameters:
autoProfile (bool)
manualConfirmationTimeframe (string)
chartSeconds (int)
bridgeTimeframeValid(bridgeTf, chartSeconds)
Parameters:
bridgeTf (string)
chartSeconds (int)
contextPack(mtfPivotStrength, atrLength, mtfMinimumSwingAtr, allowDiagonals, allowTruncation, truncationMinimumPct, contextPivotStrength, contextMinimumSwingAtr, candidateStarts, minimumNewCandidateScore, extensionThreshold, diagonalTolerance, invalidationMode)
Exact 11.8b2 higher-timeframe context packet.
mtfConfirmedSnapshot() retains the old trade-context methodology while
contextConfirmedSnapshot() retains the separate Context-EW forecast geometry.
Parameters:
mtfPivotStrength (int)
atrLength (simple int)
mtfMinimumSwingAtr (float)
allowDiagonals (bool)
allowTruncation (bool)
truncationMinimumPct (float)
contextPivotStrength (int)
contextMinimumSwingAtr (float)
candidateStarts (int)
minimumNewCandidateScore (float)
extensionThreshold (float)
diagonalTolerance (float)
invalidationMode (string)
mtfContextState(pack)
Converts ContextPack's MTF branch into the shared DegreeState contract.
Parameters:
pack (ContextPack)
contextForecastDegreeState(pack)
Converts ContextPack's full Context-EW branch into DegreeState.
Parameters:
pack (ContextPack)
bridgeDegreeState(pivotStrength, atrLength, minimumSwingAtr, candidateStarts, minimumNewScore, allowDiagonals, allowTruncation, truncationMinimumPct, extensionThreshold, diagonalTolerance, invalidationMode)
Exact lower-bridge structural expression, object form.
Parameters:
pivotStrength (int)
atrLength (simple int)
minimumSwingAtr (float)
candidateStarts (int)
minimumNewScore (float)
allowDiagonals (bool)
allowTruncation (bool)
truncationMinimumPct (float)
extensionThreshold (float)
diagonalTolerance (float)
invalidationMode (string)
ltfMomentumSignal(fastLength, slowLength)
Exact lower-timeframe momentum expression used by 11.8b2.
Parameters:
fastLength (simple int)
slowLength (simple int)
nestedPivotEvent(strength, atrLength)
Exact Part 9.2 lower-degree confirmed pivot event expression.
Parameters:
strength (int)
atrLength (simple int)
htfTradeBridgeState(enabled, degreeEngineOn, secondaryEnabled, subSecondaryEnabled, primaryPivotStrength, secondaryPivotStrength, subSecondaryPivotStrength, atrLength, primaryMinimumSwingAtr, secondaryMinimumSwingAtr, subSecondaryMinimumSwingAtr, candidateStarts, minimumNewScore, allowDiagonals, allowTruncation, truncationMinimumPct, extensionThreshold, diagonalTolerance, invalidationMode, minimumModelScore, stopBufferAtr)
Native HTF trade bridge request expression. Candidate discovery,
first-seen geometry freezing and W2/W3/W4/W5 classification remain in Trade /13.
Parameters:
enabled (bool)
degreeEngineOn (bool)
secondaryEnabled (bool)
subSecondaryEnabled (bool)
primaryPivotStrength (int)
secondaryPivotStrength (int)
subSecondaryPivotStrength (int)
atrLength (simple int)
primaryMinimumSwingAtr (float)
secondaryMinimumSwingAtr (float)
subSecondaryMinimumSwingAtr (float)
candidateStarts (int)
minimumNewScore (float)
allowDiagonals (bool)
allowTruncation (bool)
truncationMinimumPct (float)
extensionThreshold (float)
diagonalTolerance (float)
invalidationMode (string)
minimumModelScore (float)
stopBufferAtr (float)
updateMtfState(previous, enabled, autoProfile, manualContextTimeframe, manualExecutionTimeframe, manualConfirmationTimeframe, chartTimeframe, chartSeconds, gateMode, requireExecutionTimeframe, ltfConfirmationMaximumAge, realtimeBar, context, ltfSignalValues, ltfSignalTimes, primaryDirection, correctionDirection)
Updates one persistent Model.MtfState object from the current profile,
requested context packet and request.security_lower_tf() signal/time arrays.
Pass a persistent initialized object from the host, then assign the returned object
back to it on every bar. The function intentionally ignores the realtime chart
bar's final LTF intrabar, exactly as 11.8b2 did.
Parameters:
previous (MtfState type from AYEHAN/CryptonianEWModel/1)
enabled (bool)
autoProfile (bool)
manualContextTimeframe (string)
manualExecutionTimeframe (string)
manualConfirmationTimeframe (string)
chartTimeframe (string)
chartSeconds (int)
gateMode (string)
requireExecutionTimeframe (bool)
ltfConfirmationMaximumAge (int)
realtimeBar (bool)
context (ContextPack)
ltfSignalValues (array<int>)
ltfSignalTimes (array<int>)
primaryDirection (int)
correctionDirection (int)
runtimeEvents(current, previous, primaryDirection, correctionDirection)
Small event helper that replaces host history expressions with object
history applied correctly by the caller: pass current and previous Runtime states.
Parameters:
current (MtfState type from AYEHAN/CryptonianEWModel/1)
previous (MtfState type from AYEHAN/CryptonianEWModel/1)
primaryDirection (int)
correctionDirection (int)
bootstrapState(chartPrimaryMissing, bridge, context, chartClose, chartAtr)
Parameters:
chartPrimaryMissing (bool)
bridge (DegreeState type from AYEHAN/CryptonianEWModel/1)
context (DegreeState type from AYEHAN/CryptonianEWModel/1)
chartClose (float)
chartAtr (float)
contextForecastState(enabled, contextTimeframeValid, context, armScore)
Parameters:
enabled (bool)
contextTimeframeValid (bool)
context (ContextPack)
armScore (float)
processNested(eventTypes, eventPrices, eventTimes, eventAtrs, barTimes, pivotPrices, pivotTimes, pendingType, pendingPrice, pendingTime, pendingAtr, lastEventTime, coverageStartTime, coverageEndTime, minimumSwingAtr, enabled)
Parameters:
eventTypes (array<int>)
eventPrices (array<float>)
eventTimes (array<int>)
eventAtrs (array<float>)
barTimes (array<int>)
pivotPrices (array<float>)
pivotTimes (array<int>)
pendingType (int)
pendingPrice (float)
pendingTime (int)
pendingAtr (float)
lastEventTime (int)
coverageStartTime (int)
coverageEndTime (int)
minimumSwingAtr (float)
enabled (bool)
nestedLeg(pivotPrices, pivotTimes, coverageStartTime, coverageEndTime, engineOn, timeframeValid, t0, y0, t1, y1, direction, motive, diagonal, confirmed)
Parameters:
pivotPrices (array<float>)
pivotTimes (array<int>)
coverageStartTime (int)
coverageEndTime (int)
engineOn (bool)
timeframeValid (bool)
t0 (int)
y0 (float)
t1 (int)
y1 (float)
direction (int)
motive (bool)
diagonal (bool)
confirmed (bool)
structuralProductionGate(productionMode, confirmOnClose, barConfirmed)
Parameters:
productionMode (bool)
confirmOnClose (bool)
barConfirmed (bool)
tradeActivationProductionGate(productionMode, confirmOnClose, barConfirmed)
Parameters:
productionMode (bool)
confirmOnClose (bool)
barConfirmed (bool)
packEngineState(primary, secondary, subSecondary, correction, bootstrap, parent, degreeResolution, forecast, contextForecast, mtf, htfTrade, events)
Parameters:
primary (DegreeState type from AYEHAN/CryptonianEWModel/1)
secondary (DegreeState type from AYEHAN/CryptonianEWModel/1)
subSecondary (DegreeState type from AYEHAN/CryptonianEWModel/1)
correction (CorrectionState type from AYEHAN/CryptonianEWModel/1)
bootstrap (BootstrapState type from AYEHAN/CryptonianEWModel/1)
parent (ParentHypothesis type from AYEHAN/CryptonianEWModel/1)
degreeResolution (DegreeResolutionState type from AYEHAN/CryptonianEWModel/1)
forecast (ForecastState type from AYEHAN/CryptonianEWModel/1)
contextForecast (ContextForecastState type from AYEHAN/CryptonianEWModel/1)
mtf (MtfState type from AYEHAN/CryptonianEWModel/1)
htfTrade (TradeBridgePack type from AYEHAN/CryptonianEWModel/1)
events (EventState type from AYEHAN/CryptonianEWModel/1)
ContextPack
One request-safe higher-timeframe packet containing both legacy MTF
Fields:
mtfDirection (series int)
mtfStage (series int)
mtfQuality (series float)
mtfInvalidation (series float)
mtfDiagonal (series bool)
forecastDirection (series int)
forecastStage (series int)
forecastScore (series float)
forecastInvalidation (series float)
forecastDiagonal (series bool)
p0 (series float)
p1 (series float)
p2 (series float)
p3 (series float)
p4 (series float)
p5 (series float)
confirmedClose (series float)
RuntimeEvents
Small host-facing diagnostic packet for runtime transitions.
Fields:
contextChanged (series bool)
motiveGateReady (series bool)
correctionGateReady (series bool)
Cryptonian Elliott Wave Runtime /1. Owns adaptive MTF profile selection, compact context/bridge request expressions, lower-timeframe confirmation processing, MTF trade gates, bottom-up bootstrap assembly, Context EW forecast assembly, HTF trade-bridge request expressions, nested-pivot request expressions, production gates and final engine-state packing. Methodology is preserved from Elliott Wave Engine 11.8b2; this library is an architecture migration, not a rules rewrite.
autoContextTimeframe(chartSeconds)
Parameters:
chartSeconds (int)
autoConfirmationTimeframe(chartSeconds)
Parameters:
chartSeconds (int)
autoBridgeTimeframe(chartSeconds)
Parameters:
chartSeconds (int)
profileState(enabled, autoProfile, manualContextTimeframe, manualExecutionTimeframe, manualConfirmationTimeframe, chartTimeframe, chartSeconds)
Builds the timeframe/profile portion of Model.MtfState.
It deliberately does not perform any data request.
Parameters:
enabled (bool)
autoProfile (bool)
manualContextTimeframe (string)
manualExecutionTimeframe (string)
manualConfirmationTimeframe (string)
chartTimeframe (string)
chartSeconds (int)
bridgeTimeframe(autoProfile, manualConfirmationTimeframe, chartSeconds)
Returns the active lower bridge timeframe used by the existing
bottom-up Elliott bootstrap. This remains separate because Model /1 MtfState
intentionally stores only Context / Execution / Confirmation.
Parameters:
autoProfile (bool)
manualConfirmationTimeframe (string)
chartSeconds (int)
bridgeTimeframeValid(bridgeTf, chartSeconds)
Parameters:
bridgeTf (string)
chartSeconds (int)
contextPack(mtfPivotStrength, atrLength, mtfMinimumSwingAtr, allowDiagonals, allowTruncation, truncationMinimumPct, contextPivotStrength, contextMinimumSwingAtr, candidateStarts, minimumNewCandidateScore, extensionThreshold, diagonalTolerance, invalidationMode)
Exact 11.8b2 higher-timeframe context packet.
mtfConfirmedSnapshot() retains the old trade-context methodology while
contextConfirmedSnapshot() retains the separate Context-EW forecast geometry.
Parameters:
mtfPivotStrength (int)
atrLength (simple int)
mtfMinimumSwingAtr (float)
allowDiagonals (bool)
allowTruncation (bool)
truncationMinimumPct (float)
contextPivotStrength (int)
contextMinimumSwingAtr (float)
candidateStarts (int)
minimumNewCandidateScore (float)
extensionThreshold (float)
diagonalTolerance (float)
invalidationMode (string)
mtfContextState(pack)
Converts ContextPack's MTF branch into the shared DegreeState contract.
Parameters:
pack (ContextPack)
contextForecastDegreeState(pack)
Converts ContextPack's full Context-EW branch into DegreeState.
Parameters:
pack (ContextPack)
bridgeDegreeState(pivotStrength, atrLength, minimumSwingAtr, candidateStarts, minimumNewScore, allowDiagonals, allowTruncation, truncationMinimumPct, extensionThreshold, diagonalTolerance, invalidationMode)
Exact lower-bridge structural expression, object form.
Parameters:
pivotStrength (int)
atrLength (simple int)
minimumSwingAtr (float)
candidateStarts (int)
minimumNewScore (float)
allowDiagonals (bool)
allowTruncation (bool)
truncationMinimumPct (float)
extensionThreshold (float)
diagonalTolerance (float)
invalidationMode (string)
ltfMomentumSignal(fastLength, slowLength)
Exact lower-timeframe momentum expression used by 11.8b2.
Parameters:
fastLength (simple int)
slowLength (simple int)
nestedPivotEvent(strength, atrLength)
Exact Part 9.2 lower-degree confirmed pivot event expression.
Parameters:
strength (int)
atrLength (simple int)
htfTradeBridgeState(enabled, degreeEngineOn, secondaryEnabled, subSecondaryEnabled, primaryPivotStrength, secondaryPivotStrength, subSecondaryPivotStrength, atrLength, primaryMinimumSwingAtr, secondaryMinimumSwingAtr, subSecondaryMinimumSwingAtr, candidateStarts, minimumNewScore, allowDiagonals, allowTruncation, truncationMinimumPct, extensionThreshold, diagonalTolerance, invalidationMode, minimumModelScore, stopBufferAtr)
Native HTF trade bridge request expression. Candidate discovery,
first-seen geometry freezing and W2/W3/W4/W5 classification remain in Trade /13.
Parameters:
enabled (bool)
degreeEngineOn (bool)
secondaryEnabled (bool)
subSecondaryEnabled (bool)
primaryPivotStrength (int)
secondaryPivotStrength (int)
subSecondaryPivotStrength (int)
atrLength (simple int)
primaryMinimumSwingAtr (float)
secondaryMinimumSwingAtr (float)
subSecondaryMinimumSwingAtr (float)
candidateStarts (int)
minimumNewScore (float)
allowDiagonals (bool)
allowTruncation (bool)
truncationMinimumPct (float)
extensionThreshold (float)
diagonalTolerance (float)
invalidationMode (string)
minimumModelScore (float)
stopBufferAtr (float)
updateMtfState(previous, enabled, autoProfile, manualContextTimeframe, manualExecutionTimeframe, manualConfirmationTimeframe, chartTimeframe, chartSeconds, gateMode, requireExecutionTimeframe, ltfConfirmationMaximumAge, realtimeBar, context, ltfSignalValues, ltfSignalTimes, primaryDirection, correctionDirection)
Updates one persistent Model.MtfState object from the current profile,
requested context packet and request.security_lower_tf() signal/time arrays.
Pass a persistent initialized object from the host, then assign the returned object
back to it on every bar. The function intentionally ignores the realtime chart
bar's final LTF intrabar, exactly as 11.8b2 did.
Parameters:
previous (MtfState type from AYEHAN/CryptonianEWModel/1)
enabled (bool)
autoProfile (bool)
manualContextTimeframe (string)
manualExecutionTimeframe (string)
manualConfirmationTimeframe (string)
chartTimeframe (string)
chartSeconds (int)
gateMode (string)
requireExecutionTimeframe (bool)
ltfConfirmationMaximumAge (int)
realtimeBar (bool)
context (ContextPack)
ltfSignalValues (array<int>)
ltfSignalTimes (array<int>)
primaryDirection (int)
correctionDirection (int)
runtimeEvents(current, previous, primaryDirection, correctionDirection)
Small event helper that replaces host history expressions with object
history applied correctly by the caller: pass current and previous Runtime states.
Parameters:
current (MtfState type from AYEHAN/CryptonianEWModel/1)
previous (MtfState type from AYEHAN/CryptonianEWModel/1)
primaryDirection (int)
correctionDirection (int)
bootstrapState(chartPrimaryMissing, bridge, context, chartClose, chartAtr)
Parameters:
chartPrimaryMissing (bool)
bridge (DegreeState type from AYEHAN/CryptonianEWModel/1)
context (DegreeState type from AYEHAN/CryptonianEWModel/1)
chartClose (float)
chartAtr (float)
contextForecastState(enabled, contextTimeframeValid, context, armScore)
Parameters:
enabled (bool)
contextTimeframeValid (bool)
context (ContextPack)
armScore (float)
processNested(eventTypes, eventPrices, eventTimes, eventAtrs, barTimes, pivotPrices, pivotTimes, pendingType, pendingPrice, pendingTime, pendingAtr, lastEventTime, coverageStartTime, coverageEndTime, minimumSwingAtr, enabled)
Parameters:
eventTypes (array<int>)
eventPrices (array<float>)
eventTimes (array<int>)
eventAtrs (array<float>)
barTimes (array<int>)
pivotPrices (array<float>)
pivotTimes (array<int>)
pendingType (int)
pendingPrice (float)
pendingTime (int)
pendingAtr (float)
lastEventTime (int)
coverageStartTime (int)
coverageEndTime (int)
minimumSwingAtr (float)
enabled (bool)
nestedLeg(pivotPrices, pivotTimes, coverageStartTime, coverageEndTime, engineOn, timeframeValid, t0, y0, t1, y1, direction, motive, diagonal, confirmed)
Parameters:
pivotPrices (array<float>)
pivotTimes (array<int>)
coverageStartTime (int)
coverageEndTime (int)
engineOn (bool)
timeframeValid (bool)
t0 (int)
y0 (float)
t1 (int)
y1 (float)
direction (int)
motive (bool)
diagonal (bool)
confirmed (bool)
structuralProductionGate(productionMode, confirmOnClose, barConfirmed)
Parameters:
productionMode (bool)
confirmOnClose (bool)
barConfirmed (bool)
tradeActivationProductionGate(productionMode, confirmOnClose, barConfirmed)
Parameters:
productionMode (bool)
confirmOnClose (bool)
barConfirmed (bool)
packEngineState(primary, secondary, subSecondary, correction, bootstrap, parent, degreeResolution, forecast, contextForecast, mtf, htfTrade, events)
Parameters:
primary (DegreeState type from AYEHAN/CryptonianEWModel/1)
secondary (DegreeState type from AYEHAN/CryptonianEWModel/1)
subSecondary (DegreeState type from AYEHAN/CryptonianEWModel/1)
correction (CorrectionState type from AYEHAN/CryptonianEWModel/1)
bootstrap (BootstrapState type from AYEHAN/CryptonianEWModel/1)
parent (ParentHypothesis type from AYEHAN/CryptonianEWModel/1)
degreeResolution (DegreeResolutionState type from AYEHAN/CryptonianEWModel/1)
forecast (ForecastState type from AYEHAN/CryptonianEWModel/1)
contextForecast (ContextForecastState type from AYEHAN/CryptonianEWModel/1)
mtf (MtfState type from AYEHAN/CryptonianEWModel/1)
htfTrade (TradeBridgePack type from AYEHAN/CryptonianEWModel/1)
events (EventState type from AYEHAN/CryptonianEWModel/1)
ContextPack
One request-safe higher-timeframe packet containing both legacy MTF
Fields:
mtfDirection (series int)
mtfStage (series int)
mtfQuality (series float)
mtfInvalidation (series float)
mtfDiagonal (series bool)
forecastDirection (series int)
forecastStage (series int)
forecastScore (series float)
forecastInvalidation (series float)
forecastDiagonal (series bool)
p0 (series float)
p1 (series float)
p2 (series float)
p3 (series float)
p4 (series float)
p5 (series float)
confirmedClose (series float)
RuntimeEvents
Small host-facing diagnostic packet for runtime transitions.
Fields:
contextChanged (series bool)
motiveGateReady (series bool)
correctionGateReady (series bool)
Notas de prensa
v2Updated:
htfTradeBridgeState(enabled, degreeEngineOn, secondaryEnabled, subSecondaryEnabled, primaryPivotStrength, secondaryPivotStrength, subSecondaryPivotStrength, atrLength, primaryMinimumSwingAtr, secondaryMinimumSwingAtr, subSecondaryMinimumSwingAtr, candidateStarts, minimumNewScore, allowDiagonals, allowTruncation, truncationMinimumPct, extensionThreshold, diagonalTolerance, invalidationMode, minimumModelScore, stopBufferAtr)
Native HTF trade bridge request expression. Candidate discovery,
first-seen geometry freezing and W2/W3/W4/W5 classification remain in Trade /14.
Parameters:
enabled (bool)
degreeEngineOn (bool)
secondaryEnabled (bool)
subSecondaryEnabled (bool)
primaryPivotStrength (int)
secondaryPivotStrength (int)
subSecondaryPivotStrength (int)
atrLength (simple int)
primaryMinimumSwingAtr (float)
secondaryMinimumSwingAtr (float)
subSecondaryMinimumSwingAtr (float)
candidateStarts (int)
minimumNewScore (float)
allowDiagonals (bool)
allowTruncation (bool)
truncationMinimumPct (float)
extensionThreshold (float)
diagonalTolerance (float)
invalidationMode (string)
minimumModelScore (float)
stopBufferAtr (float)
Biblioteca Pine
Fiel al espíritu de TradingView, el autor ha publicado este código de Pine como biblioteca de código abierto, para que otros programadores de nuestra comunidad puedan reutilizarlo. ¡Enhorabuena al autor! Puede usar esta biblioteca de forma privada o en otras publicaciones de código abierto, pero su reutilización en publicaciones está sujeta a nuestras Normas internas.
I Am LOVE But You Can Call Me AYEHAN
discord.gg/nX3DGCyCJV
discord.gg/nX3DGCyCJV
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Biblioteca Pine
Fiel al espíritu de TradingView, el autor ha publicado este código de Pine como biblioteca de código abierto, para que otros programadores de nuestra comunidad puedan reutilizarlo. ¡Enhorabuena al autor! Puede usar esta biblioteca de forma privada o en otras publicaciones de código abierto, pero su reutilización en publicaciones está sujeta a nuestras Normas internas.
I Am LOVE But You Can Call Me AYEHAN
discord.gg/nX3DGCyCJV
discord.gg/nX3DGCyCJV
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.