Welcome to the Traders Laboratory Forums.
Open E Cry The unofficial Open E Cry forum.

Reply
Old 03-23-2009, 11:36 AM   #1

brownsfan019's Avatar

Join Date: Jan 2007
Location: USA
Posts: 4,256
Ignore this user

Thanks: 1,912
Thanked 1,775 Times in 892 Posts



Plotting Globex High and Low

Here's the code from this thread that will plot the Globex High and Low in OEC.

Code:
Inputs: Session_Start(930), Session_End(1615); 

vars: G_H(0), G_L(0), Globex(false); 

If Globex and Time >= Session_Start and time < Session_End 
then Globex = false; 

if Globex = false and Time >= Session_End then begin // Should only execute first tick of Globex session 

G_H=High; G_L=Low; 
Globex = True; end; 

If Globex then begin 
If High>G_H then G_H=High; 
if Low< G_L then G_L=low; 
end; 

Plot1(G_H,"G-High"); 
Plot2(G_L,"G-Low");

Note - as the code stands currently, it will include data from Sunday, which means your Mon charts will actually be off if comparing the high/low to what the CME is reporting. Another post made to see if there's a workaround to this by trader273.
Attached Files
File Type: txt Globex High and Low.txt (463 Bytes, 14 views)
brownsfan019 is offline  
Reply With Quote
Old 03-25-2009, 09:32 PM   #2

Trendup_'s Avatar

Join Date: Sep 2008
Location: Brisbane
Posts: 132
Ignore this user

Thanks: 72
Thanked 41 Times in 32 Posts



Re: Plotting Globex High and Low

Hi, can't compile the coding, got the following error (attached).
Any ideas?
Thanks



Quote:
Originally Posted by brownsfan019 »
Here's the code from this thread that will plot the Globex High and Low in OEC.

Code:
Inputs: Session_Start(930), Session_End(1615); 

vars: G_H(0), G_L(0), Globex(false); 

If Globex and Time >= Session_Start and time < Session_End 
then Globex = false; 

if Globex = false and Time >= Session_End then begin // Should only execute first tick of Globex session 

G_H=High; G_L=Low; 
Globex = True; end; 

If Globex then begin 
If High>G_H then G_H=High; 
if Low< G_L then G_L=low; 
end; 

Plot1(G_H,"G-High"); 
Plot2(G_L,"G-Low");

Note - as the code stands currently, it will include data from Sunday, which means your Mon charts will actually be off if comparing the high/low to what the CME is reporting. Another post made to see if there's a workaround to this by trader273.
Attached Thumbnails
Plotting Globex High and Low-errors.jpg  
Trendup_ is offline  
Reply With Quote
Old 03-25-2009, 11:57 PM   #3

Join Date: Jan 2008
Location: San Francisco
Posts: 394
Ignore this user

Thanks: 17
Thanked 338 Times in 156 Posts



Re: Plotting Globex High and Low

Alternative Code:

vars: firstbar(0), length(0);
if date>date[1] then begin
firstbar=currentbar;
end;

length=(currentbar-firstbar);

if time<630 then value1=highest(h,length);
if time<630 then value2=lowest(l,length);


plot1(value1);
plot2(value2);


value3=highest(h,length);
value4=lowest(l,length);

plot3(value3);
plot4(value4);


---------------------------------------

Note, my time is 630 for West Coast time, adjust as necessary.

Plots 1 and 2 Holds Globex Values
Plots 3 and 4 adjust for new Highs and Lows of pit session (holds globex value if not or until violated)
Just delete the plot statements you don't want.



Attached Thumbnails
Plotting Globex High and Low-globex-high-low.png  
Frank is offline  
Reply With Quote
The Following 2 Users Say Thank You to Frank For This Useful Post:
brownsfan019 (03-26-2009), Trendup_ (03-26-2009)
Old 03-26-2009, 07:38 AM   #4

BlowFish's Avatar

Join Date: Mar 2007
Location: In Da House
Posts: 3,272
Ignore this user

Thanks: 129
Thanked 1,038 Times in 694 Posts



Re: Plotting Globex High and Low

Good job Frank. Another small programmers tip using the highest and lowest functions will iterate through all the bars each time you run through the code. The construct you used previously comparing the high now with the highest high previously is a more efficient way of doing things (not a big deal in this instance but a good programming habit to avoid loops if possible). Thats the fun thing about coding, many ways of doing things. Not trying to be critical just a 'top tip' to pass on. You could use your date/time logic with your previous high low logic (or not) if you so desired. Interestingly the code will look a little longer but will run tighter.

On another topic I wonder why one would exclude Sunday Night (or even Monday morning) from out of hours calculations? They still represent a level where the tide turned.

Last edited by BlowFish; 03-26-2009 at 07:46 AM.
BlowFish 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
Finding Globex High and Low in Easylanguage trader273 Coding Forum 24 03-23-2009 08:08 AM
Can Someone Tell Me How to Get an Indicator to Stop Plotting shortski Coding Forum 31 02-08-2009 01:49 PM
Overnight Session: Looking at globex high & low Soultrader Technical Analysis 15 12-25-2008 09:08 PM
[Plotting Fib Retracements in Real-time] Soultrader Trading Videos 3 05-06-2007 12:22 PM
Plotting Market Profile on TS dah7 Market Profile 9 03-16-2007 10:49 PM

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