"Un paramètre de type entier positif est attendu"

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

    Bonjour,

    Je me permet de demander de l’aide car je m’arrache les cheveux depuis des heures sur le message d’erreur suivant que me donne PRT en validant mon code :”Un paramètre de type entier positif est attendu avec DPO”.

    J’ai essayé avec une autre fonction de type RSI et le message reste identique.

    Mon code global est plus long (le but étant le tracé de canaux de tendance) mais je n’ai mis que la partie jusqu’à la fonction DPO qui pose problème :

    ema50 = ExponentialAverage[50](close)
    sma200 = average[200](close)
    
    if ema50 crosses over sma200 then
    Y = close
    
    for i = 1 to 100 do
    if low[i] < Y then
    X = 0
    Y = low[i]
    endif
    next
    
    elsif ema50 crosses under sma200 then
    Y = close
    
    for i = 1 to 100 do
    if high[i] > Y then
    X = 0
    Y = high[i]
    endif
    next
    
    else
    X = X[1]+1
    Y = Y[1]
    endif
    
    k = max(1,X)
    det = DPO[k](close)
    
    RETURN det

    Je ne comprend pas d’où peut provenir le problème puisque grace à la fonction MAX, k ne peux être inférieur à 1 et l s’agit bien d’un entier.

    Si quelqu’un avait une idée, se serait génial ! merci d’avance.

    #117513 quote
    fifi743fifi743
    Participant
    Master

    bonjour

    je l’ai modifier

    ema50 = ExponentialAverage[50](close)
    sma200 = average[200](close)
    
    if ema50 crosses over sma200 then
    Y = close
    
    for i = 1 to 100 do
    if low[i] < Y then
    X = 0
    Y = low[i]
    endif
    next
    
    elsif ema50 crosses under sma200 then
    Y = close
    
    for i = 1 to 100 do
    if high[i] > Y then
    X = 0
    Y = high[i]
    endif
    next
    
    else
    X = X[1]+1
    Y = Y[1]
    endif
    if x>0 then
    k = max(1,X)
    det = DPO[k](close)
    endif
    RETURN det
    #117515 quote
    NicolasNicolas
    Keymaster
    Legend

    La période de l’indicateur ne peut être ni égale à zéro, ni comporter des décimales.

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

"Un paramètre de type entier positif est attendu"


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Kenleshim @kenleshim Participant
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by NicolasNicolas
6 years, 8 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 01/22/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...