Trendline LE Alert

Questions about MultiCharts and user contributed studies.
designer01
Posts: 80
Joined: 02 Feb 2010

Trendline LE Alert

Postby designer01 » 12 May 2012

I am trying to modify the default Trendline LE signal to become an alert when the price crosses above the manually drawn Trendline se code below. Although it compiles I get a message "Error in study Trying access at data to future. Bars reference valu: -1" ...Please help. Thanks

Code: Select all

[IntrabarOrderGeneration = false]
inputs:
TLRef( 1 ) ;


variables:
var0( TL_GetBeginDate( TLRef ) ),
var1( TL_GetBeginTime( TLRef ) ),
var2( false ) ;

var2 = ( Date = var0 and ( BarType = 2 or ( BarType = 1 and Time >= var1 ) ) )
or Date > var0 ;

condition1 = var2 and High < TL_GetValue( TLRef, Date, Time ) ;
if condition1 and close crosses over TL_GetValue( TLRef, Date next bar, Time next bar ) then
Alert ;

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Trendline LE Alert

Postby TJ » 12 May 2012

I am trying to modify the default Trendline LE signal to become an alert when the price crosses above the manually drawn Trendline se code below. Although it compiles I get a message "Error in study Trying access at data to future. Bars reference valu: -1" ...Please help. Thanks

Code: Select all

[IntrabarOrderGeneration = false]
inputs:
TLRef( 1 ) ;


variables:
var0( TL_GetBeginDate( TLRef ) ),
var1( TL_GetBeginTime( TLRef ) ),
var2( false ) ;

var2 = ( Date = var0 and ( BarType = 2 or ( BarType = 1 and Time >= var1 ) ) )
or Date > var0 ;

condition1 = var2 and High < TL_GetValue( TLRef, Date, Time ) ;
if condition1 and close crosses over TL_GetValue( TLRef, Date next bar, Time next bar ) then
Alert ;


is it possible to

close crosses over Date next bar, Time next bar?

designer01
Posts: 80
Joined: 02 Feb 2010

Re: Trendline LE Alert

Postby designer01 » 13 May 2012

is it possible to

close crosses over Date next bar, Time next bar?
I believe it needs to be according to the reserved word if I'm not mistaken....

TL_GetValue( TLRef, Date, Time )


Return to “MultiCharts”