This is the nature of the Nifty. It moves in one direction. That is the Range Expansion(RE). Then, after the RE, it pauses and consolidates. This pattern is likely to repeat itself as the market again consolidates after a 20% rally.
We do not know how long this consolidation will continue. Going by the last two ranges, it could be 8 to 15 trading days. Markets tend to become choppy inside a trading range. This is not about the Nifty alone. All stocks, futures, commodities show such choppiness when locked inside a range.
Often, traders will make large sums of money on a breakout, only to give up a lot of it when the Nifty moves in a trading range. While there are many ways to protect your capital during such consolidations, none of the ways are 'foolproof'. The ideal method is to trade with less volume. The second approach is to begin the trade as per your trading method but exit quickly as soon as the markets give the impression of starting a trend. (In a range, a new trend will not start so the impression that 'this is it' is actually the point where the current move will reverse). In brief, take profits quickly!