|
Post by wealthwise on May 1, 2016 13:29:00 GMT
Objective: I want to know how to detect divergence btween two stocks trendlines? As you can see in screenshot upperchart is trend of Stock A, while lowerchart is trend of Stock B. Observation: Stock A is in uptrend for past 30 days. While Stock B is on down trend in last 30 days. What have i done till now:I have used linear regression slop function on both trnelines. But not getting correct and reliable results. I want to programmatically explore/ scan stocks which are in Divergence with stock A in past 30 days based on trend. Can someone please help me through this?
|
|
mistercuan
Rookie
from Indonesia
Posts: 10
Received Likes: 2
|
Post by mistercuan on May 12, 2017 17:51:22 GMT
need answer please
|
|
|
Post by chungle on Jun 5, 2017 22:58:12 GMT
You can compare the relative performance for each stock using this code fvb = Status("firstvisiblebar"); NumBars = fvb; RelS=100 * ( C - C[ numbars ] ) / C[ numbars ]; Plot(relS , Name(), colorBlue ); a=Foreign("PVD","C"); b=Foreign("HSG","C"); Rela=100 * ( a - a[ numbars ] ) / a[ numbars ]; Relb=100 * ( b - b[ numbars ] ) / b[ numbars ]; Plot(rela, "a", colorRed); Plot(relb, "b", colorGreen);
Here is the result
|
|