Course Name: Short Selling in Trading, Section No: 8, Unit No: 4, Unit type: Notebook
Hi there,
Can you help me to understand why returns based on floor/ceiling regime change is calculated as follows?
data['floorceiling_returns'] = data['relative_returns'] * data['r_regime_floorceiling'].shift(argrel_lag)
I understand the lag is introduced to remove hindsight bias, however, I cannot fully appreciate why the returns earned today is dependent on trade made 'argrel_lag' days before?
If I am following this correctly, the argrel_window is the number of days before and after a price point where the peak/trough is found within this range and assigned swing high/low?
Many thanks,
Ryan
Hi Ryan,
Yes, you are correct that the signal is lagged by a few days to remove hindsight bias. And in practice, it is unlikely to wait for an entire month to conclude the swing occurred.
You can go through the last unit of the floor and ceiling section, lagless swing detection (Section 7 Unit 17) where the methodology to eliminate the lags has been discussed.
One approach in my opinion would be to use the low frequency data and then use the 20 lag period. For example, you can use 15 mins frequency data and go 20 periods back to detect swing.
Also, you can try reducing the lag period, let's say from 20 days to 10 days