OPEN-SOURCE SCRIPT
Half Life Mean Reversion

Its a tool for those who work in statistical arbitrage/pair trading in stocks or asset classes.
a high correlation between two assets does not mean, they will be "mean reverting" too.
half life tells us if they are mean reverting. lower half life is better.
Half life of mean reversion = time taken by the "price ratio" of two assets, to revert back, to half way to its mean.
script takes 3 lookback periods and calculates the half life of all 3 periods. Then gives it an acceptance score. lower is better.
run for different pairs and chose the one with least acceptance scores
a high correlation between two assets does not mean, they will be "mean reverting" too.
half life tells us if they are mean reverting. lower half life is better.
Half life of mean reversion = time taken by the "price ratio" of two assets, to revert back, to half way to its mean.
script takes 3 lookback periods and calculates the half life of all 3 periods. Then gives it an acceptance score. lower is better.
run for different pairs and chose the one with least acceptance scores
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.