@shevaxgod genuine question: name one sell side analyst who has left a public model up with a wrong call still attached. i can't think of a single one.
a professor in kanpur spent a lecture on a word from 18th century gambling
and quietly cancelled everything i believed about exits.
nptel, ten years ago. 134,000 views.
i'd guess almost nobody watched it to the end.
the word is martingale. a process where the expected next value,
given everything you know right now, is exactly where you already are.
no drift. no memory. no lean in either direction.
that's a market with no edge in it. here's what he proves about one.
optional stopping theorem: if your P&L is a martingale,
then for any stopping rule τ,
E[X_τ] = E[X_0]
any stopping rule. your stop loss. your take profit.
your trailing stop. your time exit. your gut at 3pm.
all of them return the same expected value. the one you started with.
you cannot exit your way into an edge. that isn't difficult. it's a theorem.
i spent a year improving exits on a strategy whose entries had no drift.
i thought i was tightening risk. i was rearranging zero.
the famous loophole is doubling after every loss - you do win
eventually, with probability 1. it also needs unbounded capital,
and that isn't a footnote, that's the entire trick. remove the infinity
and the expectation is zero again, just with a longer fuse.
skip to 3;15 where he writes the definition on the board.
it's one line, and it makes the rest of the course make sense.
no slides. no simulation. chalk, and a man calmly explaining
why the exit rule you're about to design is worth nothing.
Probability and Stochastics for Finance, lecture 8.
Dr. Joydeep Dutta, IIT Kanpur. free for ten years.
the test i now run before touching exits - it checks whether
the entry has any drift at all:
1️⃣ like + repost
2️⃣ follow me
3️⃣ comment "fix"
i'll DM it over.
a professor in kanpur spent fifty minutes on discrete random variables
and accidentally explained why my bot kept killing itself.
nptelhrd put it up eleven years ago. 22,000 views.
i'd guess about four of those people have a bot in production.
her subject sounds like nothing. a random variable is just
a number attached to an outcome. a coin, a die, a trade.
the part that got me is what comes after: every one of those
numbers has a shape — and the shape is not the average.
i had a kill switch in my bot.
five losses in a row and it stops for the day.
five felt conservative. five felt like a lot.
it isn't.
53% win rate, 1000 trades:
→ expected longest losing streak: 8
→ median: 8
→ one run in twenty reaches 12
eight in a row isn't the tail. it's the middle.
it's what a working strategy looks like over a normal thousand trades.
my kill switch wasn't protecting me from a broken bot.
it was shutting down a working one, about once a month,
and i kept restarting it at exactly the wrong moment.
skip to 14:31 where she gets to the geometric case.
that's the one that describes a losing streak, and she draws it
on the board in notation you could have followed at sixteen.
no slides. no simulation. a green board, chalk, and a pointer.
i moved the switch from 5 to 14 and turned it into a
"wake me up" alert instead of a shutdown.
it's fired twice since. both times the strategy was fine.
Probability Theory and Applications, lecture 5.
Prof. Prabha Sharma, IIT Kanpur. free for eleven years.
i rewrote the whole risk config after this. if you want mine:
1️⃣ like + repost
2️⃣ follow me
3️⃣ comment "fix"
i'll DM it over.
a professor in kanpur spent fifty minutes on discrete random variables
and accidentally explained why my bot kept killing itself.
nptelhrd put it up eleven years ago. 22,000 views.
i'd guess about four of those people have a bot in production.
her subject sounds like nothing. a random variable is just
a number attached to an outcome. a coin, a die, a trade.
the part that got me is what comes after: every one of those
numbers has a shape — and the shape is not the average.
i had a kill switch in my bot.
five losses in a row and it stops for the day.
five felt conservative. five felt like a lot.
it isn't.
53% win rate, 1000 trades:
→ expected longest losing streak: 8
→ median: 8
→ one run in twenty reaches 12
eight in a row isn't the tail. it's the middle.
it's what a working strategy looks like over a normal thousand trades.
my kill switch wasn't protecting me from a broken bot.
it was shutting down a working one, about once a month,
and i kept restarting it at exactly the wrong moment.
skip to 14:31 where she gets to the geometric case.
that's the one that describes a losing streak, and she draws it
on the board in notation you could have followed at sixteen.
no slides. no simulation. a green board, chalk, and a pointer.
i moved the switch from 5 to 14 and turned it into a
"wake me up" alert instead of a shutdown.
it's fired twice since. both times the strategy was fine.
Probability Theory and Applications, lecture 5.
Prof. Prabha Sharma, IIT Kanpur. free for eleven years.
i rewrote the whole risk config after this. if you want mine:
1️⃣ like + repost
2️⃣ follow me
3️⃣ comment "fix"
i'll DM it over.
@0x_fokki "100% identical" is measurable — crop the character region every 10 frames, embed, plot pairwise distance.
drift shows up as a curve long before your eye catches it.
@choopyplug1 i asked a model to compute the slope of a price series. it did.
price paths are differentiable nowhere — that slope doesn't exist. no error raised, just a number shaped like an answer.
a professor in kanpur spent fifty minutes on discrete random variables
and accidentally explained why my bot kept killing itself.
nptelhrd put it up eleven years ago. 22,000 views.
i'd guess about four of those people have a bot in production.
her subject sounds like nothing. a random variable is just
a number attached to an outcome. a coin, a die, a trade.
the part that got me is what comes after: every one of those
numbers has a shape — and the shape is not the average.
i had a kill switch in my bot.
five losses in a row and it stops for the day.
five felt conservative. five felt like a lot.
it isn't.
53% win rate, 1000 trades:
→ expected longest losing streak: 8
→ median: 8
→ one run in twenty reaches 12
eight in a row isn't the tail. it's the middle.
it's what a working strategy looks like over a normal thousand trades.
my kill switch wasn't protecting me from a broken bot.
it was shutting down a working one, about once a month,
and i kept restarting it at exactly the wrong moment.
skip to 14:31 where she gets to the geometric case.
that's the one that describes a losing streak, and she draws it
on the board in notation you could have followed at sixteen.
no slides. no simulation. a green board, chalk, and a pointer.
i moved the switch from 5 to 14 and turned it into a
"wake me up" alert instead of a shutdown.
it's fired twice since. both times the strategy was fine.
Probability Theory and Applications, lecture 5.
Prof. Prabha Sharma, IIT Kanpur. free for eleven years.
i rewrote the whole risk config after this. if you want mine:
1️⃣ like + repost
2️⃣ follow me
3️⃣ comment "fix"
i'll DM it over.
i halved one number in my bot's config.
the signal got 41% noisier. the market did nothing.
that 41% is √2. it isn't a bug, it's a theorem.
NPTEL. Prof. S.K. Ray, IIT Kanpur. Mathematics-1, lecture 8.
differentiable functions. 55 minutes, zero mention of markets.
the core point of the lecture:
continuity and differentiability are not the same thing.
a function can be continuous everywhere and have a derivative nowhere.
sounds like a curiosity you'd never actually meet.
you meet it every day. it's called a price chart.
brownian motion — the model sitting under almost every pricing
formula you've ever used — is continuous everywhere
and differentiable nowhere.
so "what is the slope of the price right now"
isn't a hard question. it has no answer. that's a theorem.
now look at your momentum indicator:
momentum = (Pt − Pt−n) / n
that's a difference quotient. the thing that's supposed to
converge to a derivative as n shrinks.
for a diffusion it doesn't converge. it diverges, like 1/√n.
→ lookback 20 → some number
→ lookback 10 → same market, 1.41× the noise
→ lookback 5 → same market, 2× the noise
→ lookback 1 → you are now measuring your data feed
your momentum reading is not a property of the market.
it's a property of the window you picked.
what i changed:
→ lookback is no longer a parameter i optimise
→ it's fixed by holding period, then never touched again
→ any signal that flips sign when i halve the window gets deleted
→ stability across windows is tested before profitability, not after
that third rule killed about half my signals. good.
a derivative that doesn't exist can still be computed.
that is the entire problem with computers.
to get the repo:
1️⃣ like + repost
2️⃣ follow me
3️⃣ comment "fix"
i'll DM it over.
and drop your lookback in the comments — i'll tell you what
happens to your signal when you halve it.
the lecture is free on NPTEL. eighteen years old, and still
the best 55 minutes i've put into this bot.
i halved one number in my bot's config.
the signal got 41% noisier. the market did nothing.
that 41% is √2. it isn't a bug, it's a theorem.
NPTEL. Prof. S.K. Ray, IIT Kanpur. Mathematics-1, lecture 8.
differentiable functions. 55 minutes, zero mention of markets.
the core point of the lecture:
continuity and differentiability are not the same thing.
a function can be continuous everywhere and have a derivative nowhere.
sounds like a curiosity you'd never actually meet.
you meet it every day. it's called a price chart.
brownian motion — the model sitting under almost every pricing
formula you've ever used — is continuous everywhere
and differentiable nowhere.
so "what is the slope of the price right now"
isn't a hard question. it has no answer. that's a theorem.
now look at your momentum indicator:
momentum = (Pt − Pt−n) / n
that's a difference quotient. the thing that's supposed to
converge to a derivative as n shrinks.
for a diffusion it doesn't converge. it diverges, like 1/√n.
→ lookback 20 → some number
→ lookback 10 → same market, 1.41× the noise
→ lookback 5 → same market, 2× the noise
→ lookback 1 → you are now measuring your data feed
your momentum reading is not a property of the market.
it's a property of the window you picked.
what i changed:
→ lookback is no longer a parameter i optimise
→ it's fixed by holding period, then never touched again
→ any signal that flips sign when i halve the window gets deleted
→ stability across windows is tested before profitability, not after
that third rule killed about half my signals. good.
a derivative that doesn't exist can still be computed.
that is the entire problem with computers.
to get the repo:
1️⃣ like + repost
2️⃣ follow me
3️⃣ comment "fix"
i'll DM it over.
and drop your lookback in the comments — i'll tell you what
happens to your signal when you halve it.
the lecture is free on NPTEL. eighteen years old, and still
the best 55 minutes i've put into this bot.
i asked codex to write me a trading bot.
it wrote the strategy in four minutes.
the three weeks after that were spent teaching it to say no.
that isn't the solver failing.
that's the solver telling you the question was malformed.
it's also most retail trading accounts.
i learned to write problems that way from an operations research
lecture. NPTEL, Prof. G. Srinivasan, IIT Madras. lecture one,
linear programming formulations.
not a trading course. fixed my trading anyway.
the whole discipline is one idea: the objective is the easy part.
anyone can write "maximize profit". the model IS the constraints.
so i wrote a bot with codex where the constraints came first
and the strategy came last:
→ max 2% of capital in any single position
→ max 6% total exposure at any moment
→ no new order while an unreconciled fill exists
→ hard stop for the day if realised loss passes 3%
→ if the feed is stale by 5s, flatten and sit still
the strategy file is 490 lines
the constraints file is 900
that ratio is the actual lesson.
it's been up 7 days across 2 restarts
it has gain 14,740$ of 41 trades
the rejections are the product.
comment "solver" and i'll send the repo.
open the constraints file first. the strategy will make sense after.
most people build a bot and bolt the risk limits on afterwards.
an LP won't even accept the problem in that order.
save this for when you write your own.
i asked codex to write me a trading bot.
it wrote the strategy in four minutes.
the three weeks after that were spent teaching it to say no.
that isn't the solver failing.
that's the solver telling you the question was malformed.
it's also most retail trading accounts.
i learned to write problems that way from an operations research
lecture. NPTEL, Prof. G. Srinivasan, IIT Madras. lecture one,
linear programming formulations.
not a trading course. fixed my trading anyway.
the whole discipline is one idea: the objective is the easy part.
anyone can write "maximize profit". the model IS the constraints.
so i wrote a bot with codex where the constraints came first
and the strategy came last:
→ max 2% of capital in any single position
→ max 6% total exposure at any moment
→ no new order while an unreconciled fill exists
→ hard stop for the day if realised loss passes 3%
→ if the feed is stale by 5s, flatten and sit still
the strategy file is 490 lines
the constraints file is 900
that ratio is the actual lesson.
it's been up 7 days across 2 restarts
it has gain 14,740$ of 41 trades
the rejections are the product.
comment "solver" and i'll send the repo.
open the constraints file first. the strategy will make sense after.
most people build a bot and bolt the risk limits on afterwards.
an LP won't even accept the problem in that order.
save this for when you write your own.
i asked codex to write me a trading bot.
it wrote the strategy in four minutes.
the three weeks after that were spent teaching it to say no.
that isn't the solver failing.
that's the solver telling you the question was malformed.
it's also most retail trading accounts.
i learned to write problems that way from an operations research
lecture. NPTEL, Prof. G. Srinivasan, IIT Madras. lecture one,
linear programming formulations.
not a trading course. fixed my trading anyway.
the whole discipline is one idea: the objective is the easy part.
anyone can write "maximize profit". the model IS the constraints.
so i wrote a bot with codex where the constraints came first
and the strategy came last:
→ max 2% of capital in any single position
→ max 6% total exposure at any moment
→ no new order while an unreconciled fill exists
→ hard stop for the day if realised loss passes 3%
→ if the feed is stale by 5s, flatten and sit still
the strategy file is 490 lines
the constraints file is 900
that ratio is the actual lesson.
it's been up 7 days across 2 restarts
it has gain 14,740$ of 41 trades
the rejections are the product.
comment "solver" and i'll send the repo.
open the constraints file first. the strategy will make sense after.
most people build a bot and bolt the risk limits on afterwards.
an LP won't even accept the problem in that order.
save this for when you write your own.
@shevaxgod worth separating two claims here. that the boom did the lifting is clearly right. that policy was irrelevant isn't - the 93 and 97 acts changed the baseline the boom then landed on top of.
i watched a game theory lecture to procrastinate on a bug.
NPTEL. Dr. Debarshi Das, IIT Guwahati.
an economics course. nothing to do with my code.
it explained the bug.
the idea is one line, and it's the whole of adverse selection:
in a game, the other player chooses whether to interact with you.
that choice is not random. it carries their information.
now read that as an order book.
your bot posts a limit buy at 100.
somebody sells to you at 100.
you did not "get filled".
someone looked at your price and preferred their side of it.
your backtest never models that decision.
it fills you whenever the price touches your level.
but the price touching your level, and someone choosing
to trade against you at that level, are two different events.
that's the whole gap:
→ backtest: fill = price touched
→ live: fill = someone wanted the other side
→ the second is a filter, not a coin flip
→ the fills you get are the ones somebody wanted to hand you
→ the ones you wanted are the ones that got away
market makers have a name for this. you're being picked off.
they price it into the spread. retail backtests don't price it at all.
which is why a limit-order strategy can look flawless
across two years of data and bleed from day one in production.
the market isn't a price series you act on.
it's a room full of people deciding whether to act on you.
save this for the next time your live fills
look nothing like your simulated ones.
the course is free on NPTEL. worth a weekend.
a bot made $81,323. do 25,511 trades. 46% win rate.
three numbers are in the post. the one that decides everything isn't.
start with what checks out:
25,511 trades ÷ 54 days = 472 trades a day
$81,323 ÷ 25,511 trades = $3.19 average profit per trade
$3.19 on a binary market = a very thin edge, repeated a lot
that's internally consistent. that's a market-making profile.
then the post shows its biggest trades:
$1,277 → $2,516 +97%
$1,059 → $2,205 +108%
$1,372 → $2,487 +81%
a near-doubling on a binary up/down market
is not an arbitrage window closing.
that's a position resolving.
you cannot run both stories at once:
→ market making earns thousands of ~1% wins
→ directional bets earn a handful of ~100% wins
→ one produces a flat grind
→ the other produces a staircase
→ the post claims the first and screenshots the second
now the number that isn't there.
on a binary market a 46% win rate only makes money
if your average entry sits below 0.46.
buy at 0.50, win 46% of the time:
(0.46 × 1.00) − 0.50 = −0.04 per unit
negative. every single time.
the whole system lives or dies on average entry price,
and that is the one figure the post never prints.
this isn't about whether the bot exists.
this is about which column you'd need to see to know.
no emotions.
no guessing.
just ask for the missing number.
i watched a game theory lecture to procrastinate on a bug.
NPTEL. Dr. Debarshi Das, IIT Guwahati.
an economics course. nothing to do with my code.
it explained the bug.
the idea is one line, and it's the whole of adverse selection:
in a game, the other player chooses whether to interact with you.
that choice is not random. it carries their information.
now read that as an order book.
your bot posts a limit buy at 100.
somebody sells to you at 100.
you did not "get filled".
someone looked at your price and preferred their side of it.
your backtest never models that decision.
it fills you whenever the price touches your level.
but the price touching your level, and someone choosing
to trade against you at that level, are two different events.
that's the whole gap:
→ backtest: fill = price touched
→ live: fill = someone wanted the other side
→ the second is a filter, not a coin flip
→ the fills you get are the ones somebody wanted to hand you
→ the ones you wanted are the ones that got away
market makers have a name for this. you're being picked off.
they price it into the spread. retail backtests don't price it at all.
which is why a limit-order strategy can look flawless
across two years of data and bleed from day one in production.
the market isn't a price series you act on.
it's a room full of people deciding whether to act on you.
save this for the next time your live fills
look nothing like your simulated ones.
the course is free on NPTEL. worth a weekend.