Bar referencing and pointing

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #170084 quote
    IG_CFD_Trader
    Participant
    Average

    Hi Nicolas,

    I have the highest high during intraday being drawn on current bar. If for example the highest high bar occurred x bars ago and that particular bar had another value drawn on it by a private indicator.

    How do I make reference to that highest high bar (x bars ago) and have the code also show on current bar the value of the indicator on that x bar?

    #170092 quote
    robertogozzi
    Moderator
    Master

    You need to code the detection of the intraday HIGHEST high and save that high AND the other X value you are interested in (not tested):

    DEFPARAM DrawOnLastBarOnly = True
    ONCE HighestHIGH = high
    ONCE Xdatum      = CALL "MyIndicator"
    IF IntraDayBarIndex = 0 THEN    //0=a new day just started
       HighestHIGH = high
       Xdatum      = CALL "MyIndicator"
    ENDIF
    IF High > HighestHIGH THEN
       HighestHIGH = high
       Xdatum      = CALL "MyIndicator"
    ENDIF
    DrawText("Highest=#HighestHIGH#   X=#Xdatum#",BarIndex,HighestHIGH + range)
    RETURN
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Bar referencing and pointing


Platform Support: Charts, Data & Broker Setup

New Reply
Author
author-avatar
IG_CFD_Trader @wnakhoul Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
4 years, 9 months ago.

Topic Details
Forum: Platform Support: Charts, Data & Broker Setup
Language: English
Started: 05/21/2021
Status: Active
Attachments: No files
Logo Logo
Loading...