No idea how to pass correct time to the indicator.
IMHO I think it never worked. I never found it mentioned in MQL documentation.
Similarly Bid differs from Close[0], test orders are missing, while candle arrays are as you expect.
Wow.
What do you mean: "Bid differs from Close[0]" - which one is correct or better?
And what do you mean test orders are missing? Can you give an example?
Thanks in advance,
Gooly
Wow.
What do you mean: "Bid differs from Close[0]" - which one is correct or better?
And what do you mean test orders are missing? Can you give an example?
Thanks in advance,
Gooly
https://docs.mql4.com/runtime/start
Custom indicators work in the main interface thread. If a custom indicator has been called with the iCustom() function, this indicator works in the thread of the program that has called it.
Any idea how to get the correct back-test-time 'into' an indicator? Try having the EA write TimeCurrent() to GlobalVariableSet() and indicator read the time from that. You can also use File. Also, lets not forget iCustom().
Indicator's don't need correct time. They should only be look in O/H/L/C/T [0]
In EAs, Bid == Close[0] always. In indicators, in the tester, Bid and timeCurrent is not modeled correctly.
Thanks for your answers!
But how do you call TimeCurrent() or iTime() or even MarketInfo() by iCutsom()?
Whatever I tried:
iCustom(Symbol(),Period(), "TimeCurrent", 0,0);
iCustom(Symbol(),Period(), "MarketInfo",Symbol(), MODE_TIME, 0,0);
iCustom(Symbol(),Period(), "iTime",Symbol(),PERIOD_M1,0, 0,0);
...
I only get 1970.01.01 00:00 while the directs calls give the expected - even not desired - values?
(Rem.: double d =MarketInfo(Symbol(),MODE_TIME);string s=TimeToStr(d); works, it shows online-server-time)
Gooly
You don't, iCustom() is to access data in an Indicator's buffers, iTime(), MarketInfo() etc are functions.
Gooly
ok, but how has paulepanke ( https://www.mql5.com/en/forum/143310/page2#753302 ) got his values via iCustom as he said?
Gooly
You will have to ask him, but I assume he coded an Indicator which printed, for example, MarketInfor(Symbol(), MODE_TIME) and others, and then called this Indicator from an EA running in the Strategy Tester using iCustom(), how else would he do it ?
You will have to ask him, but I assume he coded an Indicator which printed, for example, MarketInfor(Symbol(), MODE_TIME) and others, and then called this Indicator from an EA running in the Strategy Tester using iCustom(), how else would he do it ?
ok, that might be, thanks again.
May the pips be with you :)
Gooly
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
someone else asked how does an indicator gets the correct time!
Just try to create an indicator to show only the time.
So this prints the correct open time of the bar during a back-test (e.g. 2011.01.03 07:00):
But this prints the the last server-time of the real quotes (today Sa. evening: 2013.02.22 22:59):
Even this:
shows the real-quote-server-time and not the back-test-time :((
Within an EA on the other hand this:
show the correct back-test-time: 2011.01.01 07:34
Any idea how to get the correct back-test-time 'into' an indicator?
Thanks in advance,
Gooly