PINE LIBRARY
CryptonianEWAudit

Library "CryptonianEWAudit"
Cryptonian Elliott Wave Audit /1. Owns production integrity auditing, compact event-state construction, universal-event aggregation and alert deduplication for the library-first Elliott architecture. The audit rules are migrated from Elliott Wave Engine 11.8b2 without changing Elliott or trade methodology.
addUniqueLimited(values, value, maximumSize)
Adds one unique string and caps the registry size.
Parameters:
values (array<string>)
value (string)
maximumSize (int)
eventOnce(eventRegistry, eventCondition, eventName, sourceKey, maximumSize, deduplicate)
Generic event de-duplication helper. This preserves the 11.8b2 event
key contract: eventName | sourceKey | time.
Parameters:
eventRegistry (array<string>)
eventCondition (bool)
eventName (string)
sourceKey (string)
maximumSize (int)
deduplicate (bool)
eventState(lastEvent, currentCountKey, lastInvalidCountKey, forecastKey, tradeId, countStarted, countRevised, countInvalidated, forecastNew, forecastRevised, forecastInvalidated, tradeWaiting, tradeActivated, tradeResolved, tradeCountInvalidExit)
Creates the shared Model.EventState. The code field is a bit-mask for
future audit/UI use; the named booleans remain the authoritative contract.
Parameters:
lastEvent (string)
currentCountKey (string)
lastInvalidCountKey (string)
forecastKey (string)
tradeId (string)
countStarted (bool)
countRevised (bool)
countInvalidated (bool)
forecastNew (bool)
forecastRevised (bool)
forecastInvalidated (bool)
tradeWaiting (bool)
tradeActivated (bool)
tradeResolved (bool)
tradeCountInvalidExit (bool)
tradeLifecycleEvent(resolution)
True when Trade's per-bar resolution contains any lifecycle event.
TP1 is intentionally included even when the trade remains live because 11.8b2
treats TP1 as an alert-worthy lifecycle event.
Parameters:
resolution (TradeResolution type from AYEHAN/CryptonianEWModel/1)
productionAudit(pivotPrices, pivotBars, pivotTimes, pivotTypes, pivotIds, nestedPivotPrices, nestedPivotTimes, fvgOriginalTops, fvgOriginalBottoms, fvgLiveTops, fvgLiveBottoms, fvgDirections, fvgBirthBars, tradeActivationCount, tradeResolutionCount, tradeProfitableResolutions, tradeLosingResolutions, tradeFlatResolutions, tradeCancelled, tradeWaitingCancellationCount, tradeTp1ReachedCount, tradeTp2ReachedCount, tradeLive, tradeSetupId, tradeDirection, tradeEntry, tradeStop, tradeTp1)
Runs the original 11.8b2 production audit and owns persistent issue
history internally. Call this once per host bar.
Parameters:
pivotPrices (array<float>)
pivotBars (array<int>)
pivotTimes (array<int>)
pivotTypes (array<int>)
pivotIds (array<int>)
nestedPivotPrices (array<float>)
nestedPivotTimes (array<int>)
fvgOriginalTops (array<float>)
fvgOriginalBottoms (array<float>)
fvgLiveTops (array<float>)
fvgLiveBottoms (array<float>)
fvgDirections (array<int>)
fvgBirthBars (array<int>)
tradeActivationCount (int)
tradeResolutionCount (int)
tradeProfitableResolutions (int)
tradeLosingResolutions (int)
tradeFlatResolutions (int)
tradeCancelled (int)
tradeWaitingCancellationCount (int)
tradeTp1ReachedCount (int)
tradeTp2ReachedCount (int)
tradeLive (bool)
tradeSetupId (string)
tradeDirection (int)
tradeEntry (float)
tradeStop (float)
tradeTp1 (float)
universalEventRaw(events, committedPivotNow, impulseCompletedNow, correctionCompletedNow, freshFvgConfluenceNow, mtfContextChangedNow, mtfPrimaryGateReadyNow, tradeLifecycleNow, forecastAuditTargetHit, primaryW5TargetHitNow, productionStructuralGate, productionTradeActivationGate, productionAuditChangedNow)
Reproduces the 11.8b2 universal-event OR tree using the compact shared
EventState plus the few event families not represented by Model /1.
Parameters:
events (EventState type from AYEHAN/CryptonianEWModel/1)
committedPivotNow (bool)
impulseCompletedNow (bool)
correctionCompletedNow (bool)
freshFvgConfluenceNow (bool)
mtfContextChangedNow (bool)
mtfPrimaryGateReadyNow (bool)
tradeLifecycleNow (bool)
forecastAuditTargetHit (bool)
primaryW5TargetHitNow (bool)
productionStructuralGate (bool)
productionTradeActivationGate (bool)
productionAuditChangedNow (bool)
universalAlert(rawEvent, maximumSize, deduplicate)
Stateful universal alert. The registry lives in Audit /1 rather than
the indicator host. This preserves 11.8b2's ANY_EW_EVENT | bar_index | time key.
Call once per host bar, then feed .fire to the single alertcondition().
Parameters:
rawEvent (bool)
maximumSize (int)
deduplicate (bool)
processUniversalAlert(events, committedPivotNow, impulseCompletedNow, correctionCompletedNow, freshFvgConfluenceNow, mtfContextChangedNow, mtfPrimaryGateReadyNow, tradeLifecycleNow, forecastAuditTargetHit, primaryW5TargetHitNow, productionStructuralGate, productionTradeActivationGate, productionAuditChangedNow, maximumSize, deduplicate)
Convenience wrapper: aggregate + deduplicate in one host call.
Parameters:
events (EventState type from AYEHAN/CryptonianEWModel/1)
committedPivotNow (bool)
impulseCompletedNow (bool)
correctionCompletedNow (bool)
freshFvgConfluenceNow (bool)
mtfContextChangedNow (bool)
mtfPrimaryGateReadyNow (bool)
tradeLifecycleNow (bool)
forecastAuditTargetHit (bool)
primaryW5TargetHitNow (bool)
productionStructuralGate (bool)
productionTradeActivationGate (bool)
productionAuditChangedNow (bool)
maximumSize (int)
deduplicate (bool)
ProductionAuditState
Complete production-integrity result. Individual checks are retained so
Fields:
pass (series bool)
status (series string)
currentIssue (series string)
signature (series string)
unresolvedActivations (series int)
issueCount (series int)
lastIssue (series string)
changedNow (series bool)
pivotArraysAligned (series bool)
nestedArraysAligned (series bool)
fvgArraysAligned (series bool)
tradeAccounting (series bool)
tradeResultAccounting (series bool)
cancellationAccounting (series bool)
liveIdentity (series bool)
liveOrdering (series bool)
tp1Accounting (series bool)
UniversalEventState
Compact result from the universal Elliott event aggregator.
Fields:
raw (series bool)
fire (series bool)
key (series string)
Cryptonian Elliott Wave Audit /1. Owns production integrity auditing, compact event-state construction, universal-event aggregation and alert deduplication for the library-first Elliott architecture. The audit rules are migrated from Elliott Wave Engine 11.8b2 without changing Elliott or trade methodology.
addUniqueLimited(values, value, maximumSize)
Adds one unique string and caps the registry size.
Parameters:
values (array<string>)
value (string)
maximumSize (int)
eventOnce(eventRegistry, eventCondition, eventName, sourceKey, maximumSize, deduplicate)
Generic event de-duplication helper. This preserves the 11.8b2 event
key contract: eventName | sourceKey | time.
Parameters:
eventRegistry (array<string>)
eventCondition (bool)
eventName (string)
sourceKey (string)
maximumSize (int)
deduplicate (bool)
eventState(lastEvent, currentCountKey, lastInvalidCountKey, forecastKey, tradeId, countStarted, countRevised, countInvalidated, forecastNew, forecastRevised, forecastInvalidated, tradeWaiting, tradeActivated, tradeResolved, tradeCountInvalidExit)
Creates the shared Model.EventState. The code field is a bit-mask for
future audit/UI use; the named booleans remain the authoritative contract.
Parameters:
lastEvent (string)
currentCountKey (string)
lastInvalidCountKey (string)
forecastKey (string)
tradeId (string)
countStarted (bool)
countRevised (bool)
countInvalidated (bool)
forecastNew (bool)
forecastRevised (bool)
forecastInvalidated (bool)
tradeWaiting (bool)
tradeActivated (bool)
tradeResolved (bool)
tradeCountInvalidExit (bool)
tradeLifecycleEvent(resolution)
True when Trade's per-bar resolution contains any lifecycle event.
TP1 is intentionally included even when the trade remains live because 11.8b2
treats TP1 as an alert-worthy lifecycle event.
Parameters:
resolution (TradeResolution type from AYEHAN/CryptonianEWModel/1)
productionAudit(pivotPrices, pivotBars, pivotTimes, pivotTypes, pivotIds, nestedPivotPrices, nestedPivotTimes, fvgOriginalTops, fvgOriginalBottoms, fvgLiveTops, fvgLiveBottoms, fvgDirections, fvgBirthBars, tradeActivationCount, tradeResolutionCount, tradeProfitableResolutions, tradeLosingResolutions, tradeFlatResolutions, tradeCancelled, tradeWaitingCancellationCount, tradeTp1ReachedCount, tradeTp2ReachedCount, tradeLive, tradeSetupId, tradeDirection, tradeEntry, tradeStop, tradeTp1)
Runs the original 11.8b2 production audit and owns persistent issue
history internally. Call this once per host bar.
Parameters:
pivotPrices (array<float>)
pivotBars (array<int>)
pivotTimes (array<int>)
pivotTypes (array<int>)
pivotIds (array<int>)
nestedPivotPrices (array<float>)
nestedPivotTimes (array<int>)
fvgOriginalTops (array<float>)
fvgOriginalBottoms (array<float>)
fvgLiveTops (array<float>)
fvgLiveBottoms (array<float>)
fvgDirections (array<int>)
fvgBirthBars (array<int>)
tradeActivationCount (int)
tradeResolutionCount (int)
tradeProfitableResolutions (int)
tradeLosingResolutions (int)
tradeFlatResolutions (int)
tradeCancelled (int)
tradeWaitingCancellationCount (int)
tradeTp1ReachedCount (int)
tradeTp2ReachedCount (int)
tradeLive (bool)
tradeSetupId (string)
tradeDirection (int)
tradeEntry (float)
tradeStop (float)
tradeTp1 (float)
universalEventRaw(events, committedPivotNow, impulseCompletedNow, correctionCompletedNow, freshFvgConfluenceNow, mtfContextChangedNow, mtfPrimaryGateReadyNow, tradeLifecycleNow, forecastAuditTargetHit, primaryW5TargetHitNow, productionStructuralGate, productionTradeActivationGate, productionAuditChangedNow)
Reproduces the 11.8b2 universal-event OR tree using the compact shared
EventState plus the few event families not represented by Model /1.
Parameters:
events (EventState type from AYEHAN/CryptonianEWModel/1)
committedPivotNow (bool)
impulseCompletedNow (bool)
correctionCompletedNow (bool)
freshFvgConfluenceNow (bool)
mtfContextChangedNow (bool)
mtfPrimaryGateReadyNow (bool)
tradeLifecycleNow (bool)
forecastAuditTargetHit (bool)
primaryW5TargetHitNow (bool)
productionStructuralGate (bool)
productionTradeActivationGate (bool)
productionAuditChangedNow (bool)
universalAlert(rawEvent, maximumSize, deduplicate)
Stateful universal alert. The registry lives in Audit /1 rather than
the indicator host. This preserves 11.8b2's ANY_EW_EVENT | bar_index | time key.
Call once per host bar, then feed .fire to the single alertcondition().
Parameters:
rawEvent (bool)
maximumSize (int)
deduplicate (bool)
processUniversalAlert(events, committedPivotNow, impulseCompletedNow, correctionCompletedNow, freshFvgConfluenceNow, mtfContextChangedNow, mtfPrimaryGateReadyNow, tradeLifecycleNow, forecastAuditTargetHit, primaryW5TargetHitNow, productionStructuralGate, productionTradeActivationGate, productionAuditChangedNow, maximumSize, deduplicate)
Convenience wrapper: aggregate + deduplicate in one host call.
Parameters:
events (EventState type from AYEHAN/CryptonianEWModel/1)
committedPivotNow (bool)
impulseCompletedNow (bool)
correctionCompletedNow (bool)
freshFvgConfluenceNow (bool)
mtfContextChangedNow (bool)
mtfPrimaryGateReadyNow (bool)
tradeLifecycleNow (bool)
forecastAuditTargetHit (bool)
primaryW5TargetHitNow (bool)
productionStructuralGate (bool)
productionTradeActivationGate (bool)
productionAuditChangedNow (bool)
maximumSize (int)
deduplicate (bool)
ProductionAuditState
Complete production-integrity result. Individual checks are retained so
Fields:
pass (series bool)
status (series string)
currentIssue (series string)
signature (series string)
unresolvedActivations (series int)
issueCount (series int)
lastIssue (series string)
changedNow (series bool)
pivotArraysAligned (series bool)
nestedArraysAligned (series bool)
fvgArraysAligned (series bool)
tradeAccounting (series bool)
tradeResultAccounting (series bool)
cancellationAccounting (series bool)
liveIdentity (series bool)
liveOrdering (series bool)
tp1Accounting (series bool)
UniversalEventState
Compact result from the universal Elliott event aggregator.
Fields:
raw (series bool)
fire (series bool)
key (series string)
Thư viện Pine
Theo đúng tinh thần TradingView, tác giả đã công bố mã Pine này như một thư viện mã nguồn mở để các lập trình viên Pine khác trong cộng đồng có thể tái sử dụng. Chúc mừng tác giả! Bạn có thể sử dụng thư viện này cho mục đích cá nhân hoặc trong các ấn phẩm mã nguồn mở khác, nhưng việc tái sử dụng mã này trong các ấn phẩm phải tuân theo Nội Quy.
I Am LOVE But You Can Call Me AYEHAN
discord.gg/nX3DGCyCJV
discord.gg/nX3DGCyCJV
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Thư viện Pine
Theo đúng tinh thần TradingView, tác giả đã công bố mã Pine này như một thư viện mã nguồn mở để các lập trình viên Pine khác trong cộng đồng có thể tái sử dụng. Chúc mừng tác giả! Bạn có thể sử dụng thư viện này cho mục đích cá nhân hoặc trong các ấn phẩm mã nguồn mở khác, nhưng việc tái sử dụng mã này trong các ấn phẩm phải tuân theo Nội Quy.
I Am LOVE But You Can Call Me AYEHAN
discord.gg/nX3DGCyCJV
discord.gg/nX3DGCyCJV
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.