Yes, 'Hedge = 2' is correct - this will be fixed.

Pending orders are placed higher than the Close, though, because the for loop runs until the price is 5 grid lines above the close.