How to create signals correctly using the array subscript?

There are 20K+ bars on the current symbol, and I've set

SetBarsRequired(sbrAll, sbrAll); // No QuickAFL, using all bars.

but I've got "Error 10. Array subscript out of range"
after I click the "Verify syntax" tool button on the formula editor,
all my code is as follows:

Buy = Sell = 0;
Buy[6000]=True;  // Create a Buy on the 6000-th bar ====> Error 10.
Sell[7000]=True; // Create a Sell on the 7000-th bar ====> Error 10.

I don't know how to solve this, please help.

Thank you very much.

Required reading:

and: