## StrategyQuant X Workflow

#### Goal = 3 strategies per market

- Make sure goal can adhere number of simultaneous trades of your broker
- 1 Fuzzy strategy on 1H
- 1 Random strategy on 4H
- 1 Fuzzy strategy on 1D
- 1 Classic trend following strategy on 1D

#### Build - STAGE 0

- What to build
- StopLoss: required | ATR 0.8-2.2 | Period 20 | NOT Use indicator levels
- ProfitTarget: required | ATR 1-4.0 | Period 20 | Use indicator levels
- Data
- Only test until 31.12.2019, remaining data is for second OOS Test (Trump/Corona Test)
- Test last 6 years (last years are more important hence markets are not stationary)
- IS 70%, 30% OOS
- Building Blocks
- Focus on Indicators, not on predefined conditions
- Pullback (rare, high WR, needs high SL, psychological demanding)
- Breakout (Stop-Order, WR ~40%, usually trend following, therefor PT not require, but trailing)
- Mean Reversion (after a trend, price went back to MA, prefered Limit-Orders, only for markets that are not trending)
- Trend follower (higher timeframe only 4H+)
- Fuzzy Logic (55%-95% of 3-6 conditions have to be fullfilled)
- Money management
- Initial capital: 10.000
- Fixed size: no (with SL by ATR, each trade will have different trade size in money)
- Risk fixed %: no (equity curve will not be normalized)
- Fixed amount: 100$ per trade flat per 10K capital
- Cross check
- Monte Carlo trades manipulation (250 sims | randomize trade orders | full sample | resampling)
- Filter are same as in MC trades Retest

- Higher backtest precision
- Net profit of precision-test >= 70% of orig. Net profit | SQN > 2.0 | CalmarRatio > 1.66 | Stability > 0.75

- Ranking
- Weighted fitness: SQN * 1 | Complexity * 1
- Automatic filter: all + add warnings
- Custom filters: # of trades >= 150 | Winning Percent(IS+OOS) >= 40% | SQN Score(IS) >= 1.8 | SQN Score(OOS) >= 1.4 | Avg. Trade >= 5

(make sure strat dont loose Alpha in OOS)

#### Retest - STAGE 1

- Data
- Slippage: "1" is enough for Forex, allways according to markets (as example Gold is 100+.).
- Turn off Ranking custom filters, wont work anyways unless you define the correct retested input data.
- Monte Carlo trades manipulation (test for random market timings/occurences)
- 1 tests with 1000 sims | full sample | resampling
- Filter Max DD % (@ 95% confidence) <= 15%
- Filter Ret/DD ratio (@ 95% confidence) >= 2.5
- Filter Net Profit (@ 99% confidence) > 0
- Higher backtest precision
- Net profit of higher precision >= 70% of orig. Net profit
- SQN of higher precision >= 2
- CalmarRatio of higher precision >= 1.66
- Stability of higher precision >= 0.75
- Monte Carlo retest (test for broker, price peaks)
- 2 tests with 1000 sims | full sample | selected TF only
- Randomize history data: prob. 30% | change 12%
- Slippage 0-3 (~1 x spread of symbol)
- Filter Max DD % (@ 95% confidence) <= 15%
- Filter Ret/DD ratio (@ 95% confidence) >= 2.5
- Filter Net profit (@ 95% confidence) >= 65% of Net profit
- Filter manually: MC channel has to be symmetrically above/below orig. equity curve (Risk and Reward have to be symetric)
- Monte Carlo retest (test for overfitting)
- 1 tests with 1000 sims | full sample | selected TF only
- Randomize strategy params: prob. 20% | change 25% | symetric
- Filter same as MC above
- Filter manually: check for a) stagnating equity curves b) strats that differ a lot from orig (then its curve fitted)
- OOS Trump Tweets/Corona test
- Test 1.1.2019 until today
- Filter Profit factor >= 1.3
- SPP / Overfitting test
- Sys. Param Permutation | 5000 sims
- Filter % of Profitable Optimizations > 90
- Filter Average profit (in $) of all optimizations > 100
- Filter Net profit (Median) >= 65% of Net profit
- Filter Ret/DD Ratio (Median) >= 2.5
- Filter Max DD % Ratio (Median) <= 15%
- Walk-Forward Matrix (usually skip, only when too many strats pass all other)
- 5000 tests | Simulated IS, Exact OOS | Percent, Floating
- OOS 10-60 Step 5
- Runs 5-20 Step 5
- Value distribution 30% up/down | 12 max steps
- Filter recommended conditions

#### Improve manually - STAGE 2

- Exclude negative trading days? (eg. dont open on friday)
- Demo for min. 2 weeks and compare calculated SQX trades with real trades of your platform

#### Improve exit - STAGE 3

- Load strategies from Stage2 into Builder "Improve existing strategy"
- Choose only the exists, everything else is same as in builder
- Weighted fitness: 2* Ret/DD | 1* Max DD %
- Repeat all retests from Stage 1

#### Improve all parameters - STAGE 4 (high risk of overfitting)

- Load passed strategies from Retester STAGE 3 into Optimzer
- Simple Optimization | Max 20.000 | Recommended parameter | Opt. also trading options
- Value distri. up/down 32 | Steps 8
- Repeat all retests? Not necessary, results will be overfitted. But yeah sure, go test, allways!

#### Combined portfolio - STAGE 5

- Filter correlated assets
- How? Todo
- ? RSquared of Asset 1 Diff vs Asset 2 Diff
- Filter similar algos - in SQX
- Run the strats without any robustness test, but with 1min precision
- Sort by Ret/DD Ratio, eyeball equity curves, remove those that that are too equal to another strat
- Click all, create Portfolio; check equity curves of portfolio parts; how many do they visually overlap?
- Correlation by Monthly (on daily trades), Weekly (on 4h trades), Daily (on 1h trades) | Correlation of Profit/Loss | Allow negative correlation
- Check pseudo-code, if there are really different
- Filter similar algos - in QuantAnalyzer
- Select all in "Portfolio Master"
- Brute force
- Number of strategies in portfolio = min 2, max 2 (if all are breakout strats)
- Rank by Return / Drawdown ratio
- Correlation Settings = 0.3 Profit/Loss per Day
- Allow negative correlation
- Data range = recent lookback
- Choose a combined strategy and click "Analyze" button, check overlapping equity curves (source)

#### Enjoy da Pips - LIVE

- Avoid over-leveraging (too many trades in same direction of one symbol)
- Risk reduction with "escape rules"
- Economic News
- Price Shock