Daily Vertical Lines in MT5 - page 2

 
GBFX MQL5:

Just seeing this.

Thanks for tackling one out of two.

Could you point out exactly where in the code you changed so I could in future do same for other indicators.

I will let you know when I get a solution to the visibility issues.

Thanks again.


These lines allow the line back ground to be changed once the indicator is running.

input bool   Line_1_Backgroud = true;           // Line 1  Background
input bool   Line_2_Backgroud = true;           // Line 2  Background
input bool   Line_3_Backgroud = true;           // Line 3  Background
input bool   Line_4_Backgroud = true;           // Line 4  Background
input bool   Line_5_Backgroud = true;           // Line 5  Background
input bool   Line_6_Backgroud = true;           // Line 6  Background


These lines set the line to back ground or not based on the above true or false.

ObjectSetInteger(0, "T1"+IntegerToString(i), OBJPROP_BACK, Line_1_Backgroud);
ObjectSetInteger(0, "T2"+IntegerToString(i), OBJPROP_BACK, Line_2_Backgroud);
ObjectSetInteger(0, "T3"+IntegerToString(i), OBJPROP_BACK, Line_3_Backgroud);
ObjectSetInteger(0, "T4"+IntegerToString(i), OBJPROP_BACK, Line_4_Backgroud);
ObjectSetInteger(0, "T5"+IntegerToString(i), OBJPROP_BACK, Line_5_Backgroud);
ObjectSetInteger(0, "T6"+IntegerToString(i), OBJPROP_BACK, Line_6_Backgroud);


You can add these lines to the indicator to control the visibility from the code, but not the inputs, just add the time frames you want.

ObjectSetInteger(0, "T1"+IntegerToString(i),OBJPROP_TIMEFRAMES,OBJ_PERIOD_M1||OBJ_PERIOD_M2||OBJ_PERIOD_M3||OBJ_PERIOD_M4||OBJ_PERIOD_M5);
ObjectSetInteger(0, "T2"+IntegerToString(i),OBJPROP_TIMEFRAMES,OBJ_PERIOD_M1||OBJ_PERIOD_M2||OBJ_PERIOD_M3||OBJ_PERIOD_M4||OBJ_PERIOD_M5);
ObjectSetInteger(0, "T3"+IntegerToString(i),OBJPROP_TIMEFRAMES,OBJ_PERIOD_M1||OBJ_PERIOD_M2||OBJ_PERIOD_M3||OBJ_PERIOD_M4||OBJ_PERIOD_M5);
ObjectSetInteger(0, "T4"+IntegerToString(i),OBJPROP_TIMEFRAMES,OBJ_PERIOD_M1||OBJ_PERIOD_M2||OBJ_PERIOD_M3||OBJ_PERIOD_M4||OBJ_PERIOD_M5);
ObjectSetInteger(0, "T5"+IntegerToString(i),OBJPROP_TIMEFRAMES,OBJ_PERIOD_M1||OBJ_PERIOD_M2||OBJ_PERIOD_M3||OBJ_PERIOD_M4||OBJ_PERIOD_M5);
ObjectSetInteger(0, "T6"+IntegerToString(i),OBJPROP_TIMEFRAMES,OBJ_PERIOD_M1||OBJ_PERIOD_M2||OBJ_PERIOD_M3||OBJ_PERIOD_M4||OBJ_PERIOD_M5);
 
peterpies:


These lines allow the line back ground to be changed once the indicator is running.


These lines set the line to back ground or not based on the above true or false.


You can add these lines to the indicator to control the visibility from the code, but not the inputs, just add the time frames you want.

Could you please clarify where to exactly put the code to only show the lines in specific TFs ? 

I tried to add them in different places in source code but it doesn't work :(

Thanks in advance 

 
I found this version which someone edited it to work fine with preferred TFs . I put it here for the people who are looking for it . 
Files:
 
Vahid K:
I found this version which someone edited it to work fine with preferred TFs . I put it here for the people who are looking for it . 

Thanks for looking out. Grateful.

 

Thank you very much guys!!

I was looking for an indicator similar to this one, in order to place the hours of trading sessions, and it solved the issue perfectly. Thank you :)

 
瓦希德·K 我发现有人编辑了这个版本,可以和首选的工作一起工作。 我把它放在这里正在寻找它的人。 

Thanks a lot!

 

Forum on trading, automated trading systems and testing trading strategies

Daily Vertical Lines in MT5

neil324, 2019.08.05 11:03

Updated the indicator and set lines to background removing the time stamp. This can be changed back in the indicator inputs 'Line 1 Background' true/false.

Can't change the visibility, maybe someone else can help. I thought visibility was always changeable in the visualization inputs, unless a 'Object Set Integer' flag was added to the indicator code, I would be interested in the solution for this for the future.


Thank you so much!!!! Been looking for this very simple indicator for a very long time. This should be built-in to MT5.
 
Fernando Carreiro #:

The original MQL4 code is very old and unstructured and requires that it be totally redone properly (which I will be doing over the weekend).

However, here is a very quick & dirty fix so that it will work on MQL5, despite the need for it to be refactored properly.

There could still be bugs, and the proper rewrite will be released later.

Hello Fernando Carreiro,

I was trying to find exactly this indicator.

It works fine on MT5.

Thanks a Lot !

 
FISMirror FinInvestServ #: Hello Fernando Carreiro, I was trying to find exactly this indicator. It works fine on MT5. Thanks a Lot !
You are welcome!
 

Fernando Carreiro #:
You are welcome!

Mr Carreiro Hello. I saw in your profile that you are an active Forex Trader; I am new in MQL community and trying to find an indicator in order to be able to have vertical lines separator for the Days of the week but also to be able to change the time GMT wise to resemble the NY time and not that of the broker. Do you happen to be aware for such an indicator for mt5? I have been searching for it but the one I found you can not change the time as per GMT. Thank you for taking the time to read my query. 

I have found this one for mt5 that shows exactly what I want but it does not have the option of setting the GMT time you want in order to be aligned with NY time  dailylines.mq5 by  Tjipke de Vries

Tjipke de Vries
Tjipke de Vries
  • 2014.05.22
  • www.mql5.com
Trader's profile