Compare a fast average (reacts quickly) with a slow average (the baseline trend). The classic moving-average crossover. Note the three distinct states — +1 long, −1 short, and 0 flat (in cash):
Signalt=⎩⎨⎧+1(long)−1(short)+0(flat / cash)if SMAfast(t)>SMAslow(t)if SMAfast(t)<SMAslow(t)if you choose not to hold a position
Prices (₹): day 1–5 = 100, 102, 101, 105, 108. Use fast SMA(2) vs slow SMA(4).
Day
Price
SMA2
SMA4
Signal
4
105
(105+101)/2 = 103
(100+102+101+105)/4 = 102
+1 long
5
108
(108+105)/2 = 106.5
(102+101+105+108)/4 = 104
+1 long
Why this step? SMA2 > SMA4 on day 4 → recent momentum has overtaken the baseline → go long. We entered after confirmation, accepting we miss the first 5 points to gain certainty.
Why this step? We were long into a rising day, so we captured the full move. Had the signal been −1 (short) we'd have lost 2.86%; had it been 0 (flat) our return would be exactly 0%.
Entered long at 100 on day te. ATR = 4, use k=2 ⇒ stop distance = 8. Price rises to 120 (new high since entry), then falls.
Stop=(maxte≤s≤tPs)−k⋅ATR=120−2(4)=112
Price drops to 111 → exit at ~112. Profit ≈ 112 − 100 = ₹12.
Why this step? The stop ratcheted up with the highest close since entry (from 92 at entry to 112 at the peak), locking in gains. It only triggers once the trend gives back one "ATR-unit" of movement — statistical proof the run is likely over.
Recall Feynman: explain to a 12-year-old
Imagine you're on a river in a boat. You don't try to guess where the river will bend. You just paddle with the current as long as it flows one way. When you feel the water start pushing you backward, you stop and get out. You lose a little each time you jump in and the current dies quickly, but sometimes you catch a long fast current that carries you super far — and that one big ride pays for all the tiny slips. That's trend-following: follow the flow, quit small when it turns.
A rule-based method that reacts to existing price trends (using past price/volume) to go long in uptrends and short/flat in downtrends — it never forecasts fundamentals.
Why does trend-following have an edge?
Herding and slow information diffusion create price autocorrelation (drift); the system harvests rare, large trends.
Formula for a Simple Moving Average of period n?
SMAn(t)=n1∑i=0n−1Pt−i
Moving-average crossover long rule?
Go long when the fast SMA rises above the slow SMA.
Daily strategy return formula?
rt+1strat=Signalt⋅rt+1 where signal is +1 (long), −1 (short), or 0 (flat).
What do signals +1, −1, and 0 mean?
+1 = long (own it, profit when it rises); −1 = active short (profit when it falls); 0 = flat/cash (no exposure, return = 0).
What is a trailing stop?
An exit that follows price at a fixed distance below the highest close SINCE ENTRY (often k×ATR), locking in gains as price rises.
Why must the trailing-stop max start from the entry date?
So a pre-entry price peak can't pin the stop far above current price and eject you instantly; the stop should ratchet from your own entry onward.
What does ATR measure and why use it for stops?
Average True Range = typical daily movement; scaling stops by ATR gives the trend room proportional to its own volatility.
Why is the EXIT more important than the entry?
Profits come from letting a few winners run far; the exit rule determines how much of a trend you capture.
Why is a low win-rate acceptable in trend-following?
Payoff is asymmetric — many small losses are outweighed by few large gains, giving positive expectancy.
Biggest overfitting danger in system design?
Adding many parameters/indicators curve-fits past noise; robust systems stay simple and test out-of-sample.
Dekho, trend-following ka matlab hai future ko predict karna nahi, balki jo price already kar raha hai usko follow karna. Socho ek nadi ki tarah — tum current ke against nahi lade, bas jis taraf paani beh raha hai usi taraf paddle karte ho. Jab tak trend upar ja raha hai, tum long rehte ho; jab trend palatne lage, tum nikal jaate ho. Iska core edge yeh hai ki markets mein herding aur slow news-spread ki wajah se price mein thoda drift (autocorrelation) hota hai — jo kal upar gaya, aaj bhi thoda upar jaane ka chance zyada hota hai.
System banane ke 4 hisse hain: kaunsa market, kab enter (entry), kab exit, aur kitna paisa lagao (position size). Sabse simple entry rule hai moving-average crossover — fast SMA jab slow SMA ke upar cross kare to long, neeche cross kare to exit/short. Ek baat clear rakho: signal ke teen states hote hain — +1 long (asset owned), −1 short (giravat pe profit), aur 0 flat (cash mein, koi exposure nahi). Flat ko short samajh lena galti hai. Backtest ka jaadu ek line mein: strategy return = signal × market return.
Sabse important cheez: exit hi asli strategy hai. Profit tab banta hai jab tum kuch bade winners ko lambe time tak ride karte ho. Isliye trailing stop use karte hain jo ATR (average daily movement) ke hisaab se price ko follow karta hai — trend ko "saans lene ki jagah" milti hai. Ek key point: trailing stop ka highest price sirf entry ke din se aage count hota hai, warna entry se pehle ka koi purana peak stop ko galat jagah pin kar dega aur tum turant bahar ho jaoge.
Yaad rakho: trend systems ka win-rate kam hota hai (35–45%), lekin phir bhi paise banate hain kyunki ek bada winner, bahut saare chhote losers ko cover kar deta hai — yeh hai asymmetric payoff. Isliye galti mat karna: losses ko jaldi cut karo, winners ko chalne do (CROWD yaad rakho). Aur agar 6 mahine loss ho raha hai to system "toota" nahi hai — choppy market mein drawdown normal hai.