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.

pitrader

Timeframe Integration

Recommended Posts

I have a project for any TS code writers out there with a few minutes to spare.

 

What I want is high-low[1] +high-low[2]/2 of a 10min bar.

 

This range will be placed on a 1min chart with the high of the range projected from the lowest low of the current 10min bar and the low of the range projected from the highest high of the current 10min bar.

 

This will update realtime as a new high or low is made and will also have a history going back 1 10min bar. This way I will have the current range and the range of the previous 10mins showing on my 1min chart.

 

This would really help me out so I am not constantly doing it manually.

 

Thanks Guys!!!

 

Pi

Share this post


Link to post
Share on other sites

This will give you access to the ten minute High, Low and range history on a one minute chart.

 

H0 is the current 10m bars H.

H1 is the previous 10m bars H.

H2 (on your 1m chart) is the same as H[2] on the 10m.

 

Same syntax for Low and range, just substitute L or R for H.

 

I didn't understand precisely how the projection you want is formulated so I didn't include that. But it's simple to create anything you might want using the variables defined. Just comment out the sample plots and add what you need.

 

 

var: ttm(0), ip(0), m(0), 
H0(0), H1(0), H2(0), 
L0(0), L1(0), L2(0), 
r0(0), r1(0), r2(0);

ttm=timetominutes(t);
ip=intportion(t/10);
m=mod(ttm,10);

if m[1]=0 or (ip<>ip[1] and m>0) then begin
   H2=H1;  L2=L1;  r2=r1;
   H1=H0;  L1=L0;  r1=r0;
   H0=H;  L0=L;
end;
H0=maxlist(H0,H);  L0=minlist(L0,L);  r0=H0-L0;

plot10(H0,"H0");
plot11(H1,"H1");

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.