Vertical Time Lines Session Markers

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

    Hi Guys,

    Does anyone know how to do this?

    I want a vertical line to represent when I personally start trading and another when I finish trading.

    So simply how to plot a vertical line in any colour at any time that repeats each day.

    I have the MT4 code Time_vLines.mq4 if required

    Many Thanks

    #15359 quote
    Nicolas
    Keymaster
    Master

    Not possible until version 10.3 to plot vertical line. But maybe this code snippet would do the trick: (didn’t test it)

    plottime = 093000 //exact time to plot the vertical line 
    
    if time=plottime then 
     value = close*100
    else
     value = 0
    endif 
    
    return value

    Make the value plot as a line or an histogram .. tell us if it’s good for you!

    tapsomepips thanked this post
    #15383 quote
    tapsomepips
    Participant
    New

    Hi Nicolas,

    Thanks for your reply.  I have tried multiple variations on your code snippet, but was unhappy with the distortion on the price chart, due to the histogram referencing zero.  I then realised that I don’t actually need it for live trading at all it’s actually only whilst reviewing past activity.  So I opted for a tape indicator beneath my price chart.

    This will serve my purpose very well until 10.3 and I thank you you for your prompt assistance.

    Please find the code below

    // Session Indicator
    // t1 start of my shift (set variable hhmmss)
    // t2 end of my shift (set variable hhmmss)
    
    starttime = t1
    
    endtime = t2
    
    if time > starttime and time < endtime then
    value = 1
    
    else
    value = 0
    endif
    
    return value

    I suppose if anyone had a mind to they could quite easily adjust the variables for Asia, Euro and US Time zones if required

    Thanks again Nicolas

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

Vertical Time Lines Session Markers


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by tapsomepips
9 years, 3 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 10/22/2016
Status: Active
Attachments: No files
Logo Logo
Loading...