Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

relizer

Spread High/Low in TS

Recommended Posts

If you are talking about the spread between two instruments in TS, just modify the input to the following instead of the default:

 

inputs: DataSeries1( High of data1 ), DataSeries2( Low of data2 ) ;

 

inputs: DataSeries1( High of data1 ), DataSeries2( Low of data2 ) ;

Plot1( DataSeries1 - DataSeries2, "SprdDiff" ) ;

 

You can also elaborate this study by calculating the largest spread of using 4 inputs (H data1, L data1, H data2, L data2).

Share this post


Link to post
Share on other sites

Please clarify your specs.

Do you mean plot the highest ‘close’ and the lowest ‘close’ of the spread per bar for your timeframe?

Or do you mean plot the spread of the highs and plot the spread of the lows of each bar for your timeframe?

Share this post


Link to post
Share on other sites

Please clarify your specs.

Do you mean plot the highest ‘close’ and the lowest ‘close’ of the spread per bar for your timeframe?

Or do you mean plot the spread of the highs and plot the spread of the lows of each bar for your timeframe?

 

The Higest value and Lowest value for the time frame selected.

I would like to see a spread that looks like a bar chart instead of a line chart.

Thank you for your help.

Share this post


Link to post
Share on other sites

relizer,

 

Find code below... it was written in word not EL editor so I don't even know if it will verify... nonetheless it should get you started and maybe someone else who is in TS this weekend can help you fix it... don't really have much time to think about it now, so beware ... :pc guru:

ie read / use it as if it is concept / pseudo code...hth

 

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

vars:
cs(0),	
os(0),
hs(0),
ls(0)
;

cs = (DataSeries1 - DataSeries2);

if barstatus(1) = 0 then begin
//cs = (DataSeries1 - DataSeries2);
os = cs;
hs = cs;
ls = cs;	

end; // if barstatus(1) = 0

if barstatus(1)= 1 or barstatus(1)= 2 then begin
//cs = (DataSeries1 - DataSeries2);

if cs > hs then
 hs = cs;

if cs < ls {and cs > 0} then
 ls = cs;	

end; // if barstatus(1)= 1 or ...


Plot1(os, "os");  // set the style of this to Left Tick
Plot2(cs, "cs");  // set the style of this to Right Tick
Plot3(hs, "hs");  // set the style of this to Bar High
Plot4(ls, "ls");  // set the style of this to Bar Low

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.