[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EasyLanguage for "First hour high/low"



PureBytes Links

Trading Reference Links

<x-flowed>
Hi Doug

Omega has a number of built in functions for establishing session start time 
and the like and manipulating time - personally I find it easier to do the 
whole thing manually and based on a count for the number of bars with resets 
based on start of day.Thus something like this should get you going :

vars:count(0),yesterdayclose(0),op(0),holdhigh(0),holdlow(0) ;

{ reset everything for new day }
if date <> date[1] then begin
	yesterdayclose = close[1] ; { capture yesterdays close }
	count = 0 ;                 { reset count }
	op = open ;                 { capture open }
	holdhigh = high ;           { grab opening high }
	holdlow = Low ;             { grab opening low }
end ;
count = count + 1 ;  { count number of bars }

{ number for count - depends on your timeframe ...so if using 5 minute bars 
and want the first hour trading set below to 13 - need to adjust on 
timeframe / time required obviously }

if count < 13 then begin
	if high > holdhigh then begin
	holdhigh = high ;
end ;
	if low < holdlow then begin
		holdlow = low ;
	end ;
end ;

Then for your true/false switch you would have something like :

vars:outside(false) ;
outside = false ;
if count >= 13 and ( high > holdhigh or low < holdlow ) then begin
outside = true ;
end ;


Regards Stuart




From: "Doug Fields" <dfields@xxxxxxxxxxxxx>
To: "OMEGA-LIST" <omega-list@xxxxxxxxxx>
Subject: EasyLanguage for "First hour high/low"
Date: Mon, 11 Sep 2000 18:55:45 -0400

Hello,

I'm trying to make a few intra-day trading strategies (perhaps just a T/F
filter for the moment) which require the knowledge of the high/low in the
first part of the day. (I just this past Thursday receive ProStation 2000i.)

This part can vary; say it's 30 minutes or an hour. Not important.

Obviously, I want to be able to tell:

1) How long since open it is
2) What the day's open and previous day's close is
3) What the high, low, and volume are for the first X minutes

during all bars after X minutes.

I found an example on the omega site which says "1 hour breakout"signal. The
easylanguage is at the bottom. It is completely commentless. Further, it
uses data2 and data3, without specifying what they should be.

I am a software engineering manager; please be as technical as you like (I'd
say software engineer, but I moved into management recently).

An example RadarScreen indicator I would like to implement would be three
columns:

1) First X minute high
2) First X minute low
3) True or False, indicating if the last value is between these

Your help would be greatly appreciated.

Thanks,

Doug

Vars:  Sess1firstBarDate(0,Data2), Sess1FirstBarHigh(0,Data2),
Sess1FirstBarLow(0,data2), AveDayRange(0,data3);

Input:  RanLn(10);

AvedayRange = Average((H[0] of Data3 - L[0] of Data3),RanLn) of data3;

If (time of data2 = Sess1FirstBarTime of data2) or (date[0] Data2 > Date[1]
of data2) then begin
  Sess1FirstBarDate = Date[0] of Data2;
  Sess1FirstBarHigh = High[0] of data2;
  Sess1FirstBarLow = low[0] of Data2;
end;

If (Sess1firstBarDate = Date of Data2) and (Time of Data2 < Sess1EndTime of
Data2) then begin
  Condition1 = C[1] < Sess1FirstBarHigh[0];
  If Condition1 then Buy at Sess1FirstBarHigh[0] + 20 points stop;
  Condition2 = close[1] > Sess1FirstBarLow[0];
  If Condition2 then sell at Sess1FirstBarLow - 20 points stop;
end;

Value1 = Sess1FirstBarHigh[0] - Avedayrange;
Value2 = Sess1FirstBarLow[0] + Avedayrange;

If low[0] <= Value1 then Exitshort at Market;

If high[0] >= Value2 then Exitlong at market;


</x-flowed>