TDI Trader Dynamic Index

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #180662 quote
    supertitisupertiti
    Participant
    Master

    Bonjour à tous,

    Est-il possible de créer un indicateur qui nous retourne les divergences baissières et haussières sous forme d’histogrammes rouges et verts d’après l’indicateur

    de Nicolas ?

    Ici vous avez plus d’info sur le fonctionnement du TDI :

    https://www.tradingforexsp.com/metodo-market-maker

    En bas de page dans secretos TDI MMM vous avez un tuto en Anglais.

    	
    //parameters
    // lengthRSI = 13
    // lengthband = 34
    // lengthrsipl = 2
    // lengthtradesl = 7
     
    r = rsi[lengthrsi](close)
    ma = average[lengthband](r)
    offs = (1.6185 * std[lengthband](r))
    up = ma+offs
    dn = ma-offs
    mid = (up+dn)/2
    mab = average[lengthrsipl](r)
    mbb = average[lengthtradesl](r)
     
    lineup = 68
    linemid = 50
    linedown = 32
     
    RETURN lineup as "line up", linemid as "line mid", linedown as "line down", up coloured(0,238,238) as "up", dn coloured(0,238,238) as "dn", mid coloured(255,165,0) as "mid", mab coloured(0,255,0), mbb coloured(255,0,0)
    #180737 quote
    NicolasNicolas
    Keymaster
    Legend

    Le TDI c’est simplement un RSI de période 13 lissé par une moyenne mobile simple de 2 périodes. Donc même divergence qu’un RSI traditionnel.

    #180742 quote
    supertitisupertiti
    Participant
    Master

    merci Nicolas, je regarde cela dans la journée.

    Bonne semaine

    #180751 quote
    supertitisupertiti
    Participant
    Master

    J’ai fais ça mais j’ai des doutes cela n’a pas trop l’air effectif ?!

    // DIVERGENCES TDI TRADER DYNAMIC INDEX  by Nicolas modifié DID
    
    // TDI by Nicolas
    //parameters
    // lengthRSI = 13 perso =12
    lengthband = 34
    // lengthrsipl = 2
    lengthtradesl = 7
    
    r = rsi[lengthrsi](close)
    ma = average[lengthband](r)
    offs = (1.6185 * std[lengthband](r))
    up = ma+offs
    dn = ma-offs
    mid = (up+dn)/2
    mab = average[lengthrsipl](r)
    mbb = average[lengthtradesl](r)
    lineup = 68
    linemid = 50
    linedown = 32
    
    //RETURN lineup as "line up", linemid as "line mid", linedown as "line down", up //coloured(0,238,238) as "up", dn coloured(0,238,238) as "dn", mid coloured(255,165,0) as //"mid", mab coloured(0,255,0), mbb coloured(255,0,0)
    
    //////////////////////////////////////////////////////////////////////////////////////
    //PRC_AnotherRSIdivergences | indicator //25.02.2019
    //Nicolas @ www.prorealcode.com //Sharing ProRealTime knowledge
     
    // --- settings
    TDIp=12 //TDI period perso = 12
    obLevel=68 //overbought level
    osLevel=32 //oversold level
    minimalBars=5 //minimal count of bars where TDI is ob or os
    // --- end of settings
     
    // irsi = rsi[RSIp]
    itdi = mab[TDIp]
    ob = itdi>obLevel
    os = itdi<osLevel
     
    if ob then
    if not ob[1] then
    maxmab = 0
    maxprice = 0
    firstobbar = barindex
    endif
    maxtdi=max(maxmab,itdi)
    maxprice=max(maxprice,high)
    if maxtdi<>maxtdi[1] then
    maxtdibar=barindex
    endif
    endif
     
    if os then
    if not os[1] then
    mintdi = 100
    minprice = close*100
    firstosbar = barindex
    endif
    mintdi=min(mintdi,itdi)
    minprice=min(minprice,low)
    if mintdi<>mintdi[1] then
    mintdibar=barindex
    endif
    endif
     
    divsell=0
    if itdi crosses under obLevel then
    //verif divergence
    div = maxprice>oldmaxprice and maxtdi<oldmaxtdi and (barindex-firstobbar)>=minimalBars
    if div then
    drawsegment(oldmaxtdibar,oldmaxtdi,maxtdibar,maxtdi) coloured(200,0,0)
    drawarrowdown(maxtdibar,maxtdi) coloured(200,0,0)
    divsell=osLevel
    endif
    oldmaxtdi = maxtdi
    oldmaxprice = maxprice
    oldmaxtdibar = maxtdibar
    endif
     
    divbuy=0
    if itdi crosses over osLevel then
    //verif divergence
    div = minprice<oldminprice and mintdi>oldmintdi and (barindex-firstosbar)>=minimalBars
    if div then
    drawsegment(oldmintdibar,oldmintdi,mintdibar,mintdi) coloured(0,200,0)
    drawarrowup(mintdibar,mintdi) coloured(0,200,0)
    divbuy=osLevel
    endif
    oldmintdi = mintdi
    oldminprice = minprice
    oldmintdibar = mintdibar
    endif
     
    return itdi style(line,2) as "TDI",obLevel coloured(168,168,168) style(dottedline,1) as "overbought level", osLevel coloured(168,168,168) style(dottedline,1) as "oversold level", divsell coloured(200,0,0) style(histogram) as "sell divergence", divbuy coloured(0,200,0) style(histogram) as "buy divergence"
    ////////////////////////////////////////////////////////////////////////////////////////////////////////
    
Viewing 4 posts - 1 through 4 (of 4 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

TDI Trader Dynamic Index


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
supertiti @supertiti Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by supertitisupertiti
4 years, 10 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 10/31/2021
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...