Darvas indicator for building strategies

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

    I tried to use Darvas indicator for building strategies
    I call it as it is written in the manual but received only zeros
    Below I present the code strategy and indicator

    user's indicator Darvas
    
    hh = highest[n]
    ll = lowest[n]
    once state = 2
    v = hh
    
    if hh = high[n-1] and high[n-1] > high and high[n-1] > low and (state = 1 or state = 2 ) then
    v = hh
    state = 0
    x = 0
    elsif ll = low[n-1] and low[n-1] < low and low[n-1] < high and ( state = 0 or state = 2 ) then
    x = ll
    state = 1
    v = 0
    elsif state = 0 and high > v[1] then
    v = 0
    x = 0
    state = 2
    elsif state = 1 and low < x[1] then
    x = 0
    v = 0
    state = 2
    else
    v = v[1]
    x = x[1]
    endif
    return v AS "Darvas R", x AS "Darvas S"
    

    call in trading system program

    myDarvasR, myDarvasS = CALL “Darvas Boxes Forever”[4]

     
    i receive values myDarvasR, myDarvasS are equal zeros all time
    What is my errors?

    #21568 quote
    Nicolas
    Keymaster
    Master

    I fell by chance on this old subject, sorry for late answer 🙂
    Your code of Darvas boxes use future data, that’s why it is not possible to use it in a trading strategy with ProOrder/ProBacktest.

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

Darvas indicator for building strategies


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
alpin2al @alpin2al Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Nicolas
9 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 06/16/2016
Status: Active
Attachments: No files
Logo Logo
Loading...