glgene 523 posts msg #96768  Ignore glgene 
10/5/2010 11:34:03 PM
Is there a way to build a script that would do the following:
1) Find stocks whose % increase has increased greater than at a rate of 45 degee angle over the past 1 month
.........1a) Stocks must have increased in at least 5 of the past 10 days
.....................1b) Sort, descending, on stocks with the greatest angle incline.

stocktrader 293 posts msg #96771  Ignore stocktrader 
10/6/2010 12:24:32 AM
Posted this 3 years ago:
Slope Angle in Degrees
Get you started.

glgene 523 posts msg #96774  Ignore glgene 
10/6/2010 1:01:26 AM
Thanks, Stocktrader, for your prompt reply.
I tried to replace the 2s in your script with 10s, and got 0 finds. Your initial script was for a 2day angle. I tried for a 10day angle, and got zilch.
Did I do something wrong? Do any of the other lines need changed, to compensate from going to 10 days from 2?

stocktrader 293 posts msg #96781  Ignore stocktrader 
10/6/2010 10:52:55 AM
I think it is possible. Using trig like in this code. Just need the price today and the price 10 days ago for the hypotenuse and opposite, apply this to incremental time for adjacent.
Be sure to read all that thread. I posted 5day and 20day. From there you could figure it out quite easily.
Thanks.

Kevin_in_GA 3,845 posts msg #96782  Ignore Kevin_in_GA 
10/6/2010 12:54:45 PM
Not really  angle calculations like sine, cosine, and tangent (SOA,CAH, TOA) rely on the the units of measurement to be the same both both axes.
Think about it  the x axis is in days, and the yaxis is in dollars. Also, a $1 stock moving $1 in 10 days is different than a $50 stock making the same move. Therefore one would be better off simply using percent change rather than incorrectly calculating an angle based on different units of measure for each axis.
Perhaps you should use rateofchange instead of angle? After all, that's what you really are trying to measure, and using ROC let's you directly compare stocks independent of their price.

stocktrader 293 posts msg #96786  Ignore stocktrader 
10/6/2010 10:13:41 PM
It would be helpful if you read and understood the thread(s) before posting. Thanks.

glgene 523 posts msg #96788  Ignore glgene 
10/6/2010 11:52:01 PM
Is it possible to convert ROC, as Kevin suggests, into degrees of angle? To be applied with the same measurement so one stock can be compared on the same basis with another stock?
Why do I want to consider an angle examination? Because I believe that any stock price growth in excess of a 45 degree angle cannot maintain that projectory. Example: A stock growing at 60 degree angle is going to come back down (I believe) and, thus, might be ripe for shorting. The 45 degree rule is just my belief. I have never read that to be a fact.
My question is what would be the days in length to measure the angle? 10, 30, ???
I'm not into trig, sine, cosine, etc. Sorry. Just simple SF calculations.
Thanks to Stocktrader and Kevin so far with replies. Just trying to get a handle on this.
