Add an additional time zone

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

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

    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.
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

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

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