Résoudre une équation à 1 inconnue

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #238176 quote
    Bodaris
    Participant
    New

    Bonjour,

    j’aimerais tester un truc, mais je ne sais pas si c’est possible. Je voudrais savoir à quel niveau de moyenne mobile simple correspond un prix.

    Grosse modo je voudrais résoudre cette équation :

    Close = summation[x](close)/X

    X=???

     

    Je sais pas si c’est assez clair ? Possible ou pas ?

    Merci d’avance pour votre réponse :).

    #238186 quote
    JS
    Participant
    Senior

    Salut,

    Je l’ai essayé pour vous, mais la chance que la moyenne soit exactement égale au prix est négligeable…

    Found=0
    N=1000 //Maximum Period
    CloseTarget = Close // The closing price you're comparing against
    
    FOR x = 2 TO N  // You can adjust to any maximum period you want
    SMAX = average[x](Close) // Calculate the moving average for X periods
    IF (SMAX = CloseTarget) THEN
    Found = 1
    break // Stop the loop when a match is found
    ENDIF
    NEXT
    DrawText("x=#x#", BarIndex, High+5)
    DrawText("Found=#Found#",BarIndex, Low-5)
    
    RETURN
    Bodaris and Iván González thanked this post
    #238196 quote
    Bodaris
    Participant
    New
    Bonjour, Un grand merci !!! après quelques modifications, j’y suis arrivé. C’est déjà pas mal comme résultat, mieux que rien ^^   j’ai rajouté un screenshot pour une idée du visuel.
    Found=0
    N=100 //Maximum Period
    CloseTarget = high
    // The closing price you're comparing against
    
    
    FOR x = 2 TO N // You can adjust to any maximum period you want
    SMAX = average[x](Close) // Calculate the moving average for X periods
    IF (SMAX => CloseTarget-5 and SMAX<=closetarget+5) THEN
    Found = 1
    //DrawText("x=#x#", BarIndex, High+5)
    //DrawText("Found=#Found#",BarIndex, Low-5)
    //ELSE
    //found=0
    break // Stop the loop when a match is found
    ENDIF
    NEXT
    
    c1= found=1 and smax=Average[7](close)
    if c1 THEN
    DrawText("x=#x#", BarIndex, High+5)
    endif
    
    RETURN c1//smax
    JS and Iván González thanked this post
    Capture-decran-574.png Capture-decran-574.png
    #238198 quote
    Bodaris
    Participant
    New
    Mais vous avez raison, c’est compliqué de tomber sur la valeur d’une moyenne mobile. Je vais voir si je m’en sors. Je cherche à identifier à quel moyenne mobile un pic et un creux peut correspondre.
    #238199 quote
    JS
    Participant
    Senior

    Bonjour,

    Vous pouvez également regarder la régression linéaire (méthode des moindres carrés)…

    Bodaris thanked this post
    #241429 quote
    Bodaris
    Participant
    New
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Résoudre une équation à 1 inconnue


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Bodaris @bodaris Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by Bodaris
1 year, 2 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 09/28/2024
Status: Active
Attachments: 1 files
Logo Logo
Loading...