Why require two closes?
A single close above resistance can be followed by an immediate reversal. This long-only MultiCharts PowerLanguage signal requires two consecutive closes above the same historical resistance level. The extra confirmation delays entry and may reduce some false signals, but it can also miss fast trends.
Define a common reference level
At the second confirmation bar, calculate the highest high of the 20 bars ending two bars ago. Both the previous and current close must exceed this level. Excluding both confirmation bars avoids moving the resistance upward with the breakout itself. If resistance is 100 and the next closes are 101 and 99, reject; if they are 101 and 102, accept. Submit a market entry for the following bar.

Hypothetical close sequences against a shared resistance of 100. The second close determines confirmation.
PowerLanguage signal example
Inputs: Lookback(20), StopDollars(200);
Vars: Level(0);
Level = Highest(High[2], Lookback);
If MarketPosition = 0 and
Close[1] > Level and Close > Level then
Buy ("TwoClose") next bar at market;
SetStopContract;
SetStopLoss(StopDollars);
If MarketPosition = 1 and Close < Lowest(Low[1], 10) then
Sell ("ChannelExit") next bar at market;
Use a bar-close calculation with intrabar order generation disabled for this example. Set MaxBarsBack sufficiently high for the lookback plus the two-bar offset. Set the strategy order quantity explicitly in properties. SetStopContract makes the illustrative 200-dollar stop apply per contract or share, rather than the entire position; adjust this amount for instrument economics and account risk. The channel exit compares the close with the lowest low of the preceding ten bars.
Execution and validation
The next-bar market order is not a promise of a fill at the confirmation close. Gaps, slippage, commissions and order routing can change results. The rolling two-close rule can re-enter after an exit if conditions remain true; add a separate rearming state if only one trade per breakout is desired. Test one-close versus two-close variants with identical costs, then compare trade count, average trade, drawdown and out-of-sample results. Check stop behavior in historical and simulated live execution, including disconnects and broker synchronization. This illustrative signal has not been compiled or backtested here. Trading involves risk of loss.
For tailored confirmation rules and order management, see Custom MultiCharts strategy Development Services.