It has nothing to do with the order count limitation. This is a normal behavior, because you set a pending buy stop order at a price under the actual market price, so this pending order is automatically converted into a market one.
If you want to prevent this to happen, just add a condition to test if the market price is under your long order threshold price: (and vice-versa for the short order)
If not onmarket and time>= Startzeit and time < Endzeit and count<3 and Spannepoints < MaxBox then
if(close<Hi+(Spread/2)) then
BUY Position Lot AT Hi+(Spread/2) Stop
endif
if(close>Lo-(Spread/2)) then
Sellshort Position Lot AT Lo-(Spread/2) Stop
ENDIF
endif
RazzParticipant
Master
Thank you Nicolas for your help, it is so easy, I would not have thought of it.