OK, this might be the answer: the conditions "Closes[0]<BuyLimit" and "Closes[0]>SellLimit" are relevant for the period just after the LookBack period, where they are not 100% true when "!NumOpenLong && Fast[0]>Slow[0]" or "!NumOpenShort && Fast[0]<Slow[0]" is true.

I run 2 tests with the following versions of Luxor.c scripts, and they produce exactly the same "Luxor_test.log" files. "LookBack" is set to 122 on purpose, at which Fast just crossed over Slow.

But more weird things happen, they produce different testtrades.csv files:
=========================
$diff testtrades.csv_1 testtrades.csv_2
296a297,298
> testluxor,Long,GBP/USD,823183,1,2004-09-06 07:30,2004-09-07 10:00,1.77760,1.78030,+2.70,0.00,Reverse
> testluxor,Short,GBP/USD,828483,1,2004-09-07 10:00,2004-09-08 00:00,1.78030,1.77530,+5.00,0.00,Reverse
301a304
> testluxor,Short,GBP/USD,837784,1,2004-09-09 08:30,2004-09-09 21:00,1.78530,1.78710,-1.80,0.00,Reverse
785d787
< testluxor,Short,GBP/USD,2148115,1,2005-10-07 05:30,2005-10-10 06:30,1.77550,1.76220,+13.30,0.00,Reverse
789d790
< testluxor,Short,GBP/USD,2165817,1,2005-10-13 01:00,2005-10-13 15:30,1.74920,1.74950,-0.30,0.00,Reverse
=========================



version #1
=========================
function run(){
// set(PLOTNOW,LOGFILE,PARAMETERS);
set(PLOTNOW,LOGFILE);

StartDate = 2004;
EndDate = 2010;
BarPeriod = 30;
LookBack = 122; // This is the point where the cross condition is just satisfied

asset("GBP/USD");

vars Closes = series(priceClose());
vars Fast = series(SMA(Closes,3));
vars Slow = series(SMA(Closes,30));

Spread = Slippage = Commission = RollLong = RollShort = 0;

static var BuyStop, SellStop, BuyLimit, SellLimit;

int threshold = 1;
if(crossOver(Fast,Slow)){
BuyStop = priceHigh()+threshold*PIP;
BuyLimit = priceHigh()+5*threshold*PIP;
}
if(crossUnder(Fast,Slow)){
SellStop = priceLow()-threshold*PIP;
SellLimit = priceLow()-5*threshold*PIP;
}

if(!NumOpenLong && Fast[0]>Slow[0] && Closes[0]<BuyLimit){
enterLong(1,BuyStop);
}
if(!NumOpenShort && Fast[0]<Slow[0] && Closes[0]>SellLimit){
enterShort(1,SellStop);
}
}
=========================

version #2 (remove "Closes[0]<BuyLimit" and "Closes[0]>SellLimit")
=========================
function run(){
// set(PLOTNOW,LOGFILE,PARAMETERS);
set(PLOTNOW,LOGFILE);

StartDate = 2004;
EndDate = 2010;
BarPeriod = 30;
LookBack = 122; // This is the point where the cross condition is just satisfied

asset("GBP/USD");

vars Closes = series(priceClose());
vars Fast = series(SMA(Closes,3));
vars Slow = series(SMA(Closes,30));

Spread = Slippage = Commission = RollLong = RollShort = 0;

static var BuyStop, SellStop, BuyLimit, SellLimit;

int threshold = 1;
if(crossOver(Fast,Slow)){
BuyStop = priceHigh()+threshold*PIP;
BuyLimit = priceHigh()+5*threshold*PIP;
}
if(crossUnder(Fast,Slow)){
SellStop = priceLow()-threshold*PIP;
SellLimit = priceLow()-5*threshold*PIP;
}

if(!NumOpenLong && Fast[0]>Slow[0]){
enterLong(1,BuyStop);
}
if(!NumOpenShort && Fast[0]<Slow[0]){
enterShort(1,SellStop);
}
}
=========================