Good morning,
I am running the following code in exploration mode over a watch list of around 680 symbols from different european markets:
EnableRotationalTrading();
SetBacktestMode(backtestRotational);
// Numero de posiciones para negociar y ordenar
NumberHeld=8;
SetOption("WorstRankHeld",NumberHeld);
SetOption("MaxOpenPositions",NumberHeld);
//Diluimos el riesgo al 90% para evitar falta de capital
PositionSize=-85/(NumberHeld*1.00);
//Colocamos el valor de las variables
N=4;
M=6;
ROC10=ROC(C,N)*0.2;
ROC101=ROC(C,M)*0.4;
//Establecemos el TimeFrame para el calculo de la Inercia Alcista
TimeFrameSet(inMonthly);
// Calculamos el numerador como la suma de los dos
F1=ROC10+ROC101;
// Calulamos la Volatilidad en Mensual
J=14;
ATR14=ATR(J);
// Calculamos el denominador como el cociente de ART y SMA
F2=(ATR14/MA(C,J))*0.4;
// Hallamos finalmente la Inercia Alcista
InerciaAlcista=F1/F2;
//Corte en 680 y puntuamos la Inercia de cada valor
Corte=680;
Score=IIf(InerciaAlcista<Corte,0,Max(InerciaAlcista,0));
//Posicionamos los ETF
PositionScore=Score;
Nombre=FullName();
Filter=InerciaAlcista;
//Para listar en Scanner
AddTextColumn(Nombre,"Nombre",1.2,IIf(Score>0,colorGreen,colorRed));
AddColumn(InerciaAlcista,"IAlcista Valores", 1.2);
As a result amibroker says " Notice 801: It is advised to turn ON 'Pad and align to reference symbol' option when using ranking, composites or rotational trading (StaticVarGenerateRanks, AddToComposite, StaticVarAdd, EnableRotationalTrading"
If I turn ON Pad and Align with the reference Symbol ^DJI then it works but the following happens:
-
The values I get with the exploration are a bit different to the values that I get with the indicator. I read in the manual that PAD and Align must be used responsibly. "It may slow down backtest/exploration/scan and introduce some slight changes to indicator values when your data has holes and holes are filled with previous bar data". I guess then that this could be the reason why the values are different since in the exploration mode is filling the holes with the value of the previous bar but why the indicator does not have such problem??
-
If I delete the firs two lines of the code:
EnableRotationalTrading();
SetBacktestMode(backtestRotational);
Then I can run it with the Pad and Align Off and the values I get are the same with the exploration and the indicator. I do not understand, the supossed holes are there too and now it lets me run it. -
A friend of mine has exactly the same database than me and he runs the same code in exploration mode and with Pad and Align OFF and it works well, besides the values he gets with the exploration are the same as the values he gets with the indicator. I have 6.30.5 Amibroker version and he has 6.2. I do not understand it because if my database has holes his database also has them and both are running the same code.
I would appreciate any help.
Finally , I would appreciate too if someone can explain to me what amibroker does when Pad and Aling is ON , Is it correct to say that if there is a hole in may database then if is ON that hole is filled with previous bar data???
How does amibroker detect it is hole, maybe that day the market was closed for trading??
The reference symbol is the symbol against with Amibroker is alligning the data, but what type of alligning and padding is done.??
if there is a way to know what symbols are the one that makes the exploration not to work??
How to best choose the reference symbol??
Thanks a lot in adavance.