New metatrader 4 compatible indicators - page 152

Tomcat98
186
Tomcat98  
mladen:
Tomcat

If you know the name of the object, then it is simple. Then it goes like this :

double TrendLineRedValue = ObjectGetValueByShift(TrendLineRedName,shift);

And in that case any call using iCustom() will create trend lines that you can then use to get their values. So, all you need is to know the exact names of the objects

Hi Mladen,

And now ladies and gentlemen...it even works in an EA!

Many many thanks Mladen for that coding lesson.

Have a good WE.

Sincerely.

Tomcat98

Hermo
383
Hermo  

New metatrader 4 compatible indicators

Good morning to all

Hello mladen

Please can you fix errors and warnings in this indicator. .

Thank you very much in advance.

A big hug.

Hermo.

Tomcat98
186
Tomcat98  
Hermo:
Good morning to all

Hello mladen

Please can you fix errors and warnings in this indicator. .

Thank you very much in advance.

A big hug.

Hermo.

Hi Hermo,

try it now

Have a good WE.

Tomcat98

Files:
Tomcat98
186
Tomcat98  

Hi All,

Another "old" but good one too found on TSD Forum. by "FerruFx"

Tomcat98

Files:
Tomcat98
186
Tomcat98  
mladen:
Tomcat

If you know the name of the object, then it is simple. Then it goes like this :

double TrendLineRedValue = ObjectGetValueByShift(TrendLineRedName,shift);

And in that case any call using iCustom() will create trend lines that you can then use to get their values. So, all you need is to know the exact names of the objects

Hi Mladen,

Supposing I want to insert TrendLines on a separate window buffer, how should I wrote this line?

"ObjectCreate("TrendLine1_Red", OBJ_TREND, 1, Time[12], Bid-100*Point , Time[0]+3600, Bid-100*Point );" ?

Let's say Indic BlahBlah = ((iCustom(NULL, 0, "BlahBlah", 0, i));

How should I insert / write "buffer 0,i " in place of "Bid-100*Point , Time[0]+3600,Bid-100*Point " ?

Thanks very much Mladen.

Sincerely.

Tomcat98

Mladen Rakic
160786
Mladen Rakic  
Tomcat98:
Hi Mladen,

Supposing I want to insert TrendLines on a separate window buffer, how should I wrote this line?

"ObjectCreate("TrendLine1_Red", OBJ_TREND, 1, Time[12], Bid-100*Point , Time[0]+3600, Bid-100*Point );" ?

Let's say Indic BlahBlah = ((iCustom(NULL, 0, "BlahBlah", 0, i));

How should I insert / write "buffer 0,i " in place of "Bid-100*Point , Time[0]+3600,Bid-100*Point " ?

Thanks very much Mladen.

Sincerely.

Tomcat98

Tomcat98

First you have to make sure that your separate window has a unique name

Then use the WindowFind(UniqueName) in order to get the window number (something like int window = WindowFind(UniqueName);

And then, as a last step use that number in place of 1 in that code line (this line :

"ObjectCreate("TrendLine1_Red", OBJ_TREND, window, Time[12], Bid-100*Point , Time[0]+3600, Bid-100*Point );"

All that needs to be done from the start procedure (using WindowFind() from init sometimes gives completely unexpected results)

Tomcat98
186
Tomcat98  
mladen:
Tomcat98

First you have to make sure that your separate window has a unique name

Then use the WindowFind(UniqueName) in order to get the window number (something like int window = WindowFind(UniqueName);

And then, as a last step use that number in place of 1 in that code line (this line :

"ObjectCreate("TrendLine1_Red", OBJ_TREND, window, Time[12], Bid-100*Point , Time[0]+3600, Bid-100*Point );"

All that needs to be done from the start procedure (using WindowFind() from init sometimes gives completely unexpected results)

Hi Mladen ,

Thanks for your reply.

And to select buffer_2 , not buffer_1 on that subwindow ? // or witch ever buffer?

"int window = WindowFind(UniqueName);" How do you write that?

Thanks a lot.

Sincerely.

Tomcat98

Mladen Rakic
160786
Mladen Rakic  
Tomcat98:
Hi Mladen ,

Thanks for your reply.

And to select buffer_2 , not buffer_1 on that subwindow ? // or witch ever buffer?

"int window = WindowFind(UniqueName);" How do you write that?

Thanks a lot.

Sincerely.

Tomcat98

Tomcat98

To select buffers and its values, the only function you can use for normal work is iCustom(......,bufferNO,index);

Mladen Rakic
160786
Mladen Rakic  
Tomcat98:
Hi Mladen ,

Thanks for your reply.

And to select buffer_2 , not buffer_1 on that subwindow ? // or witch ever buffer?

"int window = WindowFind(UniqueName);" How do you write that?

Thanks a lot.

Sincerely.

Tomcat98

Tomcat98

To select buffers and its values, the only function you can use for normal work is iCustom(......,bufferNO,index);

You can not select values of an indicator that is attached to a chart. Metatrader always opens a new instance of indicator when you wish to read it's buffer values

Tomcat98
186
Tomcat98  
mladen:
Tomcat98 You can not select values of an indicator that is attached to a chart. Metatrader always opens a new instance of indicator when you wish to read it's buffer values

Oh I see,

So it is definitely much better to straightly trade from the chart with TrendLines better than via SW_Buffer's.

I sincerely thank you for your enlightenment. I will work on that in the near futur.

I am wondering how I will be able to thank You and TSD forum at the level of these useful informations.

I sincerely thank you very much.

Tomcat98