PereParticipant
Veteran
Hi.
I’m trying to code a screener which can return the indices which meets the same condition in three different timeframes at the same time, 4 hours, 1 hours and 5 minutes. The condition is that the Elder Impulse System are positive (or negative) on these three different timeframes at the same time.
However, the screener does not work: it returns sometimes the indices where the pulse is positive or negative in only 1 or two timeframes. The code I programmed is:
rem >> Elder Impulse System <<
r=13
MACDhHoy = MACD[12,26,9](close)[0]
MACDhAyer = MACD[12,26,9](close)[1]
MediaHoy= ExponentialAverage[r](close)[0]
MediaAyer= ExponentialAverage[r](close)[1]
if (MACDhHoy > MACDhAyer) then
Momento = 0.5
else
Momento = -0.5
endif
if (MediaHoy > MediaAyer) then
Tendencia = 0.5
else
Tendencia = -0.5
endif
EIS = Momento + Tendencia
TIMEFRAME (4 hours)
eis4h=EIS>0
eis4l=EIS<0
TIMEFRAME (1 hour)
eis1h=EIS>0
eis1l=EIS<0
TIMEFRAME (5 minutes)
eis5h=EIS>0
eis5l=EIS<0
SCREENER[(eis4h AND eis1h AND eis5h) OR (eis4l AND eis1l AND eis5l)]
Where can be the error?
And last question: on the programming window for screeners there is a field where I can choose only one timeframe. Which one shall I choose for the desired three timeframes? The biggest one, 4 hours?
Hi Petrus.
I think I encountered the same problem before. The screener function does not operate below 1 or is it 4 hours time frame- which means that at least your 5 min TF is not valid for the screener. It should generate an error message when trying to code it- did you see any of such things?
Cheers Kasper
PereParticipant
Veteran
Hi Kasper. Thanks for your answer.
No, I did not get any error when I coded it.
Do you mean that it could work with other timeframes, for example with daily, 4 hours and 1 hour? Because I coded another screener with these timeframes, choosing crossing of EMAs with price, which works perfectly! And what do you mean with “does not operate below 1”?
Thanks and cheers
Yes I think it could work that way. I mean that the Screener cannot operate below 1h TF. I am not 100% sure that it could work on a 1h TF, but below it will not work.
PereParticipant
Veteran
Thank you Kasper.
You are probably right, because I already told you that my other screener works perfectly with the three timeframes of 1D, 4H and 1H, that means that 1H TF is OK.
alecParticipant
Junior
Hello Petrus /Kasper,
“…… my other screener works perfectly with the three timeframes of 1D, 4H and 1H, that means that 1H TF is OK …”
I am trying to write a ProScreener for Major FX Pairs; to screen 20MA and 50MA crossover and Price Action Close (bullish and bearish) for 1W, 1D, 4H, 1H.
Will your “other screener” help me please ?
Thanks
PereParticipant
Veteran
Hi Alec.
Tel me please the exact rules you want, and I will try to code it.
alecParticipant
Junior
Hi Petrus,
Please, I apologise for slow reply to your kind offer. I find this site difficult to navigate and missed your message. I will need to think about exact rules for my idea and then will send to you, but I am away next week so the week after this. Do I post in here or send to you please ? Thankyou.
PereParticipant
Veteran
Hi alec.
You can post it directly here, so perhaps it can help other people too.
To be informed of ALL the answers to this post, you only have to mark on the bottom of your answer “Notify me of follow-up replies via email”, or better on the top-right of the post “Subscribe”, and you will get an email every time there is any answer on this post.
alecParticipant
Junior
Thankyou Petras. I understand website better now. I am away this week in Wales; walking in the rain!
I will post my thinking about rules next week.
I also need to correct my self. The screener should also work on lower TF, such as 15 min
TIMEFRAME(15 minute)
PereParticipant
Veteran
Yes, I tested one screener with 4 different timeframes. It works even in 5 and 1 minutes!
PereParticipant
Veteran
The only secret is to define specific variables for each timeframe, not the same variables applied on the different timeframes as I did on the code starting this post.
alecParticipant
Junior
Hi Petrus,
I have tried to say the conditions for the Screener that I want to use.
Here are my Trend Screener rules to make a shortlist of markets that are in a Trend:
- Trend Up : Weekly 12EMA above the Weekly 169EMA , AND , the Daily 12EMA above the Daily 169EMA . When both the Weekly and the Daily are aligned then it indicates an Up Trend in the market and we are now looking for a Buy Signal.
- Trend Down : Weekly 12EMA below the Weekly 169EMA , AND , the Daily 12EMA below the Daily 169EMA . When both the Weekly and the Daily are aligned then it indicates a Down Trend in the market and we are now looking for a Sell Signal.
- When Weekly and Daily are not aligned then I am neutral for any market, eg. not looking to Buy or Sell.
Here are my rules to indicate a Buy and Sell in a market. I am not sure whether an Indicator might be better than a Screener for this ? I will have a shortlist from the Trend Screener and then use the following rules to get a Buy / Sell Signal.
- Buy Signal : 4hr 12EMA is above the 4hr 60MA, AND , 1hr 12EMA is above the 1hr 60MA . When both the 4hr and 1hr are aligned in an Up Trend then after this signal I am looking to go long and buy the market.
- Sell Signal : 4hr 12EMA is below the 4hr 60MA, AND , 1hr 12EMA is below the 1hr 60MA . When both the 4hr and 1hr are aligned in a Down Trend then after this signal I am looking to go short and sell the market.
I hope this makes sense for you, many thanks.
PereParticipant
Veteran
Hi alec.
As far as I know (perhaps I’m wrong), it is not possible to build an indicator for different timeframes. It is also not possible to do Proorder with different timeframes, only Proscreener. Nicolas told us somewhere that in the future it will be possible with Proorder, but I don’t know when.
So, I did the code with 4 conditions, two for the trends and the other two for the Buy/Sell signal, and I hope it will work for you:
TIMEFRAME (Weekly)
aw=ExponentialAverage[169](close)
bw=ExponentialAverage[12](close)
wup = bw > aw
wdo = bw < aw
TIMEFRAME (Daily)
ad=ExponentialAverage[169](close)
bd=ExponentialAverage[12](close)
dup = bd > ad
ddo = bd < ad
TIMEFRAME (4 hours)
b4h=ExponentialAverage[12](close)
c4h=Average[60](close)
4hup = b4h > c4h
4hdo = b4h < c4h
TIMEFRAME (1 hour)
b1h=ExponentialAverage[12](close)
c1h=Average[60](close)
1hup = b1h > c1h
1hdo = b1h < c1h
SCREENER[(wup AND dup AND 4hup AND 1hup) OR (wdo AND ddo AND 4hdo AND 1hdo)]