Plot(Equity(1), "Recalculated Equity", colorRed, styleOwnScale); If this red line deviates significantly from your backtest equity, your code is leaking future information. Professional verifiers add timestamps:
// --- 6. POSITION SCORING (Null-safe) --- PositionScore = Nz(RSI(), 50); // If RSI is Null, default to 50 PositionScore = IIf(PositionScore < 0, 10, PositionScore); // Sanity check amibroker afl code verified
// Long Exit: Close below entry price minus ATR multiple Sell = C < (ValueWhen(Buy, C, 1) - (ATR_Mult * ATR_Val)); // If RSI is Null
// Long Entry: Today's open > Previous period's high Buy = Open > PrevHigh; 1) - (ATR_Mult * ATR_Val))