Rank: Newbie
Groups: Registered, Registered Users Joined: 1/6/2009(UTC) Posts: 5
|
Is it possible to refer to a trendline in metastock formula language and hence generate buy and sell signals based on that.
Suppose I have drawn a trendline on a chart. How can I generate a "true" (buy) if price is above trendline and a "false" (sell) if price is below the trendline?
Is there some formula or something that can do it??
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 11/7/2005(UTC) Posts: 602
|
For an arbitrary trendline I would say no, not possible. Maybe someone else has some ideas.
|
|
|
|
Rank: Advanced Member
Groups: Moderators, Registered, Registered Users, Subscribers Joined: 10/8/2010(UTC) Posts: 1,967
Thanks: 93 times Was thanked: 156 time(s) in 151 post(s)
|
MetaStock formulas have no way to directly reference a line study (like a trendline) that has been added to a chart. That said, it is possible to write a formula that describes the trendline and then you can use that description in your buy or sell conditions. This would be a separate formula for each trendline. (You can not set a generic reference and have it apply to whatever trendline you have in the chart you are viewing).
To do this, the formula will have to include a point on the trendline and either a) the slope, or b) a second point on the line. If you use the second method, the slope would have to be calculated based on the two points. Then you can describe the trendline with the calculation of:
trendline = point + (slope * barssince(point))
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.