diagonal line

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #72488 quote
    Seb
    Participant
    Average

    Hi, I want to draw a line from the highest[20](high) to the highest[10](high) with the Drawline function. But for that I need the barindex of each highs. How to?

    #72491 quote
    robertogozzi
    Moderator
    Master

    Try this one (not tested)

    High1 = 0
    FOR i = 0 TO 9
       IF high[i] > High1 THEN
          Bar1  = BarIndex
          High1 = high[i]
       ENDIF
    NEXT
    High2 = 0
    FOR i = 0 TO 19
       IF high[i] > High2 THEN
          Bar2    = BarIndex
          High2 = high[i]
       ENDIF
    NEXT

     

    now you’ll have two bars and two prices to draw a line or a segment.

    #72566 quote
    Seb
    Participant
    Average

    Thank you much, it works if I put [i] behind BarIndex! It’s not possible though to use a diagonal line in ProBacktest, as it seems to me.

    #72567 quote
    robertogozzi
    Moderator
    Master

    You are right, my fault!

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

diagonal line


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Seb @seb Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 06/06/2018
Status: Active
Attachments: No files
Logo Logo
Loading...