Strategy vault / Multi-timeframe
Parabolic SAR Stoch and Security Indicator Based Multi Timeframe Quantitative Trading Strategy
This strategy is called "Triple Insurance" quantitative trading strategy. It combines the signals of Parabolic SAR, Stoch and Security indicators to capture breakout trends. The multi-timeframe analysis realizes more…

Overview
This strategy is called "Triple Insurance" quantitative trading strategy. It combines the signals of Parabolic SAR, Stoch and Security indicators to capture breakout trends. The multi-timeframe analysis realizes more stable and reliable trading decisions through the combination of different periodic indicators.
Strategy Logic
This strategy uses the Parabolic SAR indicator to determine the trend direction and reversal timing. The Stoch indicator judges whether it is overbought or oversold. The Security function extracts the direction of longer cycle moving averages to determine the overall trend. The three are combined to form trading decisions:
When the Parabolic SAR dots convert to the downside, it is considered a bullish signal; when the dots turn upwards, it indicates bearishness.
Stoch K values below 20 are considered oversold, and above 80 are considered overbought. It is bullish during oversold and bearish during overbought.
The Security function calls longer cycle moving averages to determine the overall trend direction, enabling combined analysis between different time cycles.
When the above three indicators give bullish signals, go long. When giving bearish signals, go short. Strictly follow the principle of multiple indicator filtering to effectively filter out false breakouts and lock in true trends.
Advantages
The biggest advantage of this strategy lies in its multi-timeframe analysis. The three indicators judge price behavior respectively at short-term, medium-term and long-term levels. Parabolic SAR captures reversal timing and short-term trends. Stoch determines overbought and oversold conditions at present. The Security function determines the overall trend direction. The three complement each other to avoid interference from false breakouts effectively and seize opportunities of trend establishment.
At the same time, this strategy adopts multiple indicators for judgement and filtering to minimize the probability of misjudgement from a single one. The successive pass of triple confirmation ensures sufficient signal strength thus the correctness of trading decisions.
Risks
The main risks of this strategy lie in the appropriateness of indicator parameter settings. The step size and maximum step size of Parabolic SAR directly affect the speed of capturing reversals. The K value and D value smoothing cycles of Stoch need to match market characteristics. The selection cycle of the Security function also affects judgement. Improper settings of these key parameters may all lead to wrong trading decisions of the strategy.
In addition, the principle of multi-timeframe analysis emphasizes the combination of indicators across periods. However, how to deal with divergences between long and short cycle indicators is also a problem worth paying attention to. A possible solution is to determine the overall direction with trend indicators and pinpoint specific exit timing using BREAKOUT indicators.
Optimization Directions
The main directions for further optimization of this strategy are in the following three aspects:
Increase adaptive step size mechanism. Allow Parabolic SAR parameters to adjust based on the degree of market volatility to better capture reversals.
Add stop loss mechanism. Exit with stop loss when price breaks a certain level towards the unfavorable direction. Control single transaction loss.
Introduce machine learning techniques. Use algorithms to train the correlation between price behaviors across different time periods. Strategy parameters combining different time frames can also be optimized through algorithms.
Conclusion
The "Triple Insurance" quantitative strategy makes full use of the complementary advantages of Parabolic SAR, Stoch and Security indicators. They judge the consistency of market behaviors from the dimensions of short-term trends, overbought/oversold levels and long-term moving averages to construct a stable and reliable trading strategy. Using multiple indicators helps filter out false signals. Multi-timeframe usage enables decision-making on the premise that verification is obtained across both short and long cycles. In general, this strategy has strong integration and high practicality, making it worthwhile for further research and application.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_float_1 | 0.01 | parabolicSARStart |
| v_input_float_2 | 0.01 | parabolicSARInc |
| v_input_float_3 | 0.2 | parabolicSARMax |
| v_input_int_1 | 14 | K |
| v_input_int_2 | 3 | D |
| v_input_int_3 | 3 | Smooth |
| v_input_1 | 180 | securityPeriod |
Source Pine Script
/*backtest
start: 2023-01-11 00:00:00
end: 2024-01-17 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy(title='kyenji', shorttitle='kyenji90', overlay=true)
// Parabolic SAR
parabolicSARStart=input.float(0.01)
parabolicSARInc=input.float(0.01)
parabolicSARMax=input.float(0.2)
psarDot = ta.sar(parabolicSARStart,parabolicSARInc,parabolicSARMax)
longConditionPSAR = psarDot > close
shortConditionPSAR = psarDot < close
// Stoch
periodK = input.int(14, title="K", minval=1)
periodD = input.int(3, title="D", minval=1)
smoothK = input.int(3, title="Smooth", minval=1)
k = ta.sma(ta.stoch(close, high, low, periodK), smoothK)
d = ta.sma(k, periodD)
h0 = 80
h1 = 20
longConditionStoch = k < h1
shortConditionStoch = k > h0
// Security
securityPeriod=input('180')
longConditionSecurity = ta.crossover(request.security(syminfo.tickerid, securityPeriod, close),request.security(syminfo.tickerid, securityPeriod, open))
shortConditionSecurity = ta.crossunder(request.security(syminfo.tickerid, securityPeriod, close),request.security(syminfo.tickerid, securityPeriod, open))
// Generate Signal
longCondition = longConditionSecurity and longConditionPSAR and longConditionStoch
shortCondition = shortConditionSecurity and shortConditionPSAR and shortConditionStoch
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)
Published by ChaoZhang on the FMZ strategy square · last modified 2024-01-18. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Parabolic-SAR-Stoch-and-Security-Indicator-Based-Multi-Timeframe-Quantitative-Trading-Strategy.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- Low Pyramid Risk Tracking StrategyPine Script · Multi-timeframe · 1d
- Multi Timeframe RSI SRSI Trading StrategyPine Script · Multi-timeframe · 1d
- Multi timeframe RSI and Moving Average Trading StrategyPine Script · Multi-timeframe · 1h
- Aggregated Multi timeframe MACD RSI CCI StochRSI MA Linear Trading StrategyPine Script · Multi-timeframe · 1m
- Multi Timeframe EMA RSI AO PSAR Dynamic Stop Loss and Take Profit StrategyPine Script · Multi-timeframe · 1d
- Long and Short Opening Strategy Based on Multi Timeframe Moving Average and MACDPine Script · Multi-timeframe · 1h