diagonal line

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #72488 quote
    SebSeb
    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
    robertogozzirobertogozzi
    Moderator
    Legend

    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
    SebSeb
    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
    robertogozzirobertogozzi
    Moderator
    Legend

    You are right, my fault!

Viewing 4 posts - 1 through 4 (of 4 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

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 robertogozzirobertogozzi
8 years, 5 months ago.

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