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

Coding glitch - help



PureBytes Links

Trading Reference Links

I've coded a system that determines the opening range of a market (which I
define as the first 5-15 minutes of trading) and then bases entries and
exits upon it by storing the highest high and lowest low of that range.  I
have a problem, however, on days like today in May coffee futures, when
TradeStation built a 5 minute bar for the first five minutes of trading
(9:15-9:20), but then, since there was no trading again until between 9:30
and 9:35 in the May contract, did not build another bar until that five
minute period.  The code I use, which works as long as there is continuous
trading during the opening 5-15 minutes, is as follows below; I'm thinking
I'd have to do something using bar number instead of time(?), but I really
don't know where to begin in that respect.  Any ideas?

Thanks.

BJ

{ShowMe: OpenHi/Lo

By Bernard D'Avella
Date: 2/24/99

HiLoMult is the number by which to multiply the bar interval - in this case,
a 5 minute chart with a HiLoMult value of 3 waits 3 bars, or 15 minutes,
before determining what the highest high and lowest low of the first 15
minutes of the trading day were.}

inputs: HiLoMult(3);
vars: OpenHi(0), OpenLo(0);

IF Time = CalcTime(Sess1StartTime,(BarInterval*HiLoMult)) THEN begin
 OpenHi = Highest(High,HiLoMult);
 OpenLo = Lowest(Low,HiLoMult);
end;

IF Time > CalcTime(Sess1StartTime,BarInterval*HiLoMult) THEN begin
 Plot1(OpenHi, "OHi");
 Plot2(OpenLo, "OLo");
end;