request Daily open line (New York 5pm EST) conversion from MT4

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #135367 quote
    Nostromo111
    Participant
    New

    Is it please possible to convert this indicator from MT4?  I have searched but could not find an existing ProRealCode equivalent.

    On MT4 it shows a short blue line for several bars, the idea is that it starts at 5pm EST and can be used as support/resistance from the previous day (see screenshot).  The start time of the line needs to be set manually by a parameter that you provide for +/- hours.

    It would be nice to be able to choose the colour of the bar, but that is not essential.

     

    Thank you very much if possible.

    daily_open_line-1.mq4 daily-open-line-AUDCADH1.png daily-open-line-AUDCADH1.png
    #135385 quote
    Nicolas
    Keymaster
    Master

    That could be coded like this:

    // sessions start settings 
    startHour = 5
    startMinute = 0
    // ---------------------
    
    if hour=startHour and minute=startMinute then 
     price=open 
    endif
    
    return price

    Change the colour, style and thickness in the indicator settings window.

    #135614 quote
    Nostromo111
    Participant
    New

    Nicholas – thanks very much indeed, that is much simpler code than the MT4 version!

    One small request though, can you please show me how to make this draw only horizontal lines like the MT4 one in the screenshot,  and avoid those vertical/diagonal lines between the close of one day and the open of the next?  I find the verticals very distracting with other indicators I use.

    EDIT: one thing I noticed is that this code works perfectly on a 1 hour timescale,but go to 30 minutes and it displays the line start at 17;30 (EST) instead of 17:00 and on 15 min timescale it displays at 17:45.   This is not a problem for me as such, but I did wonder if this was an easy fix?

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

request Daily open line (New York 5pm EST) conversion from MT4


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Nostromo111
5 years, 8 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 06/10/2020
Status: Active
Attachments: 2 files
Logo Logo
Loading...