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

[amibroker] Tradestation IF-THEN, Compared to Amibroker



PureBytes Links

Trading Reference Links

Does the IF-THEN statement in Tradestation act like a loop?  See the 
piece of code below from Tradestation.  If the Day of the Week is 
Monday it sets the hh variable to zero.  Later in the code, if another 
condition is satisfied it sets the hh variable to yesterday's high.  
To replicate this in Amibroker you have to use a FOR loop correct?  
What if the data is 1-min intraday data, won't the processing speed be 
very slow?  Is there anyway to replicate this with Arrays?

Steve

***************************
Tradestation Code
***************************

variables: hh(0),ll(0),3Range(0);
if date <> date[1] then begin
	if dayofweekfix(date) = 1 then begin
		hh = 0;
		ll = 99999;
	end;
	3Range = (highd(1) - lowd(1) + highd(2) - lowd(2) + highd(3) - 
lowd(3))/15;
end;
if high[1] > hh then hh = high[1];