signaux de trading avec l'indicateur PRC STEP ONE MORE AVERAGE

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #104042 quote
    Roland57800Roland57800
    Participant
    Veteran

    Bonjour,

    j’utilise l’indicateur PRC STEP ONE MORE AVERAGE

    je cherche à coder l’indication d’une flèche au changement de tendance.

    j’ai réussi à le faire sauf que les flèches se répètent sur tous les chandeliers ce qui alourdi le graphique.

    Quelqu’un aurait une idée pour ne faire apparaître la flèche qu’au changement de tendance.

    Merci pour votre aide

    #104045 quote
    NicolasNicolas
    Keymaster
    Legend

    En effet il faut afficher une flèche uniquement quand la tendance vient de changer, ici je teste si la couleur a changé vis à vis de la période précédente (voir la fin du code):

    //PRC_step one more average | indicator
    //12.12.2016
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //converted and adapted from MT4 version
    
    Length       = 25
    Speed        = 3.0
    Adaptive     = 1
    Sensitivity  = 0.5     // Sensivity Factor
    StepSize     = 50      // Step Size period
    
    Length = Max(Length,1)
    Speed  = Max(Speed,-1.5)
    
    price = average[1](customclose)
    
    //adaptive period
    averagePeriod = Length
    if adaptive=1 and averagePeriod > 1 then
    minPeriod = averagePeriod/2.0
    maxPeriod = minPeriod*5.0
    endPeriod = round(maxPeriod)
    signal    = Abs((price-stored[endPeriod]))
    noise     = 0.00000000001
    
    for k=1 to endPeriod do
    noise=noise+Abs(price-stored[k])
    averagePeriod = round(((signal/noise)*(maxPeriod-minPeriod))+minPeriod)
    next
    
    endif
    
    tconst=Speed
    
    alpha = (2.0+tconst)/(1.0+tconst+averagePeriod)
    
    e1 = e1 + alpha*(price-e1)
    e2 = e2 + alpha*(e1-e2)
    v1 = 1.5 * e1 - 0.5 * e2
    e3 = e3 + alpha*(v1   -e3)
    e4 = e4 + alpha*(e3-e4)
    v2 = 1.5 * e3 - 0.5 * e4
    e5 = e5 + alpha*(v2   -e5)
    e6 = e6 + alpha*(e5-e6)
    v3 = 1.5 * e5 - 0.5 * e6
    
    stored=price
    
    //step function
    Sensitivity = max(Sensitivity,1*pointsize)
    ATRStepSize=averagetruerange[StepSize]
    Step = max(ATRStepSize,1*pointsize)
    size = sensitivity*Step
    phigh = v3
    plow = v3[7]
    stepMulti = 1.0
    workStepsmax  = phigh+2.0*size*stepMulti
    workStepsmin  = plow-2.0*size*stepMulti
    workSteptrend = workSteptrend[1]
    pprice = customclose
    if (pprice>workStepsmax[1]) then
    workSteptrend =  1
    endif
    if (pprice<workStepsmin[1]) then
    workSteptrend = -1
    endif
    if (workSteptrend =  1) then
    if (workStepsmin < workStepsmin[1]) then
    workStepsmin=workStepsmin[1]
    endif
    result = workStepsmin+size*stepMulti
    color = 1
    endif
    
    if (workSteptrend = -1) then
    if (workStepsmax > workStepsmax[1]) then
    workStepsmax=workStepsmax[1]
    endif
    result = workStepsmax-size*stepMulti
    color = -1
    endif
    
    if color<>color[1] then 
    if color>0 then 
    drawarrowup(barindex,result)coloured(0,255,0)
    else
    drawarrowdown(barindex,result)coloured(255,0,0)
    endif
    endif
    
    RETURN result coloured by color as "OMA step"
    indicateur-de-signaux-de-trading.png indicateur-de-signaux-de-trading.png
    #104052 quote
    Roland57800Roland57800
    Participant
    Veteran

    Merci Nicolas

    J’ai appris le codage depuis 2 mois, je trouve cet exercice excellent.

    Merci pour ce code.

     

    Bonne fin d’après midi

    Cordialement ROLAND

    #155295 quote
    MadrosatMadrosat
    Participant
    Master

    Bonjour

    impossible de faire apparaitre cet indicateur PRC STEP ONE MORE AVERAGE sur eur usd 1 heure

    peut être une question de réglage??? lequel adopter???

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

signaux de trading avec l'indicateur PRC STEP ONE MORE AVERAGE


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
Summary

This topic contains 3 replies,
has 3 voices, and was last updated by MadrosatMadrosat
5 years, 8 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 08/02/2019
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...