Prix à 15h30 sur UT ticks et UT Minutes

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #224268 quote
    Jerome888
    Participant
    Average

    Bonjour,

    Je souhaiterais capturer le prix le plus exactement possible à 15h30

    • que ce soit sur du 2000 ticks par ex
    • ou du 5 min

    Le code suivant retourne cependant un résultat différent dans les 2 cas ci-dessus

    if (time[1] < 1530000 and time >= 1530000) then
    StartPrice=close
    endif

    Comment procéder SVP ?

    Merci.

    #224269 quote
    fifi743
    Participant
    Master
    if opentime=153000 then
    startprice=close
    endif

    et celui ci

    #224270 quote
    Jerome888
    Participant
    Average

    Merci.

    Ca ne fonctionnera pas en Ticks je pense puisque une barre tick peut commencer juste avant et se terminer juste après l’heure non ?

    #224271 quote
    fifi743
    Participant
    Master

    je ne sais pas ,je n’utilise pas le tick

    #224273 quote
    Jerome888
    Participant
    Average

    OK merci quand même pour tes réponses.

    Oui ca va être le problème avec cette instruction opentime

    #224310 quote
    Alain
    Participant
    Senior

    La solution pour les ticks :

     

    if opentime >= 153000 and opentime[1] < 153000 then
    #224322 quote
    Jerome888
    Participant
    Average

    Merci. Je crois que c’est plus compliqué que ca puisque ci-dessus on compare les temps d’ouverture de 2 bougies.

    Alors que je dois comparer les temps au sein de la même bougie (tick), à chaque variation de prix/tick.

    Donc j’enregistre à chaque execution le temps dans une variable DernierTemps=time et, à la prochaine execution, je le compare à “time” (en regardant celui qui est le plus proche de l’heure) puis j’enregistre la valeur our la DerniereValeur dans valeur1.

    Ca a l’air de fonctionner. Mais j’ai toujours une difference de quelques points entre l’ouverture du 5 min à 15h30 et valeur1. Je ne comprends pas pourquoi. La seule explication serait que le code ne s’execute pas réellement à chaque variation de ticks/prix (en tick par tick) mais seulement…parfois. Je ne comprends pas.

    #224409 quote
    Jean FX
    Moderator
    New

    Tu peux texter ce qui suit :

    if (time[1] < 150000 and time >= 150000) then
    StartPrice=close
    endif

    #224652 quote
    Jerome888
    Participant
    Average

    C’est un plus compliqué que ça, encore une fois il faut aller chercher dans les bougies à chaque execution de ticks.

    Je semble m’approcher de quelque chose de correct avec ca mais j’ai toujours une différence de valeur entre ce code exécuté en 5 min, et exécuter en 500 ticks (sur le NQXXXX)

    once MyLastclose=close
    once MyLastTime=time
    Mybarindex=barindex
    
    once authorizedToReinit=20
    
    once l3 = low
    once h3 = high
    Start3=143000
    End3=153000
     
    if authorizedToReinit>=20 and (opentime=Start3 or (start3=000000 and intradaybarindex=0)) then
    PriceAtStart3=Open
    CurrentPrice3=Close
    authorizedToReinitUS=0
    elsif authorizedToReinitUS>=20 and (abs(myLastTime-Start3)<=abs(time-Start3)) and (time>Start3 and time[1]<Start3) then
    PriceAtStart3=MyLastclose
    CurrentPrice3=close
    authorizedToReinit=0
    elsif authorizedToReinitUS>=20 and (abs(myLastTime-Start3)>abs(time-Start3))and (time>Start3 and time[1]<Start3) then
    PriceAtStart3=Close
    CurrentPrice3=Close
    authorizedToReinitUS=0
    elsif time>Start3 and time<=End3 then
    authorizedToReinitUS=authorizedToReinitUS+1
    CurrentPrice3=close
    endif
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.

Prix à 15h30 sur UT ticks et UT Minutes


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Jerome888 @jerome888 Participant
Summary

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

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 11/24/2023
Status: Active
Attachments: No files
Logo Logo
Loading...