How To Add Buy Or Sell With 2 Screener Conditions

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #67483 quote
    nealhartnealhart
    Participant
    Junior

    Hi, I have my code working when 2 indicators ( when 2 conditions meet) line up for a sell signal,
    but how do I get the opposite “buy” side signal (which is exactly opposite of sell code) on the same
    screener that will display as a buy or sale correctly only when triggered to display within the screener?

    Thanks

    Sell code working…but need to add my buy signal on same screener

    indicator1 = Average[1](Stochastic[3,1](close))
    c1 = (indicator1 CROSSES OVER 78)
    
    indicator2 = ExponentialAverage[9](MACDline[8,26,9](close))
    indicator3 = MACDline[8,26,9](close)
    c2 = (indicator2 > indicator3)
    
    
    SCREENER[c1 AND c2] (Variation AS "%Chg prev bar")
    #67487 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Trye this

    indicator1 = Average[1](Stochastic[3,1](close))
    c1 = (indicator1 CROSSES OVER 78)
    d1 = (indicator1 CROSSES UNDER 22)
     
    indicator2 = ExponentialAverage[9](MACDline[8,26,9](close))
    indicator3 = MACDline[8,26,9](close)
    c2 = (indicator2 > indicator3)
    d2 = (indicator2 < indicator3)
     
    x1 = c1 AND c2
    x2 = (d1 AND d2) * 2
    
    y = x1 OR x2
    SCREENER[y] (y AS "1/2")     //1=bullish, 2=bearish

    Roberto

    #67494 quote
    nealhartnealhart
    Participant
    Junior

    Great, thanks so much for your help.

    Will it display buy and sell setups on just the 60 minute timframe? Or what part of your code makes it a 60 min screener? ( so I can change other TF’s)

    Or is there an easy way to add more timeframes to the one screener?

    With this exact code, can you tell me how I could add 5 min, 15 min, 60 min, 4 hour, and Daily timeframes for example?

    Thankyou very much

    #67508 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    When you install and run it you have to apply it to the TF you prefer.

    You can easily duplicate it and run it more than once, each time for a different TF.

    Here you may find useful hints and suggestions https://www.youtube.com/channel/UC0OEWQSbrDTH2ArVFAzNJkQ

    ana more here https://www.youtube.com/channel/UC8bNosI3wuid_3Ze7CzorvA

    #180045 quote
    oyinloyeaoyinloyea
    Participant
    Veteran

    Hi Roberto, This code does not work anymore. It only gives criteria 1 in its result. I tried it on 10.3 and the new prorealcode. Regards

    #180107 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    This one should do:

    indicator1 = Average[1](Stochastic[3,1](close))
    c1 = (indicator1 CROSSES OVER 78)
    d1 = (indicator1 CROSSES UNDER 22)
    indicator2 = ExponentialAverage[9](MACDline[8,26,9](close))
    indicator3 = MACDline[8,26,9](close)
    c2 = (indicator2 > indicator3)
    d2 = (indicator2 < indicator3)
    y = 0
    IF c1 AND c2 THEN
       y = 1
    ELSIF d1 AND d2 THEN
       y = 2
    ENDIF
    SCREENER[y] (y AS "1=↑, 2=↓")     //1=bullish, 2=bearish
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

How To Add Buy Or Sell With 2 Screener Conditions


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
nealhart @nealhart Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by robertogozzirobertogozzi
4 years, 11 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 04/07/2018
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...