You are on page 1of 20

Quant Trading Notes

Comments Section:

Kevin Davey

Development Process

https://youtu.be/MyTsHK8CsQw

What’s the Point?


When developing a system, you want to make sure you have a multi-step, objective process.
It gives you sort of a filtration process to see if the strategy is worth moving on to the next
step. Think of it as a Strategy Factory of a constant flow of strategy creation (as you will be
creating multiple strategies).

For effective strategy building, each strategy must pass each phase of building,

Most may fail, but this is the best way for objective and fact based data.

Performance Goals and Objectives


You should ask yourself, what is the
goal of your system? Which market
will it trade? Roughly what are you
looking to earn?

Trading Ideas
What do you want your system to
be ? How will it work? In Kevin
Davey’s Soybean example, he
decided that when volatility was
above average, he would go with
the momentum,and use a widestop
for his trade to have breathing room.

Limited Feasibility Testing


Instead of using a lot of time and data to test a huge sample size at the start, he decided to
start on a small piece of two year data, to quickly see how it worked, and if it would be
viable. You don't want to get into in depth testing if you don’t have a good idea.

Walk-Forward Simulation and Optimization


This creates out of sample data for your trading system, as in sample results are not as
effective for selecting the best parameters.

Monte-Carlo Simulation
You will input the parameters of the tests and trade data, and it will run a test for you. This
will give you useful metrics like risk of ruin, drawdown, return, etc. “Monte Carlo methods, or
Monte Carlo experiments, are a broad class of computational algorithms that rely on repeated
random sampling to obtain numerical results. The underlying concept is to use randomness to
solve problems that might be deterministic in principle.”

Incubation
Instead of trading your
system live as soon as you
are happy with it, Incubation
allows you to watch a strategy
before trading it live, to test
for mistakes. Here, you would
take an equity curve from
OOS, and put it into
incubation, by drawing a line
on the near right side of your
graph. This is more of a visual
discretionary test. If you can see that the line is significantly different on one side, you would
know either there was a significant change in the market, or something went wrong with
either your strategy or the way you optimized it. Changes in the equity curve line shouldn’t
be too erratic, and here you’ll see that Kevin’s incubation was successful, so he moved on to
the next step of the development process.

Diversification and Position Sizing


Because we trade multiple strategies for diversification, we need to make sure that our new
strategy actually adds value to our overall strategy (culmination of all strategies). You want to
see if it enhances and makes the equity curve smoother,

Full Size Real Money Optimization


Here we can compare the actual performance of the system compared to it’s expected
equity curve from testing. If the system’s performance surpasses the performance of the
tested equity curve, it has proven to be robust and effective. If it stays below the equity curve
for too long, you should eventually question the effectiveness of your system, and maybe
even discontinue it after a while.

Manual WFA
https://youtu.be/A5izhMLirBE

Here, you want to test in overlapping chunks of data. So, you test the first period of
in-sample optimization, and get the best parameter, to use for the first OOS optimization.
Then you test for the best parameter on the second overlapping in sample optimizations,
and find the best parameter, which will be used for the second OOS optimization. So on and
so forth. Once you have attained all of your best OOS optimizations, combine them into one
test, and set them to run on their out of sample dates. For instance, you would run a test
where the stop loss is set to 850 for 2013, 975 for 2014, and 650 for 2015, and see how the
equity curve looks in total of the three years.

Trading Tips
Uncorrelated Strategies
Do not trade two long strategies on the same instrument, or two short strategies. Or maybe
even two trend systems. Keep them uncorrelated, so their drawdowns happen at different
times, ad your equity curve can smoothen out better.

Sufficient Data Size


https://youtu.be/IB_Qf3ZKPP4

It’s important to test with an optimal data size, preferably ten years. Trader A tests a system
on 6 months of data, with a great looking equity curve. You
would’ve completely F’d Yourself over. This is what a lot of us
were doing with the traditional NNFX way of testing
Trader B tests this same system, with 10 years of data
instead, and the equity curve looks drastically different.

Same strategy, but as you can see with more years of testing,
the accuracy of the test and the information becomes more
useful and effective.

Commissions and Slippage


https://youtu.be/xTjq76vQlA4

The equity curve for a backtest with and without commissions and slippage are significantly
different. We want our tests to give us a very realistic interpretation of what our system is
capable of, so simulating realistic commissions and slippage values is paramount. Here is an
example.

The diagram on the right and left are the same system. The left one without simulated
slippage and commissions, and the one on the right with slippage and commissions. See
how if you went into live trading, you would’ve gotten bodied!!!

Look Inside Bar Backtesting (LIBB)


https://youtu.be/ISgsISB16Uc
What happens when your profit target and Stop loss are hit in the same bar?
On the left we have an equity curve with LIBB backtesting and on the right we have the one
without. As you can see, depending on the sample size and tightness of profit targets and
stop losses, a slightly profitable or non-profitable system, can be disguised as an extremely
profitable system. Don’t get bodied out here!

ISD Based Decisions


https://youtu.be/TcBKT-m2tQA

Never base your decisions using in-sample data. Your profits will always be lower, your
drawdowns will always be greater, and your position sizing won’t be as effective.

Exotic Bar Types


https://youtu.be/yRRtH1r2ySc

Don’t use renko bars, exotic bars, etc. They do not backtest well. They give wildly different
results, with awkward calculations and tend to repaint at times.

Trades per Parameter


https://youtu.be/kSyuGC9Vy_E

You need an ample amount of trades per optimized parameter. The more trades you have,
the better chance for robust parameters.

Limited Order Touch


https://youtu.be/oA5UdkWHENc

You should never assume limit orders are filled when touched during your backtest. It will
skew your results. Always backtest conservatively.

Diversify
https://youtu.be/cbxVrn8ZPYg
Trade multiple trading strategies. Profits add and drawdowns don't, creating a smoother and
easier to trade equity curve. This way if one tanks, the others can help, and vice versa.

Quitting
https://youtu.be/goViCxoWVfo

This isn’t your typically motivational message. The whole point of backtesting results is for
you to determine what the next best approach of your system is, and sometimes that is to
find something new.

Use backtest results like Monte Carlo and Probability cones, drawdown values, etc. to
determine if the strategy is no longer tradeable, and move onto a new strategy. You should
always know what will be your strategy stop signal ahead of time, and write it down, so that
you are ready for when this time comes.

Not to worry though, you will be making plenty of strategies regardless.

Avoid Markets
https://youtu.be/V90f_exfTSE

This is optional, but sometimes you should avoid markets that are not doing what you want
them to do, until they decide to. For example

Why trend trade or counter trend trade Metals or currencies, if they are constantly
consolidating? Why not wait until they are trending, or exhibiting counter trend behaviour?
The decision is up to you.

Look at the Months


What type of system will you create? It's simple to get a quick bias for what may work. Look
at the previous month or two of data on the daily timeframe, and what type of behavior is
being exhibited? Are the markets trending? Use a trend system. Are the markets
consolidating? Don't trade it. Are the markets exhibiting counter trend/ mean reversion
properties? Make a mean reversion system with the rsi or stochastic! Easy peasy! These are
not guaranteed to work, but definitely more likely, and a great place to start. Kevin posts a
weekly market update to tell you whether the trend is up, down, sideways, counter-trend, etc.
He has great videos to utilize for trading and it’s ideas.
Trading Plan
So you decided you want to trade algos? Where do you even start? How do all the
processes come together?

https://youtu.be/sQgITAMjMs8

https://youtu.be/9nON0uzz1SI

Checklist 1
● Always avoid overconfidence
● Plans are a good way to improve
● When your making a Plan:
○ How’d past strategies perform?
○ What strategies are you currently trading?
○ What goals are you planning to achieve?
○ How will you get there?

See how you anticipated your strategy to perform in the backtest, as opposed to how it
actually performed. Also look at the history of strategies you’ve developed. Have they been
profitable? Have the stock indice strategies been doing the worse? You can do this on a
monthly, or annual basis. Figure out what is working and what is not. ALways be in constant
research and development.

Checklist 2
- How much did mistakes and errors cost you?
- What types of Money Management systems did you use? How’d they have an affect?
- Which systems are working? Which aren’t?
- The definition of insanity is repeating the same process, and expecting different
results
- What capital do you have available?
- What strategies do you plan to trade in the future
- Write down 20 unique ideas.and come up with 1-3 more each month!
- What type of Money do you have? Prop firm? What are you going to spend money
on? New software? Market data?
- What time will you allocate to building systems?
- Capital investments: Trading software, courses, and webinars

Goal Checklist
-Net Profit?
-Maximum drawdown?
-Quitting Point?
-Time for Trading?
-Trading Books?
-Strategies Evaluated?

Unorthodox (Entries)
https://youtu.be/zCng1Uy_gjg

❏ Unorthodox Entries are entries which are used by few, if any.


❏ Using indicators in ways that very few people use, increases the chances of them
working.
❏ Find your own Candlestick patterns
❏ Read Trading Books
❏ Don't dismiss until you test no matter how logical something seems!
❏ Ex. Negatively correlated or Positively Correlated Currencies
❏ Market Observation is important for coming up with ideas
❏ Unique TFs like H& or M45
❏ Base entries on a second market
❏ Use a higher TF to base signals, and execute on a shorter TF
❏ Expiriment w Natural Hour bars or session hour bars
Orthodox Entry Ideas
https://youtu.be/D_P_XqB5nHs

1. Go with the momentum after a big range (you can set range values based on ATR?)
2. Breakout Report Play, go with the trend after a news report or session.
3. Look for low volume reversal points (mean reversion)
4. Go with the Trend, Regular Breakout
5. Money flow index cross above or below threshold
6. Buy at highest high and sell at lowest low
7. 3x3 pullback : if you are in a 3 month uptrend And price comes down and your in a 3
week downtrend, it’s a good time to buy. And Vice versa.

8. Enter on the Breakout of a longer term trend (read book about following the trend)
9. Have a short instrument and a long instrument, and enter on divergence and
convergence(riskier)
Certain conditions add a bias, and when the bias is above or below a certain
threshold, you would short or long
10. Dueling Momentum, go with short term momentum against long term momentum
Do not let Entries make you feel in control of the market. They also do not need to be over
complicated. Simple entries prove to be the most effective.

Price Action Entries (symmetric!)


1. If the close is less than the close of x bars ago Then buy the bar at the next candle
and reverse the signal for the other direction.
2. Recent # of higher barss closes above the threshold go long and reverse for short
3. Price breaks resistance
4. Bullish Harami Candlestick Pattern
5. Outside Bar inside bar, positive momentum over last Pcount Bars
6. Of the number of up bar closes exceeds the number of down bar closes and the
current close is less than the close +x+ bars ago, then go long at next open
7. If the number of higher highs exceeds the number of lower lows, and the current
close is less than the close +x+ bars ago, then go long at the next open
8. If Up bar count is greater than down bar count, and the current close is greater than
the close +x+ bars ago, then go short at the next open
9. Do 8 in reverse momentum
10. If current bar is a doji, go long if the last +x+ amount of bars is up
11. Do 10 in reverse momentum
12. Support and resistance zones
13. Bearish and bullish engulfing bars
14. Bullish and bearish harami
15. Inside and Outside Bars paired w/ Momentum
16. Morning and Evening star

Great Performance Metric


Expectancy: Reward*WIn% - Risk*Loss%
Doubt all EC’s unless you know how they were built!

Do’s

https://youtu.be/5mWe4IEITJs

An entry is simply how you will get into the market.


1. Test them on historical data
2. Trade ONLY what you test
3. Trade numerous GOOD strategies. They don’t all have to be great! This is why
diversification is key
4. Avoid the Don’ts
5. Do use a proper development process
6. Test EVERYTHING
7. Experiment long trades in long term bull regimes and vice versa
8. You do not have to start a system from scratch

Don’ts
1. Don’t just assume a Guru is telling the truth
2. Don’t believe a system works without having it tested
3. Don’t assume something works just cuz it sounds like it makes sense
4. Don’t test with too many variables. 4 is the max you should aim for.
5. Don’t test on ALL of historical data
6. Have low expectations from your tests. As extreme as it sounds, assume your algo
will make you 1% per month even if it says 15. Any Backtest can do better or worse
7. Indicators with too many variables are risky. They add extra parameters to optimize
8. Do not expect anything to be certain
9. Do not expect every strategy to work. Make 20 and expect 0-2. The point is to be in
in a constant phase of R&D (Research and Development)
10. Don’t over-optimize
11. Don’t feel like you have to turn your system off during news periods. For every
decision you make, there has to be statistical proof. Your Algo may or may not be
bettered by news, but if the goal is to follow it, and you haven’t tested with news
filters, leave it on.
12. Don’t trend line trade for entries and exits. Price may not touch and you’ll be
screwed!

Symmetric Entries: use the value of x for long and x for short
Asymmetric: Use the value of x for long, and Y for short(be careful more parameters
required)

Orthodox Exits
1. Indicator based exits: if tdfi goes short, exit the long position for example
2. Time based exits. Exit at x time or x session
3. Profit target exits, stool loss exits

Facts on Algo Trading


https://youtu.be/uF1nWRCr0GM

1. 90% of Algo Traders Fail


2. Most people fake it, and are not actually making money
3. Fake testimonials, scams, faulty methodology, false educators, etc. are all over the
place. Protec yoself
4. If it sounds too good to be true, ignore it.
5. Drawdown goes up with return
6. Have realistic expectations. Look at hedge fund rankings and see how your ROIs
compare to theirs : https://www.barclayhedge.com/
7. Need a proven method and a plan
8. Try trading with certain market sectors (agricultures, currencies etc. spread your risk
throughout all these sectors)
9. It’s okay to search media like blogs. Websites, and magazines for trading ideas, but
that doesn’t mean they will always work
10. Don't be a HFT scalper. You're competing with millions of dollars worth of technology.
11. Have sufficient capital or else you will fail losing a winning game.
12. Understand basic probability (Risk of Ruin, simple statistics, confidence intervals etc.
EVERYTHING IS UNCERTAIN!)
13. Do not let your emotions derail your trading. Psychology is extremely useful.
14. You need to actually love trading and developing strategies
15. You need capital and a technical edge
16. Trying to fit noise doesn't work, hence why using a minimal amount of parameters the
best option
17. More time = More strategies

Automation Tips
1. Automation does not eliminate emotion but reduces it. Money and emotion will
always be correlated
2. Your job is just not to screw up
3. Keep you consistent
4. Can better find an edge
5. You don't need stops
6. Allows for efficient execution of rules
7. Automated should not mean Unattended
8. If your oversight, strategy, or setup is bad, you will lose bread! Your computer does
what it tells you
9. Make sue your broker supports automation
10. Determine required steps
11. Test it out 100 times to make sure it works properly

4 More Secrets Video


https://youtu.be/Ro3rQMMWzOs

-Have a Platform where you can backtest


-Be able to code or use an automatic code service like dreema
-Use higher TF bars. M1 bars have way to much noise
-Go live when you have enough strategies. Aim for 10-15. Trade different asset classes

Nasty Pitfalls
https://youtu.be/uOgceqyYn-8

1. The Golden Rule of Trading, if the system is too good to be true, it probably is. No
one will sell you the holy grail

2.
3. Everything in backtesting is hypothetical. It is only real if it happened in your account
4. Curve fitting and over-optimization
5. Don’t trust systems that only show the performance of closed trades
6. Stay away from illiquid markets. Ex. orange juice m1. Gives unrealistic stats
7. Don’t be undercapitalized
8. You can’t optimize your way to success
9. Don’t try to optimize noisy markets. Noise is never consistent
10. Don’t let simulator trading take over, it can create bad habits
11. More param. Does not mean better. Use 4 or less params. Use the same variable for
entry and exit, and use less than 100 iterations(slight param optimization)
12. Don’t spend too much time trying to make something great! Have a return to
drawdown ratio threshold, to tell you the chances of a strategy being too bad,
or to good.
13. Make sure to forward test in real time (incubation)
14. Calculate the avg monthly profit from backtest and the real time monthly profit from
forward test. Then divide the realtime and backtest by each other to get a ratio or
value. Over time you will figure out what value works best for you to optimize your
own systems.
15. Use E ratio. What is the maximum profit during any point in the trade, and what
is your maximum loss during any point? Your max profit over your max loss
should be greater than 1-1.5 as another test for real edge. Calculate this for
entry rules. Include slippage and commission. This ratio was researched by
Kevin davey for years! You can develop your own strategy eventually.

16.
17. Last thing you want is a coin flip entry
18. You do not need your strategy to work on every timeframe
19. If you can’t at least dedicate 10 hours per week your boned
20. You need Money! Don’t forget Risk of Ruin. Small accounts get wiped bozo!
Use a risk of ruin calculator
21. Don’t use WR as a metric
22. Don’t be impatient
23. Do not expect to double your money or create 50 effective strategies in a
month
24. Not having entry ideas will be your downfall! You need ideas to create systems.
25.
26. Anyone can create a backtest. Real time results are king
27. Correlation tests are important
28.

Position Sizing
https://youtu.be/3SfzrQWYkiE

Simply increasing the size of your positions depending on a certain strategy. There is no
write or wrong answer for position sizing, and every system has their own methods.

You would test to see which position size strategy works best for your system in backtesting.
Do not go overboard here. This can have a significant Positive, or negative impact on your
equity curve.

1. Fixed Size
Doesn’t take advantage of compounding. Extremely safe.
3. Percent Risk

4. Contract per x amount of Equity


Safer than Risk %
5.After each loss, double amount of contracts(martingale)
Lets not do this lol

With the right position sizing method, you can either blow your account out, or get
really good returns. You really have to test this. There is no one size fits all. We want
amplified risk, and little reward. Here is the formula for this when seeing how position
sizing affects our strategies.

You also need to be capitalized sufficiently

There’s tons of different ways to go about this. You can also use monte carlo analysis
to test them as well. And portfolios! Here are some books!
You may not have to spend too much time on this. It;s something Kevin doesn’t
spend too much time on. But you can definitely find some hidden gems here.

Reward and Risk Generally go together.

It’s also very easy to over optimize results. Be careful.

Gold w diff position sizing strategies.


Stop Losses
Test for Dollar stops which are stops of a certain amount of money, or ATR stops like 3xATR.
You don’t always have to use ATR stops man!

Market Turmoil
It's cool to take breaks from the marker
Use time filters to only trade at the most liquid times
Monitor Spreads
Monitor strategy correlation to avoid drawdown at the same time
Use a kill switch to stop all your strategies
Limit losses don’t improve profit
Set a no trade if the True range of the last 5 bars is extreme

Tests You MUST do:


Entry Edge Test: Make sure your entry has an actual edge
Enhanced Exit Test: Make sure your entry has an edge
WFA: The Correct Walk Forward and OOS optimization
Monte Carlo SImulation: Monte Carlo Simulation
Live Evaluation Test : Forward Test
Correlation Test: See if It is correlated with your other strategies

Risk Reduction Techniques


1. Have a signal delay after x amount of losses, to prevent u from losing over and over
again (can’t take trades for X amount of bars)
2. Have a daily Loss Limit
3. Try Being flat (no open trades) on the weekend
4. Turn off your system(s) during high volatility
5. Psychological benefits > monetary benefits and that’s ok!
6. Test Before hand to avoid curve fitting
7. Equity Curve Trading (Depending on your EC)

Keep Emotions out!


1. Don’t cheek EC throughout the day
2. Understand that Emotion is heavily involved in Algo trading Especially with real
money. Embrace this
3. Test w/out discretion
4. Desensitize yourself to real money trading
5. Walk away
6. DOn’t worry about things you can’t control
7. Don’t develop strategies when you are in an emotionally positive or negative state
8. RELAX. You’re really going to let some numbers ruin your day? Your in control

Stops
1. Parabolic stops
2. Chandelier Exit
3. YoYo Exit
4. Time based
5. Stop and reverse (Kevin loves these ones)
6. Dollar Target
7. Moving Avg exit
8. Equity Curve MA stops (stop when ur equity breach the MA threshold)
9. Other indicator exit
10. Channel exit
11. Mean reversion exit
12. Small stops and profit targets are good for counter trend trading

Correcting Mistakes
Make a chart.

Continuous Improvement
That’s all Folks
Good Luck WIth your Algo Trading Endeavours!

You might also like