Draw range box

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #171116 quote
    MauroPro
    Participant
    Veteran

    Ciao Roberto, mi potresti indicare un codice per disegnare un semplice box  tra due orari?

    Ho provato uno snippet (n. 287 di Nicolas) ma non so perchè disegna male gli orari.

    Ecco il codice:

    timec= time>=000000 and time<080000

    if timec then

    hh=max(hh,high)

    ll=min(ll,low)

    if hh<>hh[1] then

    hhbar=barindex

    endif

    if ll<>ll[1] then

    llbar=barindex

    endif

    endif

    if not timec and timec[1] then

    drawrectangle(hhbar,hh,llbar,ll)

    drawsegment(hhbar,(hh+ll)/2,llbar,(hh+ll)/2)

    //rest

    hh=0

    ll=close*100

    endif

    return

     

    e questo è quello che mi disegna sul dax a 15 minuti (gli orari non corrispondono e poi sono sempre differenti). Grazie

    Image-001.jpg Image-001.jpg
    #171137 quote
    robertogozzi
    Moderator
    Master

    Questo funziona:

    ////DEFPARAM DrawOnLastBarOnly = True
    Time1 = 000000
    Time2 = 080000
    x=0
    IF (Time = Time1) OR ((Time > Time1) AND (Time[1] < Time1)) THEN
       Bar1 = barindex
       hh   = high
       ll   = low
    ENDIF
    hh = max(hh,high)
    ll = min(ll,low)
    IF (Time = Time2) OR ((Time > Time2) AND (Time[1] < Time2)) THEN
       Bar2 = BarIndex
    ENDIF
    IF Bar2 > Bar1 THEN
       DrawRectangle(Bar1,hh,Bar2,ll) coloured(255,0,0,25) bordercolor(0,255,0,155)
       Bar2 = 0
    ENDIF
    return
    MauroPro thanked this post
    #171139 quote
    MauroPro
    Participant
    Veteran

    Perfetto funziona.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Draw range box


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
MauroPro @mauropro Participant
Summary

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

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 06/04/2021
Status: Active
Attachments: 1 files
Logo Logo
Loading...