Disegnare segmento sul massimo e sul il minimo delle ultime x barre

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #166030 quote
    Stanko
    Participant
    Senior

    Buongiorno Roberto,

    chiedo cortesemente un’aiuto sulla possibilità di disegnare un segmento che parte, per esempio, dalla candela delle ore 9 e finisca alle ore 11 avendo però come valore il massimo delle 3 candele orarie prese in considerazione (ore 9-10-11).

    Allego un tentativo effettuato prendendo spunto dai post del forum, che però non dà il risultato sperato.

    Grazie.

    DEFPARAM CalculateonLastBars = 2000
    IF barindex = 0 THEN
    MyPrice = high
    ENDIF
    IF OpenTime = 090000 AND OpenTime <= 110000 THEN
    MyPriceX= MyPrice
    MyPrice = highest[1](high)
    MyBar1  = BarIndex
    ENDIF
    IF OpenTime >= 090000 AND OpenTime <= 120000 THEN
    MyBar2 = BarIndex
    DRAWSEGMENT(MyBar1,MyPrice,MyBar2,MyPrice) coloured(0,128,0,255) style(line,3)
    //DRAWSEGMENT(MyBar1,MyPriceX,MyBar2,MyPriceX) coloured(0,0,255,255)style(line,3)
    ENDIF
    return
    #166260 quote
    robertogozzi
    Moderator
    Master

    Eccolo:

    DEFPARAM CalculateonLastBars = 2000
    DEFPARAM DrawOnLastBarOnly   = TRUE
    //
    IF OpenTime = 090000 THEN
       Inizio  = BarIndex
       Massimo = high
    ENDIF
    IF OpenTime >= 090000 AND OpenTime <= 110000 THEN
       Massimo = max(Massimo,high)
    ENDIF
    IF OpenTime = 110000 THEN
       Fine    = BarIndex
    ENDIF
    DrawSegment(Inizio,Massimo,Fine,Massimo) coloured(0,0,255,255) style(line,3)
    RETURN
    #166287 quote
    Stanko
    Participant
    Senior

    Grazie molte Roberto.

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

Disegnare segmento sul massimo e sul il minimo delle ultime x barre


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
Stanko @stanko Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 04/02/2021
Status: Active
Attachments: No files
Logo Logo
Loading...