I tried many variations. Latest params were the following:
Code:
// define the input params to use in GBM / BSM:
const double dbDaysInYear = 252.0;
const double dbMktSecondsPerDay = 23400.0; // US regular market hours make up that much (6.5h/day), excluding premarket and aftermarket hours
const double dbSpot0 = 100.0; // start with this stock price
const double dbVolaPct = 20.0; // historic volatility
const size_t uExpDays = 21; // 252
const size_t uHoldDays = 21; // uExpDays;
const double dbEarningsYieldPct = 0.0 ;
const double dbDividendYieldPct = 0.0;
const double dbStrike = 100.0; // 95.0;
// const size_t nBarsPerDay = 780; // ie. 30-sec bars @ dbMktSecondsPerDay
const size_t nBarsPerDay = 390; // ie. 60-sec bars @ dbMktSecondsPerDay
// const double dbBarSizeInSec = dbMktSecondsPerDay / double(nBarsPerDay); // 60 s, ie. 1 min
const double dbHedgeEveryNsec = 300; // 3600; // set this
const size_t uHedgeEveryNbars = size_t(double(nBarsPerDay) / (dbMktSecondsPerDay / dbHedgeEveryNsec)); // ie. 5 bars
.
But I think I finally grasp the hedging case for long options too. In an other discussion somewhere else someone wrote this:
Code:
"This means that if you hedge dynamically, then you'll/should make a tidy profit.
In fact, if you hedge continuously over the lifespan of the option, you should, theoretically,
make exactly the premium that you paid for the option, assuming BS pricing."
So, in the long option case dynamic hedging should result in a PnL of about the same size like the premium one had paid.
Yes, then it of course would make a big sense!
But the book and paper authors simply neglect to mention this important bit of information, and the poor reader like me just wonders where the logic is in what the book/paper author writes... ;-)
But I've not been able to replicate this yet, ie. to prove it, due to my q&d framework I quickly developed but which still has some bugs; will need more time to fix it.
If shorting is involved, then coding becomes a nightmare, I made this discovery many times... ;-(