OPEN-SOURCE SCRIPT

[ZP] Fixed v6 test

106
Benefits
Alternate signal mode works correctly: signals only fire when switching from the opposite state.
No duplicate signals: plotshape fires only on state changes.
State tracking is reliable: CondIni persists across bars.
Cleaner code: removed redundant assignments.
Consistent behavior: long and short signals use the same state-change logic.
Testing recommendations
Test on multiple timeframes (1m, 5m, 15m, 1h, 4h, 1D) to verify:
Signals appear only on state changes.
Alternate signal mode requires switching from the opposite state.
No duplicate signals on consecutive bars.
Expiry logic works as expected.
These changes should make the indicator more reliable and predictable.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.