| Coding Forum Collaborate, receive help, or discuss coding related issues. |
![]() | | Tweet | |
| | #1 | ||
![]() | Trendline (EasyLanguage) TL_New Displays a trendline, with the specified starting and ending points, on the chart that the study is based on; returns a trendline-specific ID number, required to modify the trendline. Usage TL_New (sDate, sTime, sPriceValue, eDate, eTime, ePriceValue) Parameters sDate - a numerical expression specifying the trendline starting point date; the date is indicated in the YYYMMdd format, where YYY is the number of years since 1900, MM is the month, and dd is the day of the month sTime - a numerical expression specifying the trendline starting point time; the time is indicated in the 24-hour HHmm format, where 1300 = 1:00 PM sPriceValue - a numerical expression specifying the trendline starting point price value (vertical position, corresponding to a value on the price scale of a chart) eDate - a numerical expression specifying the trendline ending point date eTime - a numerical expression specifying the trendline ending point time ePriceValue - a numerical expression specifying the trendline ending point price value Example Display a trendline, that begins at 9:00 AM at a price value of 1381, and ends at 3:00 PM at a price value of 1337, on January 17th, 2008, on the chart that the study is based on: Value1 = TL_New( 1080117, 900, 1381, 1080117, 1500, 1337); source: EasyLanguage Manual | ||
| |
|
| | #2 | ||
![]() | Re: Trendline (EasyLanguage) | ||
| |
|
| | #3 | ||
![]() | Re: Trendline (EasyLanguage) drawing a trendline at the highest high and the lowest low of X days back. it utilizes the highD and lowD functions to obtain the highest/lowest prices. ![]() MC version can be used on sub-minute charts. i.e. tick, seconds, volume bar, etc. Last edited by Tams; 04-26-2009 at 05:25 PM. | ||
| |
|
| The Following 7 Users Say Thank You to Tams For This Useful Post: | ||
aaa (04-26-2009), daedalus (05-03-2009), kh_model (08-21-2010), livernik (07-06-2011), TIKITRADER (07-30-2009), ValueTrader (07-14-2011) | ||
| | #4 | ||
![]() | Re: Trendline (EasyLanguage) | ||
| |
|
| | #5 | ||
![]() | Re: Trendline (EasyLanguage) ![]() I've coded something horrible and complicate , but it works Tams, If you have time to correct it I will appreciate it a lot Code: // HL bar (MC) // version: beta 0.1 // author: TAMS // date: 20090426 // license: public use // description: this indicator draws a trendline // at the highest high and lowest low of X days back input: lookback( 1 ), Line.size ( 1 ), Line.style ( 1 ), color.tl.h( blue ), color.tl.l( red ); // 1 if date <> date[1] and lookback = 1 then begin value1 = tl_new_s(d , time_s , highd(1), d , time_s, highd(1 )); value2 = tl_new_s(d , time_s, lowd(1), d , time_s, lowd(1)); tl_setcolor( value1, color.tl.h ); TL_SetSize( value1, Line.size ); TL_SetStyle( value1, Line.style ); tl_setcolor( value2 , color.tl.l ); TL_SetSize( value2, Line.size ); TL_SetStyle( value2, Line.style ); end; if lookback = 1 then begin tl_setend_s(value1, d , time_s , highd(1) ); tl_setend_s(value2, d , time_s , lowd(1) ); end; // 2 if date <> date[1] and lookback = 2 then begin value1 = tl_new_s(d , time_s , highd(1), d , time_s, highd(1 )); value2 = tl_new_s(d , time_s, lowd(1), d , time_s, lowd(1)); value3 = tl_new_s(d , time_s , highd(2), d , time_s, highd(2 )); value4 = tl_new_s(d , time_s, lowd(2), d , time_s, lowd(2)); tl_setcolor( value1, color.tl.h ); TL_SetSize( value1, Line.size ); TL_SetStyle( value1, Line.style ); tl_setcolor( value2 , color.tl.l ); TL_SetSize( value2, Line.size ); TL_SetStyle( value2, Line.style ); tl_setcolor( value3, color.tl.h ); TL_SetSize( value3, Line.size ); TL_SetStyle( value3, Line.style ); tl_setcolor( value4 , color.tl.l ); TL_SetSize( value4, Line.size ); TL_SetStyle( value4, Line.style ); end; if lookback = 2 then begin tl_setend_s(value1, d , time_s , highd(1) ); tl_setend_s(value2, d , time_s , lowd(1) ); tl_setend_s(value3, d , time_s , highd(2) ); tl_setend_s(value4, d , time_s , lowd(2) ); end; // 3 if date <> date[1] and lookback = 3 then begin value1 = tl_new_s(d , time_s , highd(1), d , time_s, highd(1 )); value2 = tl_new_s(d , time_s, lowd(1), d , time_s, lowd(1)); value3 = tl_new_s(d , time_s , highd(2), d , time_s, highd(2 )); value4 = tl_new_s(d , time_s, lowd(2), d , time_s, lowd(2)); value5 = tl_new_s(d , time_s , highd(3), d , time_s, highd(3 )); value6 = tl_new_s(d , time_s, lowd(3), d , time_s, lowd(3 )); tl_setcolor( value1, color.tl.h ); TL_SetSize( value1, Line.size ); TL_SetStyle( value1, Line.style ); tl_setcolor( value2 , color.tl.l ); TL_SetSize( value2, Line.size ); TL_SetStyle( value2, Line.style ); tl_setcolor( value3, color.tl.h ); TL_SetSize( value3, Line.size ); TL_SetStyle( value3, Line.style ); tl_setcolor( value4 , color.tl.l ); TL_SetSize( value4, Line.size ); TL_SetStyle( value4, Line.style ); tl_setcolor( value5, color.tl.h ); TL_SetSize( value5, Line.size ); TL_SetStyle( value5, Line.style ); tl_setcolor( value6 , color.tl.l ); TL_SetSize( value6, Line.size ); TL_SetStyle( value6, Line.style ); end; if lookback = 3 then begin tl_setend_s(value1, d , time_s , highd(1) ); tl_setend_s(value2, d , time_s , lowd(1) ); tl_setend_s(value3, d , time_s , highd(2) ); tl_setend_s(value4, d , time_s , lowd(2) ); tl_setend_s(value5, d , time_s , highd(3) ); tl_setend_s(value6, d , time_s , lowd(3) ); end; // 4 if date <> date[1] and lookback = 4 then begin value1 = tl_new_s(d , time_s , highd(1), d , time_s, highd(1 )); value2 = tl_new_s(d , time_s, lowd(1), d , time_s, lowd(1)); value3 = tl_new_s(d , time_s , highd(2), d , time_s, highd(2 )); value4 = tl_new_s(d , time_s, lowd(2), d , time_s, lowd(2)); value5 = tl_new_s(d , time_s , highd(3), d , time_s, highd(3 )); value6 = tl_new_s(d , time_s, lowd(3), d , time_s, lowd(3 )); value7 = tl_new_s(d , time_s , highd(4), d , time_s, highd(4 )); value8 = tl_new_s(d , time_s, lowd(4), d , time_s, lowd(4 )); tl_setcolor( value1, color.tl.h ); TL_SetSize( value1, Line.size ); TL_SetStyle( value1, Line.style ); tl_setcolor( value2 , color.tl.l ); TL_SetSize( value2, Line.size ); TL_SetStyle( value2, Line.style ); tl_setcolor( value3, color.tl.h ); TL_SetSize( value3, Line.size ); TL_SetStyle( value3, Line.style ); tl_setcolor( value4 , color.tl.l ); TL_SetSize( value4, Line.size ); TL_SetStyle( value4, Line.style ); tl_setcolor( value5, color.tl.h ); TL_SetSize( value5, Line.size ); TL_SetStyle( value5, Line.style ); tl_setcolor( value6 , color.tl.l ); TL_SetSize( value6, Line.size ); TL_SetStyle( value6, Line.style ); tl_setcolor( value7, color.tl.h ); TL_SetSize( value7, Line.size ); TL_SetStyle( value7, Line.style ); tl_setcolor( value8 , color.tl.l ); TL_SetSize( value8, Line.size ); TL_SetStyle( value8, Line.style ); end; if lookback = 4 then begin tl_setend_s(value1, d , time_s , highd(1) ); tl_setend_s(value2, d , time_s , lowd(1) ); tl_setend_s(value3, d , time_s , highd(2) ); tl_setend_s(value4, d , time_s , lowd(2) ); tl_setend_s(value5, d , time_s , highd(3) ); tl_setend_s(value6, d , time_s , lowd(3) ); tl_setend_s(value7, d , time_s , highd(4) ); tl_setend_s(value8, d , time_s , lowd(4) ); end; | ||
| |
|
| | #6 | ||
![]() | Re: Trendline (EasyLanguage) | ||
| |
|
| The Following 2 Users Say Thank You to sneo For This Useful Post: | ||
aaa (05-03-2009), EasyTrader_I (09-20-2010) | ||
| | #7 | ||
![]() | Re: Trendline (EasyLanguage) Quote:
I am not sure if I understand what you want to achieve. Can you make a screen shot, then draw some lines/arrows/notes to illustrate your intention? | ||
| |
|
| | #8 | ||
![]() | Re: Trendline (EasyLanguage) ![]() The idea is simple and works like classicals pivots The goal is to have High Blue and low Red in a solid color And to extend in Dotted lines to the right during xDays The circles shows interesting S/R on the 15 mn graph They are a lot of pullback in 1 mn on these support | ||
| |
|
![]() |
| Tags |
| trendline |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
| ∧ Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Easylanguage Auto Trendline Study | raven4ns | Technical Analysis | 3 | 03-30-2009 05:50 PM |
| GBP/USD Trendline Breakout | DannyBly | Forex Trading Laboratory | 3 | 07-06-2008 10:13 AM |
| Trendline methods | waveslider | Technical Analysis | 0 | 06-26-2007 10:13 PM |
| Russell 2000 (IWM) Trendline Test | MrPaul | Technical Analysis | 0 | 03-25-2007 01:53 PM |
| The Downsloping Trendline On The YM | Bfbusa | Technical Analysis | 0 | 02-07-2007 12:54 AM |