how to call the strategy of a custom indicator

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

    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?

    #9443 quote
    Nicolas
    Keymaster
    Master

    Does your variables always return 0? Did you test them with a GRAPH instruction in your strategy already?

    Also, a “defparam preloadbars=100” should help. Because you need historical datas to compute correctly the indicator.

    #9467 quote
    Adolfo
    Participant
    Senior

    Where is “n” variable defined?

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

how to call the strategy of a custom indicator


Community Welcome & Introductions

New Reply
Author
author-avatar
alpin2al @alpin2al Participant
Summary

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

Topic Details
Forum: Community Welcome & Introductions
Language: English
Started: 06/16/2016
Status: Active
Attachments: No files
Logo Logo
Loading...