Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Hello,
I have spent a ton of time on this and I can’t figure out why this code does not produce alerts in Radarscreen. If you would be so kind and help me modify this code to produce alerts when the trendline is broken in radarscreen I would greatly appreciate it.
Thank you for your help.
Below is the code...
-------------------------------------------------------
for Value2 = 1 to 10
begin
if SwLoVal[Value2] < SwLoVal[0] then
begin
Index = Value2 ;
Value2 = 11 ;
end ;
end ;
if Value2 = 12 then
begin
if UpTLRef >= 0 then
begin
if HistoryTF and UpTLBreak = false then
begin
TL_SetEnd( UpTLRef, Date, Time, TL_GetValue( UpTLRef, Date, Time ) ) ;
TL_SetExtRight( UpTLRef, true ) ;
end
else if HistoryTF = false then
TL_Delete( UpTLRef ) ;
end ;
UpTLRef = TL_New( SwLoDate[Index], SwLoTime[Index], SwLoVal[Index],
SwLoDate[0], SwLoTime[0], SwLoVal[0] ) ;
if UpTLBreak = true then
UpTLBreak = false ;
UpTLEndBar = BarNum - SwLoStrength ;
TL_SetExtLeft( UpTLRef, false ) ;
TL_SetExtRight( UpTLRef, true ) ;
if UpTLColorNum <> 99 then
TL_SetColor( UpTLRef, UpTLColorNum ) ;
if AlertTypeCAPS = "ONCLOSE" then
TL_SetAlert( UpTLRef, 2 )
else if AlertTypeCAPS = "INTRABAR" then
TL_SetAlert( UpTLRef, 1 )
else
TL_SetAlert( UpTLRef, 0 ) ;
end ;
end ;
if DnTLRef >= 0
and DnTLBreak = false
and BarNum > DnTLEndBar + SwHiStrength + BarsPast
and ( Close > TL_GetValue( DnTLRef, Date, Time ) )[BarsPast]
then
begin
TL_SetEnd( DnTLRef, Date, Time, TL_GetValue( DnTLRef, Date, Time ) ) ;
TL_SetExtRight( DnTLRef, false ) ;
DnTLBreak = true ;
end ;
if UpTLRef >= 0
and UpTLBreak = false
and BarNum > UpTLEndBar + SwLoStrength + BarsPast
and ( Close < TL_GetValue( UpTLRef, Date, Time ) )[BarsPast]
then
begin
TL_SetEnd( UpTLRef, Date, Time, TL_GetValue( UpTLRef, Date, Time ) ) ;
TL_SetExtRight( UpTLRef, false ) ;
UpTLBreak = true ;
end ;
If UpTLBreak = true then
Plot1( UpTLBreak , "Up" ) ;
If DnTLBreak = true then
Plot2( DnTLBreak , "Down" ) ;
Can you help answer these questions from other members on NexusFi?
trendlines are not available in Radarscreen, but you could write code to compute the values that your trendlines would have on each bar and check for alerts. After all you can compute the slope of each trend line out of the start and end point and with that can compute the value on each bar.
regards, i'm in a very similar situation. i'm trying to create an indicator that would draw something similar to a gann fan automatically on a chart, with minimal need for user input.
from the information i have read, i have come to think that the only method to create trend lines from easylanguage is with the tl_new command by setting starting and end points (i understand that neither angles nor gann angles exist in el).
i'm stuck with two things, first, i would like my indicator to use the point where another indicator i have last made a >=.5% move as the starting point for the trend lines. i understand that i would need to identify 3 values from that specific point to be able to use it as a coordinate: date, time and price but i have no idea how to get easylanguage to gather these values.
second, i would also like to set alerts if price broke above or below the trend lines that my indicator would create. ¿how could i use the points on my trends and the slope to project the values going forward? ¿is ts capable of performing trigonometric calculations as required?
you can use legacy Easylanguage or OOEL drawing objects to create trend lines in Tradestation.
You would need a way to access the values of your other indicator and the easiest way might be to include the computations in the indicator that draws the trend lines.
Since you know the start and end point of your trend line you can compute the slope and with that can compute every point in the future within your code.