@Dionysos Your problem must be somewhere else, because (for the reasons explained by @mradtke), this part of your code is wrong:
for( i = 0; i < Max(Entryperiod,100); i++ )
{Buy=Sell=Cover=Short=null;}
You are not using subscript operators []
allowing to access/assign individual array elements, so it just repeats the same line (assigning all elements of each array with the value null) minimum 100 times. One such line is enough. Your two above lines equal:
Buy=Sell=Cover=Short=null;
Buy=Sell=Cover=Short=null;
Buy=Sell=Cover=Short=null;
Buy=Sell=Cover=Short=null;
Buy=Sell=Cover=Short=null;
Buy=Sell=Cover=Short=null;
Buy=Sell=Cover=Short=null;
Buy=Sell=Cover=Short=null;
Buy=Sell=Cover=Short=null;
Buy=Sell=Cover=Short=null;
Buy=Sell=Cover=Short=null;
Buy=Sell=Cover=Short=null;
...etc.
I think that you agree, that repeating this line x times doesn't make much sense
Accessing array elements: [ ] - subscript operator:
www.amibroker.com/guide/a_language.html