Demande de code sur pente de regression lineaire

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #172649 quote
    warningffwarningff
    Participant
    Average

    Bonjour,

     

    Après plusieurs recherche je n’ai pas trouver le code de l’indicateur : pente de régression linéaire.

    Beaucoup de code sur la régression linéaire mais pas la pente ^^

     

    Merci pour votre aide.

    #172650 quote
    NicolasNicolas
    Keymaster
    Legend

    Merci de formuler des titres significatifs: “demande de code” ne respecte pas les règles de publication du site (voir encart jaune).

    Une pente (ou slope en anglais) de régression linéaire s’obtient avec l’instruction LinearRegressionSlope

    #172654 quote
    warningffwarningff
    Participant
    Average

    Malheureusement je n’arrive pas à trouver la ressemblance et les mêmes réglages de l’indicateur déjà installé PRT…

    #172704 quote
    warningffwarningff
    Participant
    Average
    Cela est le code proposé sur le forum , or avez vous le détail du code de LinearRegressionslope ?
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    i1 = LinearRegressionSlope[10](close)
    IF(i1>0 AND i1[1]<0) THEN
          bullish = 1
          bearish = 0
    ELSIF(i1<0 AND i1[1]>0) THEN
          bullish = 0
          bearish = 1
    ELSE
          bullish = 0
          bearish = 0
    ENDIF
    RETURN bullish, bearish
    #172731 quote
    NicolasNicolas
    Keymaster
    Legend

    Voici le code de la pente de la régression linéaire (slope), comparable à l’instruction de la plateforme:

    // parameters
    Length = 20
    
    SumBars = Length * (Length-1) * 0.5
    SumSqrBars = (Length-1) * Length * (2 * Length-1) / 6
    
    if(barindex>Length) then
    Sum1 = 0
    SumY=0
    MA = average[1](close)
    
    for i=0 to Length-1 do
    Sum1 = Sum1+(i*MA[i])
    SumY = SumY+(MA[i])
    next
    
    Sum2 = SumBars * SumY
    
    Num1 = Length * Sum1 - Sum2
    Num2 = SumBars * SumBars - Length * SumSqrBars
    endif
    
    RegSlope = 100*Num1/Num2
    
    RETURN RegSlope
    
    Bodaris thanked this post
    #172738 quote
    warningffwarningff
    Participant
    Average

    Merci , je vous aime <3

     

    😀

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

Demande de code sur pente de regression lineaire


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
warningff @fabbis Participant
Summary

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

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 06/28/2021
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...