MACD screener to code

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #24588 quote
    SAM
    Participant
    Senior

    Hi  Nicolas,

    Could you help me to code a screener with this conditions?

    1. Macd ligne >0
    2. When 1) in true within next 6 bars, close break-out the high of the last 10 bars

    Thank-you!!

    #24605 quote
    Nicolas
    Keymaster
    Legend

    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.

    #24992 quote
    SAM
    Participant
    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]
    #24996 quote
    Nicolas
    Keymaster
    Legend

    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]
    #25152 quote
    SAM
    Participant
    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?

    #25202 quote
    Nicolas
    Keymaster
    Legend

    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.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

MACD screener to code


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
SAM @amos Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by Nicolas
9 years, 7 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 02/10/2017
Status: Active
Attachments: No files
Logo Logo
Loading...