Trendline Color strategy

Read before posting.
designer01
Posts: 80
Joined: 02 Feb 2010

Trendline Color strategy

Postby designer01 » 21 Oct 2013

I need some help in creating a strategy where the PL code creates a constant trendline in the lower right corner of the chart and when I manually change the color of the Trendline to green it sends a market order for a specified number of shares. Any ideas?
Thank you

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Trendline Color strategy

Postby Henry MultiСharts » 23 Oct 2013

designer01, do you have any particular difficulty while creating this strategy or you want someone to create it for you?

designer01
Posts: 80
Joined: 02 Feb 2010

Re: Trendline Color strategy

Postby designer01 » 25 Oct 2013

Hi Henry,
Sorry I forgot to post the PL code. My question should have been I'm trying to modify the PL code below so instead of the entry order to occur when price crosses the trendline, I wanted to have it send the order when I manually change the color of the trendline to green. 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 then
Buy next bar at TL_GetValue( TLRef, Date next bar, Time next bar ) stop ;

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Trendline Color strategy

Postby Henry MultiСharts » 25 Oct 2013

You can use TL_GetColor to achieve this goal.


Return to “MultiCharts FAQ”