Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 05-19-2010, 04:01 AM   #1

Join Date: Nov 2008
Location: Orel
Posts: 33
Ignore this user

Thanks: 5
Thanked 4 Times in 2 Posts

Buy/Sell on Trendline Break (EL)

Please, could anyone tell me how to code a simple algorithm:
buy next bar at down trendline break.

Down trendline is formed by connection of two points: swinghigh and swinghigh[1].
GRANDEUR is offline  
Reply With Quote
Old 05-19-2010, 08:06 AM   #2

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

Thanks: 2,084
Thanked 1,477 Times in 912 Posts

Re: Buy/Sell on Trendline Break (EL)

draw a picture...
it will help you to identify the critical points
and organize your logic.
__________________



Only an idiot would reply to a stupid post

Last edited by Tams; 05-19-2010 at 08:12 AM.
Tams is offline  
Reply With Quote
The Following User Says Thank You to Tams For This Useful Post:
TIKITRADER (05-19-2010)
Old 05-19-2010, 08:54 AM   #3

Join Date: Nov 2008
Location: Orel
Posts: 33
Ignore this user

Thanks: 5
Thanked 4 Times in 2 Posts

Re: Buy/Sell on Trendline Break (EL)

Here is the picture. It is the same condition but there is 'short' instead of 'buy'.
http://file.qip.ru/file/129451786/e11d76de/picture.html
GRANDEUR is offline  
Reply With Quote
Old 05-19-2010, 09:03 AM   #4

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

Thanks: 2,084
Thanked 1,477 Times in 912 Posts

Re: Buy/Sell on Trendline Break (EL)

do you know the ID of the trendline?

Attached Thumbnails
Buy/Sell on Trendline Break (EL)-trendline-id.jpg  
__________________



Only an idiot would reply to a stupid post
Tams is offline  
Reply With Quote
Old 05-19-2010, 12:12 PM   #5

Join Date: Nov 2008
Location: Orel
Posts: 33
Ignore this user

Thanks: 5
Thanked 4 Times in 2 Posts

Re: Buy/Sell on Trendline Break (EL)

Quote:
Originally Posted by Tams »
do you know the ID of the trendline?
What do you mean by the "ID"?
The answer I'm looking for is wether it is possiple in tradestation not only to visualize trends but also to trade them mechanically?

For example, I have two lows:
1) swinglow(2,low,2,15)*;
2) swinglow(2,low,2,15).

* - Syntax of 'swinglow' function in EasyLanguage: SwingLow(Instance, Price, Strength, Length)

So I want to draw an imaginary trendline connecting these two lows, assuming it is an uptrend line. When the price touches this imaginary line from up to down I want there would be a 'sell short' signal. And vice versa for down trendlines and buy signals.
GRANDEUR is offline  
Reply With Quote
Old 05-19-2010, 12:23 PM   #6

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

Thanks: 2,084
Thanked 1,477 Times in 912 Posts

Re: Buy/Sell on Trendline Break (EL)

Quote:
Originally Posted by GRANDEUR »
...
The answer I'm looking for is wether it is possiple....
anything is POSSIBLE

if you can visualize it, quantify it, articulate it, you can code it.
__________________



Only an idiot would reply to a stupid post

Last edited by Tams; 05-19-2010 at 12:33 PM.
Tams is offline  
Reply With Quote
Old 05-19-2010, 01:18 PM   #7

Join Date: Jun 2007
Location: MC
Posts: 46
Ignore this user

Thanks: 4
Thanked 25 Times in 16 Posts

Re: Buy/Sell on Trendline Break (EL)

See MarkSanDiego's implementation of "Semi-Automated Trading Using Trend Lines"
https://www.tradestation.com/Discuss...Topic_ID=88600
3monkeys is offline  
Reply With Quote
Old 05-19-2010, 04:40 PM   #8

Join Date: Nov 2008
Location: Orel
Posts: 33
Ignore this user

Thanks: 5
Thanked 4 Times in 2 Posts

Re: Buy/Sell on Trendline Break (EL)

3monkeys, thank you for your post but unfortunately I am not allowed to log in to tradestation Discussion Forum. Actually, I'm a MultiCharts user not tradestation though the coding languages are similar.

Tams, I believe in my inner abilities but I would be glad if somebody helped me in coding the algorithm
GRANDEUR is offline  
Reply With Quote

Reply

Tags
trendline

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
RSI Divergence TrendLine aaa Trading Indicators 11 02-25-2011 02:36 PM
MACD Divergence TrendLine aaa Trading Indicators 42 02-20-2011 08:20 AM

All times are GMT -4. The time now is 09:13 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.