OnTimer - How is the functionality of OnTimer, when in a custom indicator, which is called from an EA?

 

Hello world,

I'm using OnTimer in an self written indicator. It should display the time in seconds till new bar (Comment).

If I load the indicator all works like I planned.


But if it is called by an expert, the counter stucks.

I guess, that in this case OnTimer is not used. Do you have other suggestions to get this functionallity?


Many thanks

 
Al Bundy: I'm using OnTimer in an self written indicator.

Indicators calculate from the chart. OnTimer should be irrelevant.

Explain what you are trying to do.
          The XY Problem

 
William Roeder #:

Indicators calculate from the chart. OnTimer should be irrelevant.

Explain what you are trying to do.
          The XY Problem

Hi, I want to check and maybe create a signal 2 seconds before end of bar.

I'm displaying a countdown and it works if I load this indicator. It don't work if it is called as iCustom from EA.

 
Al Bundy #:

Hi, I want to check and maybe create a signal 2 seconds before end of bar.

I'm displaying a countdown and it works if I load this indicator. It don't work if it is called as iCustom from EA.

This indicator … is it doing anything else? Or is just counting?! Drawing a line or anything? Cause that you can call in a EA… but if u need a timer , you should built it in the EA … forget about the indicator 
 
Daniel Cioca #:
This indicator … is it doing anything else? Or is just counting?! Drawing a line or anything? Cause that you can call in a EA… but if u need a timer , you should built it in the EA … forget about the indicator 

Hi,

thanks for reply.

It's drawing lines and arrows for signals. They should delivered to an bought EA with professional MM and 100 options - xCustomEA. I don't like to invent the wheel again.

 
Al Bundy #:

Hi,

thanks for reply.

It's drawing lines and arrows for signals. They should delivered to an bought EA with professional MM and 100 options - xCustomEA. I don't like to invent the wheel again.

So nobody knows a solution? then mql5 is more illusion than substance...


 
Al Bundy #: I want to check and maybe create a signal 2 seconds before end of bar.

You can't know when a candle closes. Only when a new tick arrives that starts a new bar is the old bar closed.

All you are doing is trying to capture the last tick. OnTimer is irrelevant.

 
Al Bundy #:
So nobody knows a solution? then mql5 is more illusion than substance...


You are a funny guy, you don't know how to do something so the problem is the software ? loool

Add your indicator on the chart using ChartIndicatorAdd().

 
Alain Verleyen #:

You are a funny guy, you don't know how to do something so the problem is the software ? loool

Add your indicator on the chart using ChartIndicatorAdd().

I coded it as in documentation is written. Documentation: "Each Expert Advisor and each indicator work with its own timer receiving events solely from this timer."

I know what and how to code, but it doesn't like expected.

My first post: "If I load the indicator all works like I planned." This means the counter counts down, when indicator is loaded without EA.

"But if it is called by an expert, the counter stucks." So it looks like the counter of the indicator isn't called, when called from an EA. That contradicts the documentation.

I know when first bar arrives, and that M5 will end after 300 seconds, so I want to check a possible signal creation after 298 seconds.

If mql isn't able to do this, then either it is not full documented or has a bug.

I hope, that each real professional who has coded thousands of lines knows most of the weaknesses of a system...

I call it with iCustom. Why should I do it with ChartIndicatorAdd?

thank you for your effort.

 
Al Bundy #:

I coded it as in documentation is written. Documentation: "Each Expert Advisor and each indicator work with its own timer receiving events solely from this timer."

I know what and how to code, but it doesn't like expected.

My first post: "If I load the indicator all works like I planned." This means the counter counts down, when indicator is loaded without EA.

"But if it is called by an expert, the counter stucks." So it looks like the counter of the indicator isn't called, when called from an EA. That contradicts the documentation.

I know when first bar arrives, and that M5 will end after 300 seconds, so I want to check a possible signal creation after 298 seconds.

If mql isn't able to do this, then either it is not full documented or has a bug.

I hope, that each real professional who has coded thousands of lines knows most of the weaknesses of a system...

I call it with iCustom. Why should I do it with ChartIndicatorAdd?

thank you for your effort.

It is able and I provided you the solution, do your home work.

 
Alain Verleyen #:

It is able and I provided you the solution, do your home work.

Hi,

OK. I have bought xCustomEA and want to use it for this purpose. It has a parameter for the indicator. xCustomEA uses iCustom as far as I know.

The developer of xCustomEA wrote, that his EA is "as is" and he don't want to extend functionalities.

So anybody knows a solution?


Reason: