Hi,
I have wrote some code which  work's fine on present data, but when I try to 
test it using explorer (I can't backtest it as it requires visual checking as 
well).

I know what it is doing "wrong" as far as I am concerned but can't figure out 
how to resolve the issue. The stripped down version of the code is below.....
//start
// first I create my arrays from a set of ema's
my3ema = EMA(Close,3);
my8ema = EMA(Close,8);
my21ema = EMA(Close,21);
// then I look up yesterdays ema periods though using my arrays and [barcount-2]
// ensuring that there has been a pullback to cross the ema's
LongPossOld = ((my3ema[BarCount-2] < my8ema[BarCount-2]) AND 
(my8ema[BarCount-2] > my21ema[BarCount-2]));
// todays ema periods waiting for the cross back to trend direction
LongPossNew = ((my3ema > my8ema) AND (my8ema > my21ema));
// making sure that both above conditions are true 
LongPoss8 = LongPossNew AND LongPossOld;
// ensuring that only these condtions are listed 
Filter = LongPoss8;
AddColumn (my8ema, "my 8 ema",1.4);
AddColumn (my8ema[BarCount-2],"myema8-1day", 1.4);
AddColumn (LongPossOld, "8 old",1.4);
AddColumn (LongPossNew, "8 new",1.4);
//end

If I set explorer start to for example 5/11/2008 and end to today's date, what 
I get for the "my8ema" is correct for the occurrence after the start date (set 
in explorer but the "my8ema[barcount-2] is for yesterdays date and not the date 
for the day before the start of the exploration.

I've stripped out all the irrelevant code so as only what is happening can be 
seen - for ease of viewing, as I know that the whole code works fine on the 
last bar and last bar -1 .

Also I can't "prettify" the code as I don't have Astyle.dll, I have looked for 
it on the Amibroker web site but can't find it can anyone post a copy of the 
dll as an attachment please. I looked on www.amibroker.com/bin/astyle.dll but 
it's not there now.


Thanks 
Chris J 

Reply via email to