OPEN-SOURCE SCRIPT
Dual TF Stochastic Strategy

Core Strategy Components:
Uses two Stochastic oscillators (Primary and Reference)
Both use 15-second timeframe (15S)
Primary Stochastic settings:
K Length: 12
K Smoothing: 12
D Length: 12
Reference Stochastic settings:
K Length: 12
K Smoothing: 15
D Length: 30
Entry Logic:
Long Entries occur when:
Primary %K crosses over %D
AND either:
Reference %D is ≥ 50 or < 20
OR Primary %K is close to Reference %D (within 0.15)
AND price is above Moving Average (if MA filter enabled)
AND during regular market hours (9:30 AM - 4:00 PM ET)
Short Entries occur when:
Primary %K crosses under %D
AND either:
Within tolerance of Reference %D
OR specific crossunder conditions met
AND price is below Moving Average
AND during regular market hours
Exit Logic:
Time-based exits:
At 3:30 PM ET
End of regular market hours
Technical exits:
Long positions: When Primary %K crosses under Reference %D
Short positions: When Primary %K crosses over Reference %D and Reference %D > 20
Pattern Detection:
Higher Low Pattern:
Current crossover %K > Previous crossover %K
Bullish continuation pattern
Lower High Pattern:
Current crossunder %K < Previous crossunder %K
Bearish continuation pattern
Risk Management:
Price difference filters:
Maximum price difference: 0.1%
Minimum price difference for shorts: 0.1%
Reference %D tolerance: 0.1%
Close %K tolerance: 0.7%
Strengths:
Multiple confirmation layers (dual timeframes, MA filter)
Clear entry/exit rules
Pattern recognition for trend continuation
Time-based filters to avoid volatile periods
Comprehensive alert system
Potential Limitations:
Short timeframe (15S) may generate more false signals
Tight price difference filters might miss some opportunities
Relies heavily on Reference %D levels
No stop-loss implementation visible in the code
Suggested Improvements:
Add stop-loss mechanisms
Implement position sizing rules
Add volume confirmation
Consider adding RSI or other momentum filters
Add backtesting statistics tracking
Best Use Cases:
Day trading in liquid markets
Markets with clear trends
Time periods with normal volatility
When price action aligns with Stochastic signals
Risk Considerations:
High-frequency trading due to 15S timeframe
Multiple entries possible in short timeframes
No explicit risk management beyond entry/exit rules
Market hours limitation might miss opportunities
Uses two Stochastic oscillators (Primary and Reference)
Both use 15-second timeframe (15S)
Primary Stochastic settings:
K Length: 12
K Smoothing: 12
D Length: 12
Reference Stochastic settings:
K Length: 12
K Smoothing: 15
D Length: 30
Entry Logic:
Long Entries occur when:
Primary %K crosses over %D
AND either:
Reference %D is ≥ 50 or < 20
OR Primary %K is close to Reference %D (within 0.15)
AND price is above Moving Average (if MA filter enabled)
AND during regular market hours (9:30 AM - 4:00 PM ET)
Short Entries occur when:
Primary %K crosses under %D
AND either:
Within tolerance of Reference %D
OR specific crossunder conditions met
AND price is below Moving Average
AND during regular market hours
Exit Logic:
Time-based exits:
At 3:30 PM ET
End of regular market hours
Technical exits:
Long positions: When Primary %K crosses under Reference %D
Short positions: When Primary %K crosses over Reference %D and Reference %D > 20
Pattern Detection:
Higher Low Pattern:
Current crossover %K > Previous crossover %K
Bullish continuation pattern
Lower High Pattern:
Current crossunder %K < Previous crossunder %K
Bearish continuation pattern
Risk Management:
Price difference filters:
Maximum price difference: 0.1%
Minimum price difference for shorts: 0.1%
Reference %D tolerance: 0.1%
Close %K tolerance: 0.7%
Strengths:
Multiple confirmation layers (dual timeframes, MA filter)
Clear entry/exit rules
Pattern recognition for trend continuation
Time-based filters to avoid volatile periods
Comprehensive alert system
Potential Limitations:
Short timeframe (15S) may generate more false signals
Tight price difference filters might miss some opportunities
Relies heavily on Reference %D levels
No stop-loss implementation visible in the code
Suggested Improvements:
Add stop-loss mechanisms
Implement position sizing rules
Add volume confirmation
Consider adding RSI or other momentum filters
Add backtesting statistics tracking
Best Use Cases:
Day trading in liquid markets
Markets with clear trends
Time periods with normal volatility
When price action aligns with Stochastic signals
Risk Considerations:
High-frequency trading due to 15S timeframe
Multiple entries possible in short timeframes
No explicit risk management beyond entry/exit rules
Market hours limitation might miss opportunities
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。