HELP WITH coding a SCREENER with MACD and Stochastic PLEASE

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

    Please see attached screenshot…it’s and over bought or over sold setups using MACD and Stochastic ( settings in screenshot) and will use it mainly on 4 hour, daily, weekly timeframes.

    Thanks very much in advance

    OVER-BOUGHT-OR-SOLD-SCREENER-CRITERIA.jpg OVER-BOUGHT-OR-SOLD-SCREENER-CRITERIA.jpg
    #173995 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Thank you for sharing your idea.

    #173999 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Give your topic a meaningful title. Describe your question or your subject in your title. Do not use meaningless titles such as ‘Coding Help Needed’.

    Thank you 🙂

    #174000 quote
    nealhartnealhart
    Participant
    Junior

    Noted for next time.. I’m travelling at the moment 🙂

    #174007 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    Kline   = Stochastic[11,4](close)
    //Dline = Average[3](Kline)
    L1      = Kline <= 25
    S1      = Kline >= 75
    //
    MyMACD  = MACDline[12,26,9](close)
    Signal  = MACDSignal[12,26,9](close)
    L2      = MyMACD > Signal
    S2      = MyMACD < Signal
    //
    CondL   = L1 AND L2
    CondS   = S1 AND S2
    //
    Result  = 0
    IF CondL THEN
       Result = 1
    ELSIF CondS THEN
       Result = 2
    ENDIF
    SCREENER[Result](Result AS "1=↑, 2=↓")
    #174009 quote
    nealhartnealhart
    Participant
    Junior

    Hi, I pasted the code, but got “syntax errors” line 7,8?

    #174010 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    I tried to paste it and didn’t get any error.

    What version are you currently using?

    #174012 quote
    nealhartnealhart
    Participant
    Junior
    Ah, it’s the older 10.3 because some of my indicators don’t work so good on the newest version.
    #174013 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    I got it, MACDSignal is a new instruction added in v11.

    Use this code (this works with both versions):

    Kline   = Stochastic[11,4](close)
    //Dline = Average[3](Kline)
    L1      = Kline <= 25
    S1      = Kline >= 75
    //
    MyMACD  = ExponentialAverage[12](close) - ExponentialAverage[26](close)
    Signal  = ExponentialAverage[9](MyMACD)
    L2      = MyMACD > Signal
    S2      = MyMACD < Signal
    //
    CondL   = L1 AND L2
    CondS   = S1 AND S2
    //
    Result  = 0
    IF CondL THEN
       Result = 1
    ELSIF CondS THEN
       Result = 2
    ENDIF
    SCREENER[Result](Result AS "1=↑, 2=↓")
    #174737 quote
    nealhartnealhart
    Participant
    Junior

    Hi, sorry for the delay. I’ve been travelling…

    I’ve tried a few times, but I can’t get the screener to show up any trades. ..although there are no errors now.

    Is something wrong that I need to change?

    thanks

    Neal

    #174739 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    It works fine for me (tested on US shares, both 4h and 2min).

    Try several lists or try changing some settings for indicators.

    I am attaching the ITF file, in case you made some errors copying & pasting.

    Il-Mio-ProScreener9.itf
Viewing 11 posts - 1 through 11 (of 11 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

HELP WITH coding a SCREENER with MACD and Stochastic PLEASE


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
nealhart @nealhart Participant
Summary

This topic contains 10 replies,
has 2 voices, and was last updated by robertogozzirobertogozzi
5 years, 1 month ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 07/22/2021
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...