Darvas Boxes de Trading View

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #232666 quote
    DonTonyDonTony
    Participant
    Average

    Bonjour à tous,

    J’aimerais savoir si une âme sympathique ici présente peut me traduire ce code des boite de Darvas.

    Ce code est issue de Trading View.

    J’ai comparer avec les 2 codes de boite de Darvas présente sur ce forum mais ce code de Trading View n’est pas le même.

    Je joins une capture d’écran desdites boites de Darvas Trading View.

    Merci par avance!

    Tony

    //@version=3
    
    //author KıvanÇ @fr3762 on twitter
    //creator Nicholas Darvas
    
    
    study("DARVAS BOX",overlay=true, shorttitle="DARVAS")
    //iff(low=lowest(low,5),low,iff(low[1]=lowest(low,5),low[1],iff(low[2]=lowest(low,5),low[2],iff(low[3]=lowest(low,5),low[3],iff(low[4]=lowest(low,5),low[4],0)))))
    //iff(low=lowest(low,5),low,iff(low[1]=lowest(low,5),low[1],iff(low[2]=lowest(low,5),low[2],iff(low[3]=lowest(low,5),low[3],iff(low[4]=lowest(low,5),low[4],0)))))
    boxp=input(5, "BOX LENGTH")
    
    LL = lowest(low,boxp)
    k1=highest(high,boxp)
    k2=highest(high,boxp-1)
    k3=highest(high,boxp-2)
    
    NH =  valuewhen(high>k1[1],high,0)
    box1 =k3<k2
    TopBox = valuewhen(barssince(high>k1[1])==boxp-2 and box1, NH, 0)
    BottomBox = valuewhen(barssince(high>k1[1])==boxp-2 and box1, LL, 0)
    
    
    plot(TopBox, linewidth=3, color=green, title="TBbox")
    plot(BottomBox, linewidth=3, color=red, title="BBbox")
    Darvas-Boxes.png Darvas-Boxes.png Darvas-Boxes-1.png Darvas-Boxes-1.png
    #232706 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Ici, vous avez le code traduit :

    //-------------------------------------------------//
    //PRC_Darvas Boxes
    //version = 0
    //15.05.24
    //Iván González @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //-------------------------------------------------//
    //-----Inputs--------------------------------------//
    boxp=5//Box Length
    color=1//Color between top and bottom?
    //-------------------------------------------------//
    //-----High and Low Bands--------------------------//
    ll=lowest[boxp](low)
    k1=highest[boxp](high)
    k2=highest[max(1,boxp-1)](high)
    k3=highest[max(1,boxp-2)](high)
    //-------------------------------------------------//
    //-----New Highs Detection-------------------------//
    if high>k1[1] then
    nh=high
    else
    nh=nh
    endif
    //-------------------------------------------------//
    //-----Top and Bottom definition-------------------//
    box1=k3<k2
    if barssince(high>k1[1])=(boxp-2) and box1 then
    topbox=nh
    bottombox=ll
    else
    topbox=topbox
    bottombox=bottombox
    endif
    //-------------------------------------------------//
    //-----Plotting------------------------------------//
    drawpoint(barindex,topbox)coloured("green")
    drawpoint(barindex,bottombox)coloured("red")
    if color then
    colorbetween(topbox,bottombox,"yellow",50)
    endif
    //-------------------------------------------------//
    return
    
    #232832 quote
    DonTonyDonTony
    Participant
    Average

    Merci Beaucoup Ivàn!

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

Darvas Boxes de Trading View


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
DonTony @dontony Participant
Summary

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

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 05/15/2024
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...