mt4 - Session Breaks Day

 

Hi, 

I use below code for #1 screenshot.

int _objfnd = ObjectFind( name );
if ( _objfnd == -1 )
{
    ObjectCreate ( _vlineName, OBJ_VLINE, 0, Time[i], 0 );
    ...
}

and I use below code for #2 screenshot.

int _objfnd = ObjectFind( name );
if ( _objfnd == -1 )
{
    datetime    _dayTime = Time[0]                                       ;
    int         _dayNext = PeriodSeconds( PERIOD_D1 )      ;
                _dayTime = _dayTime - ( _dayTime % _dayNext ) + _dayNext ;

    ObjectCreate ( _vlineName, OBJ_VLINE, 0,  _dayTime, 0 )              ;
}

If you figure out my concern, please give me good advice, much appreciate.

 

I don't really understand, what you want. At what time the vline should be placed - what do you mean with day break (USA, EU, Asia, Gmt, Broker, ...), what is _Session_Breaks_Day_Period, ...

Maybe you should provide the whole code.

 
Carl Schreiber:

I don't really understand, what you want. At what time the vline should be placed - what do you mean with day break (USA, EU, Asia, Gmt, Broker, ...), what is _Session_Breaks_Day_Period, ...

Maybe you should provide the whole code.

Sorry for the confusion, I updated my first comment.

I did it for you understand me clearly, I hope I did. 

 
Max Enrik:

Sorry for the confusion, I updated my first comment.

I did it for you understand me clearly, I hope I did. 

Your code draw a line for a Saturday (2016.11.05 00:00).

And there is a missing bar for Monday at 2016.11.07 00:00.

 
Alain Verleyen:

Your code draw a line for a Saturday (2016.11.05 00:00).

And there is a missing bar for Monday at 2016.11.07 00:00.

Thanks @Alain.

I fixed my issue 

 
Why are you doing this at all. Just turn on the built in separators (control-Y.)
 
whroeder1:
Why are you doing this at all. Just turn on the built in separators (control-Y.)

Yes I know it, but it is not suitable for my chart template.

Anyway thanks for your tip comment. 

Reason: