Prezzi Apertura Dax

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #110705 quote
    abd78
    Participant
    Veteran

    Salve, vorrei un indicatore che collegasse le aperture del dax tra una seduta all’altra (usando l’apertura delle 1.00). Come in figura. Grazie

    APERTURADAX.png APERTURADAX.png
    #110732 quote
    robertogozzi
    Moderator
    Master

    Eccolo:

    DEFPARAM CalculateonLastBars = 2000
    IF barindex = 0 THEN
       MyBar   = barindex
       MyPrice = open
    ENDIF
    IF OpenDay <> OpenDay[1] THEN
       DRAWSEGMENT(barindex,MyPrice,barindex,open) coloured(0,128,0,128)
       MyBar   = barindex
       MyPrice = open
    ENDIF
    DRAWSEGMENT(MyBar,MyPrice,barindex,MyPrice) coloured(0,128,0,128)
    RETURN
    abd78 thanked this post
    x-13.jpg x-13.jpg
    #110740 quote
    abd78
    Participant
    Veteran

    Grazie, se volessi cambiare lo spessore della linea (per farla più grande) o modificare l’orario di apertura come potrei fare?

    #110744 quote
    robertogozzi
    Moderator
    Master

    Per modificare l’orario, basta che cambi la riga 6 con:

    IF OpenTime = 090000 THEN

    Puoi anche utilizzare TIME che restituisce l’ora di chiusura di una candela, invece di quella d’apertura.

    La dimensione e lo stile dei dati stampati con DRAW non possono essere cambiati, si può utilizzare RETURN per farlo, azi mi sembra venga anche meglio:

    DEFPARAM CalculateonLastBars = 2000
    IF barindex = 0 THEN
       MyPrice = open
    ENDIF
    //IF OpenDay <> OpenDay[1] THEN
    IF OpenTime = 090000 THEN
       MyPrice = open
    ENDIF
    RETURN MyPrice
    abd78 thanked this post
    x-14.jpg x-14.jpg
    #110747 quote
    abd78
    Participant
    Veteran

    Molto meglio con la funzione Return, volevo provare anche a fare l’open week e l’open month

    DEFPARAM CalculateonLastBars = 2000
    IF barindex = 0 THEN
    MyPrice = open
    ENDIF
    IF OpenMonth <> OpenMonth[1] THEN
    MyPrice = open
    ENDIF
    RETURN MyPrice
    

    Solo che non c’è la funzione OpenWeek.  Oppure sostituire le aperture con le chiusure e fare un CloseDaily-CloseWeekly-CloseMonth.

    #110748 quote
    robertogozzi
    Moderator
    Master

    Devi usare OpenDayOfWeek:

    If OpenDayOfWeek[1] > OpenDayOfWeek Then
    abd78 thanked this post
    #124105 quote
    abd78
    Participant
    Veteran

    Ciao, volevo chiederti per l’openmonth come fare

    DEFPARAM CalculateonLastBars = 1000000000
    IF barindex = 0 THEN
    MyPrice = open
    ENDIF
    If OpenMonth[1] > OpenMonth Then
    MyPrice = open
    ENDIF
    RETURN MyPrice

    facendo così non mi restituisce mese per mese.

    a.png a.png
    #124114 quote
    abd78
    Participant
    Veteran

    Risolto, era sbagliato il codice.

    DEFPARAM CalculateonLastBars = 2000
    IF barindex = 0 THEN
    MyPrice = open
    ENDIF
    IF OpenMonth <> OpenMonth[1] THEN
    MyPrice = open
    ENDIF
    RETURN MyPrice
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.

Prezzi Apertura Dax


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
abd78 @fede9483 Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 10/21/2019
Status: Active
Attachments: 4 files
Logo Logo
Loading...