joshatt:
Hi,
I want to make an EA single instance. ---- only can attach to 1 chart, neither any other symbol, nor same symbol but different timeframe chart. But I can switch timeframe in this one chart.
I managed to write the following code:
But there's error: 'TimeCurrent' - initialization expected .....
You can only initialize with a constant, not the return from a function.
Do this . . .
datetime timeinit; timeinit = TimeCurrent();
Thanks for fast response.
RaptorUK:
You can only initialize with a constant, not the return from a function.
Do this . . .
Thanks for fast response.
This way got error, too: 'timeinit' - expression on global scope not allowed .....
Wonderful !
~Cheers.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
I want to make an EA single instance. ---- only can attach to 1 chart, neither any other symbol, nor same symbol but multi charts. But I can switch timeframe in this one chart.
I managed to write the following code:
But there's error: 'TimeCurrent' - initialization expected .....
So I tried to replace
datetime timeinit = TimeCurrent();
with:
MathSrand(1);
int timeinit = MathRand();
I got same error.
First of all, I want to put this timeinit in init(), but it can not pass data to deinit() or start(), so I put it Head Part. Now what?
Any idea?
Thanks.