Cannpt screen with my code?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #211733 quote
    thomas2004chthomas2004ch
    Participant
    Senior

    Hi,

     

    My screener code looks as follow:

    once l=21
    once o=3
    once m=3
    once fast=12
    once slow=26
    once smooth=9
    once n=300

    // Define KDJ
    hi = highest[l](high)
    lo = lowest[l](low)
    oscillator = (close – lo) / (hi – lo + 0.001) * 100
    rsv = ExponentialAverage[m](oscillator)
    k = ExponentialAverage[m](rsv)
    d = ExponentialAverage[o](k)
    j = 3*k – 2*d

    // Define MACD
    DIF = ExponentialAverage[fast](Close) – ExponentialAverage[slow ](close) // MACD
    DEA = ExponentialAverage[smooth](DIF) // Signal
    MyMACD = (DIF-DEA)//*2 // Histo

    // Define MJ
    KH=highest[n](K)
    DH=highest[n](D)
    JH=highest[n](J)
    KL=lowest[n](K)
    DL=lowest[n](D)
    JL=lowest[n](J)
    KDJMAX=MAX(KH,MAX(DH,JH))
    KDJMIN=MIN(KL,MIN(DL,JL))
    KDJM2=(KDJMAX+KDJMIN)/2
    KDJA2=(KDJMAX-KDJMIN)

    DIFH=highest[n](DIF)
    DEAH=highest[n](DEA)
    MACDH=highest[n](MYMACD)
    DIFL=lowest[n](DIF)
    DEAL=lowestBars[n](DEA)
    MACDL=lowest[n](MYMACD)
    MACDMAX=MAX(DIFH,MAX(DEAH,MACDH))
    MACDMIN=MIN(DIFL,MIN(DEAL,MACDL))
    MACDM1=(MACDMAX+MACDMIN)/2
    MACDA1=(MACDMAX-MACDMIN)

    NEWBASE=(0-MACDM1)*KDJA2/MACDA1+KDJM2

    NewJ = J-NEWBASE
    /////////////////////

    // Long

    long1 = ((NewJ crosses over 0) or (NewJ[1] crosses over 0))

    SCREENER[long1] (close * Volume AS “Markt”)

    But as I scan the NYSE the result is zero. It must not the truth. Wenn I take out the last 2 lines and set RETURN NewJ as indicator, it works. There must be something wrong?

    #211738 quote
    JC_BywanJC_Bywan
    Moderator
    Master

    Hello,

    it depends if you have PRT complete version or premium version. Your n=300 used as period for most elements of the code mean they are undefined within the limited 256 screener bars history of PRT complete (while history has been increased to 1024 bars for PRT premium screeners)

    #211743 quote
    thomas2004chthomas2004ch
    Participant
    Senior

    I change the n to 255 and it works now.

    Many thanks!

Viewing 3 posts - 1 through 3 (of 3 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

Cannpt screen with my code?


ProScreener: Market Scanners & Detection

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by thomas2004chthomas2004ch
3 years, 6 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 03/19/2023
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...