Add an additional time zone

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #164178 quote
    ThePenntChemist
    Participant
    Average

    Hello, is it possible to add an additional time zone as an indicator below of PRT?

    Please refer to the attached image. Thank you.

    Time-zone.jpg Time-zone.jpg
    #164183 quote
    robertogozzi
    Moderator
    Master

    This reports only HH:MM:SS so it’s planned only for intraday TF’s.

    TZoffest is the distance from the default local TZ as displayed by PRT.

    Due to a large text to be displayed, I added the EveryNbars variable to set the distance between adjacent bars .

    If the string is too large you can remove “:” from DrawText.

    You could also remove MySec from DrawText for TF’s >= 1 minute.

    (not tested)

    EveryNbars = 5
    TZoffset   = 6      //-23 to +23
    MyTime     = OpenTime
    MySec      = MyTime - (round((MyTime/100) - 0.5) * 100)
    MyHour     = OpenHour
    MyMin      = OpenMin
    Temp       = MyHour + TZoffset
    If Temp > 23 then
       Temp = Temp - 24
    Elsif Temp < 0 then
       Temp = Temp + 24
    Endif
    MyHour = Temp
    If (BarIndex MOD EveryNbars) = 0 then
       DrawText(“#MyHour#:#MyMin#:#MySec#”,BarIndex,0)
    Endif
    Return

    the new OpenTime will be displayed at level 0.

    #164191 quote
    robertogozzi
    Moderator
    Master

    It works fine, just replace line 6 with:

    MyMin      = OpenMinute

    it works best if you remove both “:” from DrawText.

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

Add an additional time zone


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

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

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 03/15/2021
Status: Active
Attachments: 1 files
Logo Logo
Loading...