darvas box code

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #9871 quote
    eyal
    Participant
    New
    n = 4
    
    h = highest[n]
    
    l = lowest[n]
    
    once b = 2
    
    v = h
    
    if h = high[n-1] and high[n-1] > high and high[n-1] > low and (b = 1 or b = 2 ) then
    
    v = h
    
    b = 0
    
    else
    
    if l = low[n-1] and low[n-1] < low and low[n-1] < high and ( b = 0 or b = 2 ) then
    
    v = l
    
    b = 1
    
    else
    
    v = v[1]
    
    endif
    
    endif
    
    return v

     

    hi this is a code for placing tops and bottoms of the darvass boxes on a chart of candlesyicks

    the problem is that each time i try to paste it on the new code page the system writs “syntex error”  and does not eccept the code

    can you help?

    what is wrong?????

    #9877 quote
    Nicolas
    Keymaster
    Master

    Hi, this is because you are referring to future candlestick with “n-1” which is not possible in PRT, because it doesn’t make look in the past, the whole history is only loaded once.

    I’m not sure that it will draw correctly what you are trying to do here, but you can replace the “n-1” to “n+1” instead and see what happen.

    #9878 quote
    eyal
    Participant
    New
    n = 4
    
    h = highest[n]
    
    l = lowest[n]
    
    once b = 2
    
    v = h
    
    if h = high[n+1] and high[n+1] > high and high[n+1] > low and (b = 1 or b = 2 ) then
    
    v = h
    
    b = 0
    
    else
    
    if l = low[n+1] and low[n+1] < low and low[n+1] < high and ( b = 0 or b = 2 ) then
    
    v = l
    
    b = 1
    
    else
    
    v = v[1]
    
    endif
    
    endif
    
    return v

     

    hi i did with

    [n+1} as you sugested and still it gave a syntex error

    can you help?

    #9891 quote
    Nicolas
    Keymaster
    Master

    Yes, please find below the full code modified for probuilder compliance.

    n = 4
    
    hh = highest[n](high)
    l = lowest[n](low)
    
    once b = 2
    v = hh
    
    if hh = high[n+1] and high[n+1] > high and high[n+1] > low and (b = 1 or b = 2 ) then
    v = hh
    b = 0
    else
    
    if l = low[n+1] and low[n+1] < low and low[n+1] < high and ( b = 0 or b = 2 ) then
    v = l
    b = 1
    else
    v = v[1]
    endif
    endif
    
    return v
    #9967 quote
    eyal
    Participant
    New

    hi sorry to bother you but i pasted this code on the daily chart and all i see is that it makes a blue line from left to right all over the chart

    i do not know what that means?

    i like a code that will draw tops and bottoms of darvas boxes on the daily jap candlesticks chart

    this code doesnt do nothing///

    #9969 quote
    Nicolas
    Keymaster
    Master

    Yes this is the code you submit to be fixed. I don’t know where it comes from, maybe from another platform I guess? There is already another darvas boxes indicator in the library:

    http://www.prorealcode.com/prorealtime-indicators/darvas-boxes/

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

darvas box code


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
eyal @eyal Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by Nicolas
9 years, 7 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 06/27/2016
Status: Active
Attachments: No files
Logo Logo
Loading...