I am very very puzzled, when the running hte following code on weekly timeframe for UK stock I see unexpected results eg Capricorn Energy (CNE)??
Very greatful is someone is able to provide some insight.
// ================================================================================
// TIMEFRAME: Daily
//
// CONDITIONS:
// c1: 50MA declining — current 50MA below its value 5 bars ago
// c2: 20MA trending higher over last 5 bars — all 5 increments rising
// c3: 20MA < 50MA < 80MA — MA stack in order
// c4: High above upper Bollinger Band — breakout attempt
//
// OUTPUT COLUMNS:
// none — simple pass/fail screener
//
// INDICATORS USED:
// - 20MA, 50MA, 80MA (daily)
// - Bollinger Bands upper (20 period, daily)
//
// KEY CODING NOTES:
// - c1: ma50 < ma50[5] — 50MA lower than 5 bars ago
// - c2: checks each of last 5 bars rising — ma20 > ma20[1] etc
// - c3: ma20 < ma50 AND ma50 < ma80
// - c4: high > BollingerUp[20](close)
// - No illegal line breaks — all compound conditions on single lines
// ================================================================================
TIMEFRAME(weekly)
ma20 = Average[20](close)
ma50 = Average[50](close)
ma80 = Average[80](close)
bbUpd = BollingerUp[20](close)
// c1: 50MA declining — below its value 5 bars ago
c1 = ma50 < ma50[5]
// c2: 20MA trending higher over last 5 bars
c2 = ma20 > ma20[1] AND ma20[1] > ma20[2] AND ma20[2] > ma20[3] AND ma20[3] > ma20[4] AND ma20[4] > ma20[5]
// c3: MA stack in order — 20MA < 50MA < 80MA
c3 = ma20 < ma50 AND ma50 < ma80
// c4: High above upper Bollinger Band — breakout attempt
c4 = high > bbUpd
// --- SCREENER ---
TIMEFRAME(default)
SCREENER[c1 AND c2 AND c3 AND c4]
Hello. I’ve checked the code and it’s correct. I don’t see anything unusual.
Can you show me the errors you’ve detected?
@sgrech
Plese select the correct support forum before starting a new topic.
I moved this one to the SCREENER support forum from Platform Support: Charts, Data & Broker Setup.
Thanks 🙂