Laurent Bernut Short Selling Course - Improved Regime calculation

Hi All!



Love the course!



I was wondering if a notebook can be made in the course with the improved swing calculation in terms of calculating the current regime of a market instrument.

kind regards and thanks,

Andrew



 

Hi Andrew,



Thank you for the feedback!



Regarding the suggestion to add the notebook, can you please share more details on what improvement in swing calculation are you referring to?



We do improve our courses from time to time. If you should share more details we can add this enhancement to the course!



Thanks!

Hi @Gaurav !



The course has an extension notebook in section 7 called lagless swing detection.



I was wondering if i notebook could be made in terms of using this swing detection to calculate the regime.



Kind regards and thanks,

Andrew

Hi Andrew,



Thanks for the clarification!



The optional notebook in section 7 shows how the 'swings_argrel' function eliminates lag and is more responsive.



In the other notebooks, if you wish to use this lagless swing detection, you need to use the 'swings_argrel' function instead of the 'swings' function being used there.



We have noted your suggestion to provide a notebook of the same, but in the meantime, do try it out using the 'swings_argrel' function yourself!



Thanks and regards.

Thank you @Gaurav! very much appreciated.

do you use the swings_argel funciton or the swings_fp function?



Kind regards and thanks,

Andrew

Hi Andrew,



The swings_argel is more responsive. This uses time discriminant. 

The swings_fp is less responsive but more accurate. This uses time and prominence.



Hope this helps!

Regards.

Hi @Gaurav, I tried to recreate the notebook with the improved swings but i am gettting an error.



Can i possibly send you the note book.



Best,

Andrew







 

Hi Andrew,



Please share your NB and/or data files at quantra@quantinsti.com.



Regards.

Hello Gaurav,



Unfortunately, both  swings_argrelan and swing_fp, are using argrelextrema and find_peaks. These functions introduce look-ahead bias, which causes them to produce significantly different results on real-time data compared to historical data. Do you have any thoughts on how to address this issue?

Please review and provide a fix.

Hi Nikolay,



This query has been answered by the author of the course on this thread.