OPEN-SOURCE SCRIPT
Aggiornato cd_cisd_market_Cx

Hi Traders,
Overview:
Many traders follow market structure to identify the market direction and seek trade opportunities in line with the trend.
However, markings derived from user-defined inputs can create different structures, depending on personal choices. For instance, choosing a pivot distance of 3 instead of 2 alters the structure, even though the chart remains the same. Ideally, the structure should remain consistent.
"Change in State Delivery" (CISD) is a widely accepted concept among traders and is considered a significant indicator of market direction based on the gain/loss of CISD levels.
In this indicator, CISD is selected as the primary criterion for marking market structure, eliminating the influence of user-dependent variations.
Here is a summary of the key logic and rules applied:
• When the price forms a new high/low, that level is only considered a pivot if a CISD has occurred.
• A bullish CISD is always followed by a bearish CISD, and vice versa.
• Pivot points form the internal structure.
• The internal structure is used to interpret the swing structure.
• Probabilities are derived from internal structure patterns.
________________________________________
Details:
How is CISD determined?
As is commonly known:
• When price makes a new high, the opening level of the first candle in the consecutive bullish candle sequence is marked.
• When price makes a new low, the opening of the first candle in the consecutive bearish sequence is marked.
• If there’s only one candle in the sequence, its opening level is used.
In a bullish market, losing a bearish CISD level (i.e., a close below it) or in a bearish market, gaining a bullish CISD level (i.e., a close above it) is interpreted as a potential shift in buyer-seller dominance and a possible market reversal.
________________________________________
How are internal (pivot) levels determined?
• When price closes below a bearish CISD level, the highest candle's high becomes a pivot high (PH).
• When price closes above a bullish CISD level, the lowest candle's low becomes a pivot low (PL).
• If the new PH is above the previous PH, it’s labeled as HH (Higher High); otherwise, LH (Lower High).
• If the new PL is below the previous PL, it’s labeled as LL (Lower Low); otherwise, HL (Higher Low).
________________________________________
Internal Market Structure:
• A series of HHs indicates a bullish internal structure.
• A series of LLs indicates a bearish internal structure.
________________________________________
Swing (Main) Market Structure:
Using internal pivots and previous swing levels, the main market structure is derived.
• A new swing high (SH) requires the price to move above the previous SH.
• A new swing low (SL) requires the price to move below the previous SL.
________________________________________
Probability Calculation:
Pivot levels forming the internal structure are coded as five-element sequences.
There are 64 possible combinations of such sequences made from consecutive PH and PL values.
Each pattern’s frequency from its starting candle is tracked.
To make it more understandable:
For example, after the four-sequence “HH, LL, LH,HL”, either HH or LH might follow.
The table shows the statistical likelihood of both possible outcomes for the most recent four-element sequence on the chart.
________________________________________
How reliable is it?
To assess reliability, results are calculated from the beginning using:
Success Rate (Suc. Rt) = Number of Correct Predictions / Total Predictions
This value is added to the table for reference.
It’s important to note that no statistical outcome guarantees certainty—every result offers a different interpretation. What truly matters is to avoid getting stopped out 😊.
________________________________________
Menu Options:
Show/hide preferences and color selections can be customized via the indicator menu.
________________________________________
What’s Coming in Future Versions?
Features such as FVG (Fair Value Gaps) between swing levels, volume imbalances, order blocks / mitigation blocks, Fibonacci levels, and relevant trade suggestions will be added.
________________________________________
This is a BETA version that I believe will help simplify your market reading. I’d be happy to hear your feedback and suggestions.
Cheerful Trading!
Overview:
Many traders follow market structure to identify the market direction and seek trade opportunities in line with the trend.
However, markings derived from user-defined inputs can create different structures, depending on personal choices. For instance, choosing a pivot distance of 3 instead of 2 alters the structure, even though the chart remains the same. Ideally, the structure should remain consistent.
"Change in State Delivery" (CISD) is a widely accepted concept among traders and is considered a significant indicator of market direction based on the gain/loss of CISD levels.
In this indicator, CISD is selected as the primary criterion for marking market structure, eliminating the influence of user-dependent variations.
Here is a summary of the key logic and rules applied:
• When the price forms a new high/low, that level is only considered a pivot if a CISD has occurred.
• A bullish CISD is always followed by a bearish CISD, and vice versa.
• Pivot points form the internal structure.
• The internal structure is used to interpret the swing structure.
• Probabilities are derived from internal structure patterns.
________________________________________
Details:
How is CISD determined?
As is commonly known:
• When price makes a new high, the opening level of the first candle in the consecutive bullish candle sequence is marked.
• When price makes a new low, the opening of the first candle in the consecutive bearish sequence is marked.
• If there’s only one candle in the sequence, its opening level is used.
In a bullish market, losing a bearish CISD level (i.e., a close below it) or in a bearish market, gaining a bullish CISD level (i.e., a close above it) is interpreted as a potential shift in buyer-seller dominance and a possible market reversal.
________________________________________
How are internal (pivot) levels determined?
• When price closes below a bearish CISD level, the highest candle's high becomes a pivot high (PH).
• When price closes above a bullish CISD level, the lowest candle's low becomes a pivot low (PL).
• If the new PH is above the previous PH, it’s labeled as HH (Higher High); otherwise, LH (Lower High).
• If the new PL is below the previous PL, it’s labeled as LL (Lower Low); otherwise, HL (Higher Low).
________________________________________
Internal Market Structure:
• A series of HHs indicates a bullish internal structure.
• A series of LLs indicates a bearish internal structure.
________________________________________
Swing (Main) Market Structure:
Using internal pivots and previous swing levels, the main market structure is derived.
• A new swing high (SH) requires the price to move above the previous SH.
• A new swing low (SL) requires the price to move below the previous SL.
________________________________________
Probability Calculation:
Pivot levels forming the internal structure are coded as five-element sequences.
There are 64 possible combinations of such sequences made from consecutive PH and PL values.
Each pattern’s frequency from its starting candle is tracked.
To make it more understandable:
For example, after the four-sequence “HH, LL, LH,HL”, either HH or LH might follow.
The table shows the statistical likelihood of both possible outcomes for the most recent four-element sequence on the chart.
________________________________________
How reliable is it?
To assess reliability, results are calculated from the beginning using:
Success Rate (Suc. Rt) = Number of Correct Predictions / Total Predictions
This value is added to the table for reference.
It’s important to note that no statistical outcome guarantees certainty—every result offers a different interpretation. What truly matters is to avoid getting stopped out 😊.
________________________________________
Menu Options:
Show/hide preferences and color selections can be customized via the indicator menu.
________________________________________
What’s Coming in Future Versions?
Features such as FVG (Fair Value Gaps) between swing levels, volume imbalances, order blocks / mitigation blocks, Fibonacci levels, and relevant trade suggestions will be added.
________________________________________
This is a BETA version that I believe will help simplify your market reading. I’d be happy to hear your feedback and suggestions.
Cheerful Trading!
Note di rilascio
- Fixed bug-Added option to show/hide "internal levels"
-Added width option to cisd levels.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.