Help with time() and highest()

ptcman

Junior member
Messages
15
Likes
0
Hi.

How can we especify a time range in EL using as the start point the previous day?

Let me explain, ES starts trading at 4:30 pm ET until 4:15 ET the next day. How can I write this in EL? How can I "call" for a especific hour from yesterday until today's?

For EL, the trading starts at midnight. Date() or Time() functions are examples of that.

I know I need to say something like:

time > 1630 and time < 1615

The questions is how to say that 1630 is yesterday's time :eek:

Now another question, this time about the Highest() / Lowest() functions.

How can I plot the first hour trading, or better said, how can I plot the highest and lowest price made in the first trading hour?

All the highest() and lowest() functions have a period parameter. In this case I don't need a period parameter since the period is given by a specific time range.

In Metastock this should be something like; ValueWhen(1,tRange,HighestSince(1,start,High)). In english this says to plot the most recent highest high since the start (hour selected), for the most recent time range (trading session) selected. ValueWhen() function would then extended those values until the end of the time range selected.

I tried something like this:

stTime = 0930;
enTime = 1030;
condition1 = time>stTime and time<enTime;
if condition1 then
Plot1(highd(0));


But this only plots the highest high for the selected period of time not extending until the end of the trading session.
I also thought about using the trendline functions but when I started to see them I just said that was to much for my newbie knowledge :eek:

I appologise for the length of this post.

Too many questions poping at the same time :|

regards
Fernando
 
Instead of using the time of day you can do such things as use variables to lock in that period or even use BarNumber to determine location. In this manner the day that the time falls on would be not relevant any longer.

For the second one, many ways to do thiat, but really all you have to do is set two variables that you reset to extreme values before entering the range. One for the high and one for the low and then on each bar within the range you are wanting you will check to see if the incoming high or low exceeds the previous bars values and if so then you reset your variables to hold the new values. At the end of the range you will then know the highest and lowest values.
 
Top