Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 01-26-2010, 10:41 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 on 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, 03:59 PM   #2

Join Date: Feb 2008
Location: charleston
Posts: 63
Ignore this user

Thanks: 7
Thanked 21 Times in 16 Posts

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

Code:
inputs: Price( Close of data1 - Close of data2 ), Length( 9 ), Displace( 0 ) ;
statsign is offline  
Reply With Quote

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
AB = Plot StyleCloud on MA Ribbon aaa Coding Forum 16 01-10-2010 07:32 AM
Horizontal Line Plot For Day nab999 Coding Forum 3 09-16-2009 09:03 AM
Constant Plot Level PeterBrazel Coding Forum 12 08-05-2009 12:04 PM
Plot Statement Issue PeterBrazel Coding Forum 15 08-03-2009 06:23 AM
Making TS Plot Wider daedalus Coding Forum 14 04-23-2009 10:37 AM

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