Trying to build a screener it showe
// Daily Timeframe
timeframe(daily)
DAILYMA10 = CALL "STIPH10"[1, 10]
// Calculate daily conditions
DAILYBULL = (close > DAILYMA10) // Bullish trend condition
DAILYBEAR = (close < DAILYMA10) // Bearish trend condition
if DAILYBULL then
DAILYTREND = 1 // Bullish trend
elsif DAILYBEAR then
DAILYTREND = -1 // Bearish trend
else
DAILYTREND = 0 // Neutral trend
endif
// 1-Hour Timeframe
timeframe(1hour)
HOURMA10 = CALL "STIPH10"[1, 10]
// Calculate 1-hour conditions
HOURBULL = (close > HOURMA10) // Bullish trend condition
HOURBEAR = (close < HOURMA10) // Bearish trend condition
if HOURBULL then
HOURTREND = 1 // Bullish trend
elsif HOURBEAR then
HOURTREND = -1 // Bearish trend
else
HOURTREND = 0 // Neutral trend
endif
// Default Timeframe (15-Minute)
timeframe(default)
MA10 = CALL "STIPH10"[1, 10]
// Calculate 15-minute conditions
MINUTELONG = (close CROSSES OVER MA10) // 15-minute long condition
MINUTESHORT = (close CROSSES UNDER MA10) // 15-minute short condition
// Combine All Timeframe Conditions
if DAILYTREND = 1 AND HOURTREND = 1 AND MINUTELONG then
SIGNAL1 = 1 // Long Signal
DIRECTION = 1
elsif DAILYTREND = -1 AND HOURTREND = -1 AND MINUTESHORT then
SIGNAL2 = -1 // Short Signal
DIRECTION = -1
//else
//SIGNAL = 0 // Neutral
//DIRECTION = 0
endif
// Screener Output
// Screener Output
SCREENER [SIGNAL1 OR SIGNAL2 ] (DIRECTION as "Bull/Bear")
d me too many so I only want to look back. Free bars if anyone can help with this I think the code is right but if you can see any issues with the code please please help me
// Daily Timeframe
timeframe(daily)
DAILYMA10 = CALL "STIPH10"[1, 10]
// Calculate daily conditions
DAILYBULL = (close > DAILYMA10) // Bullish trend condition
DAILYBEAR = (close < DAILYMA10) // Bearish trend condition
if DAILYBULL then
DAILYTREND = 1 // Bullish trend
elsif DAILYBEAR then
DAILYTREND = -1 // Bearish trend
else
DAILYTREND = 0 // Neutral trend
endif
// 1-Hour Timeframe
timeframe(1hour)
HOURMA10 = CALL "STIPH10"[1, 10]
// Calculate 1-hour conditions
HOURBULL = (close > HOURMA10) // Bullish trend condition
HOURBEAR = (close < HOURMA10) // Bearish trend condition
if HOURBULL then
HOURTREND = 1 // Bullish trend
elsif HOURBEAR then
HOURTREND = -1 // Bearish trend
else
HOURTREND = 0 // Neutral trend
endif
// Default Timeframe (15-Minute)
timeframe(default)
MA10 = CALL "STIPH10"[1, 10]
// Calculate 15-minute conditions
MINUTELONG = (close CROSSES OVER MA10) // 15-minute long condition
MINUTESHORT = (close CROSSES UNDER MA10) // 15-minute short condition
SIGNAL = 0
// Combine All Timeframe Conditions
if DAILYTREND = 1 AND HOURTREND = 1 AND MINUTELONG then
SIGNAL = 1 // Long Signal
DIRECTION = 1
elsif DAILYTREND = -1 AND HOURTREND = -1 AND MINUTESHORT then
SIGNAL = -1 // Short Signal
DIRECTION = -1
//else
//SIGNAL = 0 // Neutral
//DIRECTION = 0
endif
// Screener Output
// Screener Output
SCREENER [SIGNAL] (DIRECTION as "Bull/Bear")
Hi, you can write the following at the end of the code:
bars=barssince(signal<>0)
SCREENER [bars>=0 and bars<3] (DIRECTION as "Bull/Bear")
Is it possible to have more than one screener running and thank you very much for the help that did work
Hi!
Yes you can run more than one as you can see in the attached screenshot.