Access to EA functions from custom indicator

 

hi,

it is my first post / question on the forum.

so far I have used only VT platform for programming auto-trading systems, but it has too many limitations.

now I have been trying to create some EAs and custom indicators under MQL4. it looks simmilar to old good C, so I really like it.

As I learnt from the mql web page, the EAs are for trading but I can't make any visualisation on the chart from it,

while CIs are for visualization of indicators without possibilities to initiate any trading action.

Please, correct me if the above statement is not correct.

Now the problem:

I am trying to create a custom indicator on the basis of MA, which has a various period. The period is changing at the moment of closing of an open position.

Can I check from the custom indicator if there is an open position, or such functions are dedicated only for EA ?

Another question:

As I understand the way EA works, the whole start() section is run with each tick.

What happens if not all instruction are done and new tick comes ?

i.e. if I write a loop with very extensive calculations in it, and it take much longer than 1 tick period:

- the present calculation are going to be breaken and with new tick new calculation starts ?

- everything waits for end of the present calculations ?

- there is another process run simultaneously for the next tick ?

I would appreciate if someone could answer my questions despite the fact that they may sound strange.

Thank you in advance,

mkowal

Reason: