Best indicators for grid trading?

Hi guys,
For the past few weeks I have been developing a grid trading EA. It is incomplete at the moment, otherwise I’d post it. Basically the way it works is this (in a M15 period):

  1. Use an indicator or combination of indicators to find a sideways market (no trading during trending periods).

  2. Create a “frame” around the price; for example 0.5% above the price and 0.5% below the price.

  3. Trade WITHIN the frame as long as the indicator shows that no serious trending is going on.

  4. If the price leaves the frame, hedge with the same currency to freeze the losses.

  5. Goto 1

At the moment the only indicator that I am using to determine if the market is sideways-enough is Alligator. I enter when the mouth is closed.

Am I right to think that this indicates a sideways market?
What other indicators would be useful?
I need an indicator that would determine a good size for my frame; so that the size of the frame coincides with pivot points of the market.

I was thinking of using one of the many RL/SL indicators out there for the frame size. Any suggestions?

The only thing i can think of is the ATR, do you have any ideas ?