Donchian Channel

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #5599 quote
    plp64
    Participant
    New

    Salve, è la prima volta che mi cimento a programmare un trading system.

    Ho la necessità di verificare se il range di oggi (tempo 0) del Donchian Channel (differenza tra canale alto e canale basso) calcolato su 20 giorni sia minore del range di 20 giorni fa.

    Ho provveduto a creare la seguente funzione:

    RangeDCC = Highest[20](High) – Lowest[20](Low)
    Return RangeDCC AS “RangeDCC”

    Effettivamente questo grafico mi riporta correttamente il range da me cercato.

     

    Nelle rules, oltre ad altri indicatori ho inserito le seguenti istruzioni:

    indicator5 = CALL RangeDCC
    indicator6 = Call RangeDCC[20]
    c3 = (indicator5 < indicator6)

    IF c1 AND c2 AND c3 THEN
    BUY 1000 SHARES AT MARKET
    ENDIF

    Il backtest non parte perchè mi da il seguente messaggio d’errore:

    Errore di sintassi: la funzione RangeDCC è chiamata con 1 parametro (i)invece di 0 previsti

    Ringrazio in anticipo chi volesse aiutarmi

    #5663 quote
    Nicolas
    Keymaster
    Legend

    L’errore di sintassi viene dal vostro “CALL”.
    Per ottenere il valore di indicateur5 ci sono 20 candele dietro, facendo un po ‘come questo

    indicator5 = CALL RangeDCC
    indicator6 = indicator5[20]

    Questo funziona meglio ?

    #5669 quote
    plp64
    Participant
    New

    Grazie per la risposta.

    no, mi da lo stesso tipo di errore.

    sarà per come ho scritto la funzione RangeDCC ?

    #5674 quote
    plp64
    Participant
    New

    Ho risolto !

    In pratica ho inserito “indicator5” a tutti le linee in cui erano presenti Call RangeDCC

    Grazie mille !

    #5687 quote
    Nicolas
    Keymaster
    Legend

    Niente, sono contento sono riuscito ad aiutare!

Viewing 5 posts - 1 through 5 (of 5 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

Donchian Channel


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
plp64 @plp64 Participant
Summary

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

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 04/18/2016
Status: Active
Attachments: No files
Logo Logo
Loading...