InvestorsHub Logo
Post# of 102
Next 10
Followers 38
Posts 9736
Boards Moderated 2
Alias Born 06/03/2007

Re: SherriT post# 50

Thursday, 05/21/2009 1:22:57 AM

Thursday, May 21, 2009 1:22:57 AM

Post# of 102
Funny you should ask that, I've been thinking about that while at work tonight. I was going to ask you the same thing just now. I thought of a couple of solutions (which may or may not work lol).

First, since the only difference between a trendline and a horizontal line is the slope, if you had the beginning and end points of the line and knew how many bars were between, you could programmatically calculate the value of a concurrent trendline touch. Sort of like if you had a very small 5 bar sample and you drew a line from the top of the first bar to the top of the third bar. Based on that you could calculate where the top of any concurrent bar would be if they followed the trend line.

Second, I thought about using the arctangent or other function and programmatically figuring the trendline touch that way with the angle of the line. Knowing the slope of an upward trendline for example, theoretically you should be able to count over a certain number of bars (x) and calculate how high or low the (y) coordinate should be and make the trade there. After typing this all out, I have not put as much thought into this as the others so it's still sort of murky. Programming wise, it might be easier since you could (theoretically at least) take the slope of the line times the beginning point and calculate all the way up the line or down the line as the case may be.

Third, since you can move objects around based on coordinates you could use the beginning and end of the trendline and calculate the coordinates of the trendline. I think it would be pretty processor intensive since you'd have to create and delete an object say the size of at least a pixel every tick and when that object hit the calculated coordinates of the trendline then make the trade.

There may be some other ways, I just haven't thought of them yet.

Trading either would be pretty cool, short or long based on the bid+spread if shorting it or the ask-spread if going long. If it broke the trendline, then go with the breakout. Should be able to do it with a very minimal manually calculated stop as well like 3 pips or so.

"remember the mayonaise jar...keep cool but don't freeze"

Join InvestorsHub

Join the InvestorsHub Community

Register for free to join our community of investors and share your ideas. You will also get access to streaming quotes, interactive charts, trades, portfolio, live options flow and more tools.