fibonacci orario

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #91991 quote
    Gabriele BattistaGabriele Battista
    Participant
    Senior

    è possibile costruire un indicatore con i numeri di fibonacci su massimo e minimo dell’ultima ora precedente?

    #91994 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Prova questo:

    DEFPARAM CalculateOnLastBars = 1000
    DEFPARAM DrawOnLastBarOnly   = True
    IF BarIndex = 0 THEN
       Massimo = 0
       Minimo  = 0
       hh      = 0
       ll      = 999999
    ENDIF
    IF hour <> hour[1] THEN
       Massimo = hh
       Minimo  = ll
       hh      = high
       ll      = low
    ELSE
       hh      = max(hh,high)
       ll      = min(ll,low)
    ENDIF
    Diff       = abs(Massimo - Minimo)
    IF Massimo > Minimo THEN
       Fib236  = Massimo - (Diff * 0.236)             //23.6% fibonacci
       Fib382  = Massimo - (Diff * 0.382)             //38.2% fibonacci
       Fib500  = Massimo - (Diff * 0.500)             //50.0% fibonacci
       Fib618  = Massimo - (Diff * 0.618)             //61.8% fibonacci
       Fib764  = Massimo - (Diff * 0.764)             //76.4% fibonacci
    ELSE
       Fib236  = Minimo  + (Diff * 0.236)             //23.6% fibonacci
       Fib382  = Minimo  + (Diff * 0.382)             //38.2% fibonacci
       Fib500  = Minimo  + (Diff * 0.500)             //50.0% fibonacci
       Fib618  = Minimo  + (Diff * 0.618)             //61.8% fibonacci
       Fib764  = Minimo  + (Diff * 0.764)             //76.4% fibonacci
    ENDIF
    DRAWHLINE(Massimo) coloured(0,255,0,255)
    DRAWHLINE(Minimo) coloured(0,255,0,255)
    DRAWTEXT("--------#Fib236# (23.6%)------",barindex,Fib236,SansSerif,Bold,10)coloured(0,128,0,255)
    DRAWTEXT("--------#Fib382# (38.2%)------",barindex,Fib382,SansSerif,Bold,10)coloured(0,128,0,255)
    DRAWTEXT("--------#Fib500# (50.0%)------",barindex,Fib500,SansSerif,Bold,10)coloured(0,128,0,255)
    DRAWTEXT("--------#Fib618# (61.8%)------",barindex,Fib618,SansSerif,Bold,10)coloured(0,128,0,255)
    DRAWTEXT("--------#Fib764# (76.4%)------",barindex,Fib764,SansSerif,Bold,10)coloured(0,128,0,255)
    RETURN
    #92095 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Il codice di cui sopra non va bene, questo è quello giusto:

    DEFPARAM CalculateOnLastBars = 1000
    DEFPARAM DrawOnLastBarOnly   = True
    IF BarIndex = 0 THEN
       Massimo = 0
       Minimo  = 0
       hh      = 0
       ll      = 999999
    ENDIF
    IF hour <> hour[1] THEN
       Massimo = hh
       Minimo  = ll
       hh      = high
       ll      = low
    ELSE
       hh      = max(hh,high)
       ll      = min(ll,low)
    ENDIF
    Diff       = Massimo - Minimo
    DRAWHLINE(Massimo) coloured(0,255,0,255)
    DRAWHLINE(Minimo) coloured(0,255,0,255)
    DRAWTEXT("--------(23.6%)------",barindex,Massimo - (Diff * 0.236) ,SansSerif,Bold,10)coloured(0,128,0,255)
    DRAWTEXT("--------(38.2%)------",barindex,Massimo - (Diff * 0.382),SansSerif,Bold,10)coloured(0,128,0,255)
    DRAWTEXT("--------(50.0%)------",barindex,Massimo - (Diff * 0.500),SansSerif,Bold,10)coloured(0,128,0,255)
    DRAWTEXT("--------(61.8%)------",barindex,Massimo - (Diff * 0.618),SansSerif,Bold,10)coloured(0,128,0,255)
    DRAWTEXT("--------(76.4%)------",barindex,Massimo - (Diff * 0.764),SansSerif,Bold,10)coloured(0,128,0,255)
    RETURN
    Nicolas thanked this post
Viewing 3 posts - 1 through 3 (of 3 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

fibonacci orario


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Summary

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

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 02/21/2019
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...