SAMParticipant
Senior
Hi Nicolas,
Could you help me to code a screener with this conditions?
- Macd ligne >0
- When 1) in true within next 6 bars, close break-out the high of the last 10 bars
Thank-you!!
Here is the code you are requested, the MACD was at least 6 bars above 0 and the Close of the current candlestick is breaking the highest high of the last 10 bars:
m = summation[6](macd[12,26,9]>0)=6
b = close crosses over highest[10](high)[1]
screener [m and b]
Not tested, please tell us if it’s working ok for you.
SAMParticipant
Senior
Hi Nicolas, sorry for the delay.. Thanks very much for your answer… and for your time!!
I tried your code and work verygood!!
But my mistake, I actually wanted to ask that the condition “b” is verified within 6 bar since when macd[12,26,9] crosses over 0. (Not only >0)
This code with the condition macd[12,26,9]>0 finds a many shares.
I tried to write a code, but not work good… could you help me? Thank very much!!
a = macd[12,26,9]
c1= a crosses over 0
if c1 then
m = summation[6](a>0)=6
b = close crosses over highest[10](high)[1]
endif
screener [m and b]
This modified code should do the trick:
a = macd[12,26,9]
c1= a crosses over 0
m = summation[6](c1)>0
b = close crosses over highest[10](high)[1]
screener [m and b]
SAMParticipant
Senior
Dear Nicolas, so work very good!! It’s just that I needed!!
I wrote a screener (long or Short)
once direction =0
a = macd[12,26,9]
c1= a crosses over 0
c2 = a crosses under 0
m = summation[6](c1)>0
n = summation[6](c2)>0
b1 = close crosses over highest[10](high)[1]
b2 = close crosses under Lowest[10](low)[1]
if m and b1 then
direction=1
endif
if n and b2 then
direction=-1
endif
screener [(m and b1) or (n and b2)](direction)
Could I make a new library screener?
Of course you can! Please do it! 🙂 I’m happy to know it suits your needs. Please add a little description of the screener when you’ll post it into the code library. Thanks in advance.