Condition range asiatique

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #193385 quote
    BourseBourse
    Participant
    New

    Bonjour,

    Je suis dans l’impasse pour programmer la situation suivante :

    Sur la tranche horaire 0h00 et 08h00, garder les valeurs dont la volatilité est faible (ou dont l’écart entre le plus haut est le bas est inférieur à 0,12% par exemple).

    En gros je veux détecter les ranges et m’en servir comme une condition à l’achat ou à la vente.

    Merci de vos lumières.

    #193414 quote
    JC_BywanJC_Bywan
    Moderator
    Master

    Bonsoir,

    le sujet étant posté dans le forum “proorder”, je suppose que c’est pour une stratégie automatique, toutefois, pour permettre de visualiser sur graphe si cette portion de code peut convenir, je la fournis sous forme d’indicateur Si le code convient, alors il faudra supprimer la ligne return et conserver le reste pour l’intégrer à votre stratégie et exploiter la variable “resultat” qui vaudra 0 si ecart supérieur au seuil souhaité, ou 1 si inférieur.

    seuil=0.12 // Seuil en pourcentage, exemple pour 1%: seuil=1
    
    if opentime[1]>opentime then
    resultat=0
    hh=high
    ll=low
    endif
    if opentime>0 and opentime<80000 then
    hh=max(hh,high)
    ll=min(ll,low)
    endif
    if opentime[1]<80000 and opentime>=80000 then
    ecart=(hh-ll)/ll*100 // ecart bas_haut en pourcentage
    if ecart<=seuil then
    resultat=1
    endif
    endif
    
    return resultat
Viewing 2 posts - 1 through 2 (of 2 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

Condition range asiatique


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
Bourse @bourse Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by JC_BywanJC_Bywan
4 years, 5 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 05/18/2022
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...