Welcome to the Traders Laboratory Forums.
Technical Analysis The technical discussion forum for traders.

Reply
Old 01-26-2010, 11:49 PM   #1

Join Date: Jul 2008
Location: Valdosta, GA
Posts: 48
Ignore this user

Thanks: 1
Thanked 0 Times in 0 Posts



How Do I Put an SMA on a Spread Differential Indicator in the Same Plot/code for TS?

How can I put a simple moving average on a spread differential indicator on the same plot underneath price, so the SMA isn't the SMA of the price, but of the spread differential indicator? The SpreadDif and SMA have to be in the same code too, don't they? This is the code for TS's Spread Differential:

inputs: DataSeries1( Close of data1 ), DataSeries2( Close of data2 ) ;

Plot1( DataSeries1 - DataSeries2, "SprdDiff" ) ;

and for the Mov Avg 1 line:

inputs: Price( Close ), Length( 9 ), Displace( 0 ) ;
variables: Avg( 0 ) ;

Avg = AverageFC( Price, Length ) ;

if Displace >= 0 or CurrentBar > AbsValue( Displace ) then
begin
Plot1[Displace]( Avg, "Avg" ) ;
end;

Just not sure how to paste these together to put them in the same code. Thanks for any help.
clbradley is offline  
Reply With Quote
Old 01-27-2010, 12:58 PM   #2
zdo

Join Date: Nov 2007
Location: boonies
Posts: 1,178
Ignore this user

Thanks: 299
Thanked 299 Times in 213 Posts
Blog Entries: 104



Re: How Do I Put an SMA on a Spread Differential Indicator in the Same Plot/code for

...unverified pseudocode

Plot1( DataSeries1 - DataSeries2, "SprdDiff" ) ;
Plot2( AverageFC(DataSeries1 - DataSeries2, Length), "SprdAvg" ) ;
// or Plot2( AverageFC(Plot1, Length), "SprdAvg" ) ;
// or ...

hth
zdo is offline  
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How Do I Put an SMA on a Spread Differential on the Same Plot/code for TS? clbradley Coding Forum 1 01-27-2010 04:59 PM
Color Code MA for Range Bar Indicator snowbird Coding Forum 15 09-13-2009 03:08 PM
EL Code for DeMark's Seq Indicator telcodude Open E Cry 3 09-07-2009 09:54 AM
Triangle Pattern Indicator Code Not Working clbradley Coding Forum 16 04-27-2009 09:36 PM
Anyway to Plot an Indicator Value Without Actually Plotting It? daedalus Coding Forum 3 04-25-2009 12:43 AM

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