Momentum Divergence/Convergence

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

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

    #188194 quote
    robertogozzi
    Moderator
    Master

    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.

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 robertogozzi
4 years, 1 month ago.

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