Code Verified - Amibroker Afl

Search for these patterns:

AFL check snippet:

// Verified: No look-ahead
Buy = Cross( MACD(), Signal() ); // OK, uses current bar only

// NOT verified (look-ahead) Buy = Ref( Cross( MACD(), Signal() ), -1 ); // Signals based on NEXT bar? Wait: Ref(..., -1) is past? No: Ref(array, -1) is PREVIOUS bar. Ref(..., +1) is future. Be careful. amibroker afl code verified

| Aspect | Detail | |--------|--------| | False confidence | A “verified” code can still be a losing strategy. Verification ≠ validation. | | No look-ahead check | Many cheap verifiers miss Ref(..., -1) mistakes or StaticVar abuse. | | No optimization ethics | Verified code may still be curve-fitted to past data. | | Vague scope | Most services don’t define what “verified” includes – you may pay for just a syntax check. | Search for these patterns:

AmiBroker lacks a native assert(), but we can build one. AFL check snippet: // Verified: No look-ahead Buy

If your code uses PositionScore (for ranking), verified code ensures it never produces Null:

// Verified
PositionScore = IIf(Nz(RSI(), 0) > 0, RSI(), 0);

Discover more from Liz Roberta

Subscribe now to keep reading and get access to the full archive.

Continue reading