Besoin d’aide pour indicateur slope

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #225981 quote
    mcth01
    Participant
    New

    Bonjour,

    J’ai besoin d’aide pour avoir une fonction proche de “slope”:

    Slope is based on a linear regression (line of best fit). Even though the formula for a linear regression is beyond the scope of this article, a linear regression can be shown using the Raff Regression Channel in SharpCharts. This indicator features a linear regression in the middle with equidistant outer trend lines. Slope equals the rise-over-run for the linear regression. Rise refers to the price change. Run refers to the timeframe. A 20-day Slope would be the rise-over-run of a 20-day linear regression. If the rise is 4 points and the run is two days, then the slope would be 2 (4/2 = 2). If the rise is -6 points and the run is 2, then the slope would be -3 (-6/2 = -3). In general, an advancing period has a positive slope and a declining period has a negative slope. The steepness depends on the sharpness of the advance or decline.

    Merci d’avance,

    #225989 quote
    mcth01
    Participant
    New

    j’aimerais une fonction comme dasn l’exemple:

    càd si le prix perd 6 points et l’augmentation est du prix au durée 2 jours: (-6:2)=-3

    à l’inverse le prix a pris 4 points et l’augmentation a durée 2 jours: (4/2)=2

    Afin de l’intégrer dans un bout de code.

    Merci d’avance

    #225991 quote
    JC_Bywan
    Moderator
    Master

    Bonjour,

    N=2 // à choisir par l'utilisateur, ou à calculer par une formule du code utilisateur: nombre d'intervalles entre bougies du timeframe utilisé, si UT jour N=1 pour durée 1 jour entre close de la bougie précédente et de la courante, N=2 pour durée 2 jours si point de départ = fin (close) de la 2e bougie précédente, N=3 etc...
    
    if N>0 then // par sécurité si N résulte d'une formule mal bornée, on ne cherche slope que si N n'est pas négatif ou nul
      slope=(close-close[N])/N
    endif
    mcth01 thanked this post
    #226010 quote
    mcth01
    Participant
    New

    Merci c’est parfait 🙂

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

Besoin d’aide pour indicateur slope


ProScreener : Scanners de Marché & Détection

New Reply
Author
author-avatar
mcth01 @mcth01 Participant
Summary

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

Topic Details
Forum: ProScreener : Scanners de Marché & Détection
Language: French
Started: 01/05/2024
Status: Active
Attachments: No files
Logo Logo
Loading...