Momentum Divergence/Convergence

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #188139 quote
    GCrowGCrow
    Participant
    New

    Hello, can You help me to create a screener for Divergence/Convergence detection based on Momentum indicator, please?

    #188194 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Post your topic in the correct forum:
    _ ProRealTime Platform Support: only platform related issues.
    _ ProOrder: only strategy topics.
    _ ProBuilder: only indicator topics.
    _ ProScreener: only screener topics
    _ General Discussion: any other topics.
    _ Welcome New Members: for new forum members to introduce themselves.

    I moved it from Probuilder. Thank you 🙂

    There you go:

    /////////////////////////////////////////////
    // Momentum Divergences (based on MACD divergences on MACD by Jose Callao
    
    N=50            //N is the number of bars to look back for a divergence.
    P=12
    MyMOM = Momentum[P](close)
    Signal = 0
    IF (BarIndex > P+N) THEN
    
    ///divergencia bajista
    IF (MyMOM[1]>MyMOM AND MyMOM[1]>MyMOM[2]) THEN
    extremum2=MyMOM[1]
    extremum1=highest[N](MyMOM)
    
    preciomax2=close[1]
    preciomax=Highest[N](close)
    
    IF(extremum2<extremum1 AND preciomax2>preciomax[1]) THEN
    for i=1 to N
    if MyMOM[i]=extremum1 then
    //zz=i
    Signal = 2
    //drawsegment (barindex[1], MyMOM[1], barindex[zz], MyMOM[zz]) coloured(200,0,0)
    endif
    next
    
    endif
    endif
    
    ///divergencia alcista
    IF (MyMOM[1]<MyMOM AND MyMOM[1]<MyMOM[2]) THEN
    extremum22=MyMOM[1]
    extremum11=lowest[N](MyMOM)
    
    preciomin2=close[1]
    preciomin=lowest[N](close)
    
    IF(extremum22>extremum11 AND preciomin2<preciomin[1]) THEN
    for i2=1 to N
    if MyMOM[i2]=extremum11[1] then
    //zz2=i2
    Signal = 1
    //drawsegment(barindex[1], MyMOM[1], barindex[zz2], MyMOM[zz2]) coloured(0,200,0)
    endif
    next
    ENDIF
    
    ENDIF
    endif
    
    Screener[Signal](Signal AS "1=↑, 2=↓")
    GraHal thanked this post
Viewing 2 posts - 1 through 2 (of 2 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

Momentum Divergence/Convergence


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
GCrow @gcrow Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
4 years, 7 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 02/12/2022
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...