Market Open-Close Hours MT4 Indicator to prorealtime

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #131749 quote
    kabbel
    Participant
    Junior

    Hello everybody,

    Is it possible somebody make a conversion of the indicator “Market Open-Close Hours MT4 Indicator” to prorealtime?

    https://www.forexmt4indicators.com/nl/market-open-close-hours-mt4-indicator/

    I put the mt4 in the attachment.

     

    Thanks in advance!!!

    Market-Open-Close-Hours-MT4-Indicator.mq4 Market-Open-Close-Hours-MT4-Indicator.png Market-Open-Close-Hours-MT4-Indicator.png
    #132070 quote
    Nicolas
    Keymaster
    Master

    Something similar could be coded, but with limitations:

    • only compatible with PRT version 11
    • will not automatically adapt with your own timezone
    #132136 quote
    kabbel
    Participant
    Junior

    Something similar could be coded, but with limitations:

    • only compatible with PRT version 11
    • will not automatically adapt with your own timezone

    Hello Nicolas,

    I was hoping you would give a reaction. Lucky for me you’re in my timezone! I’ve the 10.3 version. Maybe I should just learn it.

    #132139 quote
    Vonasi
    Moderator
    Master

    Something could be created for 10.3 where the user can just set the start and end times for each market so it could work for every time zone but in 10.3 we cannot draw into the future and so you would not see that a market is about to open in the next bar until the market is actually open on the next bar.

    #132146 quote
    Vonasi
    Moderator
    Master

    This is for v10.3. I’ve set the times at UTC so you will have to change them to what you need.

    NewYorkOpen = 1430
    NewYorkClose = 2100
    LondonOpen = 0800
    LondonClose = 1630
    JapanOpen = 0100
    JapanClose = 0700
    
    nyOpen =  NewYorkOpen*100 
    nyClose =  NewYorkClose*100 
    LoOpen =  LondonOpen*100 
    LoClose =  LondonClose*100 
    JaOpen =  JapanOpen*100 
    JaClose =  JapanClose*100 
    
    if opentime = nyopen then
    ny=1
    endif
    if opentime = nyclose then
    ny=0
    endif
    
    if opentime = loopen then
    lo=1
    endif
    if opentime = loclose then
    lo=0
    endif
    
    if opentime = jaopen then
    ja=1
    endif
    if opentime = jaclose then
    ja=0
    endif
    
    if ny then
    if not ny[1] then
    drawtext("NewYork",barindex-5,2,sansserif,bold,10) coloured(0,0,0)
    endif
    drawtext("█",barindex,2,sansserif,bold,16) coloured(0,0,255)
    endif
    
    if lo then
    if not lo[1] then
    drawtext("London",barindex-4,1,sansserif,bold,10) coloured(0,0,0)
    endif
    drawtext("█",barindex,1,sansserif,bold,16) coloured(128,0,0)
    endif
    
    if ja then
    if not ja[1] then
    drawtext("Tokyo",barindex-4,3,sansserif,bold,10) coloured(0,0,0)
    endif
    drawtext("█",barindex,3,sansserif,bold,16) coloured(0,128,0)
    endif
    
    return 0 coloured(0,0,0,0), 4 coloured(0,0,0,0)
    kabbel, Nicolas and PLermite thanked this post
    Screenshot_2-3.png Screenshot_2-3.png
    #132261 quote
    kabbel
    Participant
    Junior

    Hello Vonasi,

    Thank you very much! It helps a lot.

    GBPUSD-15-minuten.png GBPUSD-15-minuten.png
    #132263 quote
    kabbel
    Participant
    Junior

    All credits to Vonasi!

    Market-Open-Close-Hours.itf
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

Market Open-Close Hours MT4 Indicator to prorealtime


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
kabbel @kabbel Participant
Summary

This topic contains 6 replies,
has 3 voices, and was last updated by kabbel
5 years, 9 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/15/2020
Status: Active
Attachments: 5 files
Logo Logo
Loading...