|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
You should realise that bar number 0 is always in the process of being formed, and you should, in my opinion, never ever attempt to us it for indicator readings. You may use bar open, because that won't change, but bar close as well as high and low will or may change as new tick comes in, until that bar becomes bar number 1 (when a new bar number 0 begins being developed).
Therefore, I would suggest that you change the last argument in the iCustom calls to 1. |
|
||||
|
Quote:
thanks for suggestion, it sounds plausibly but the value is still the same |
|
||||
|
Yes, your are right; my concern was different.
The value you see is the EMPTY value, i.e. that there is no value assigned for the indicator at the bar. From looking at the code, apparently the indicator only assigns value at the bars where the arrows appear, and leav the value as EMPTY otherwise. It could make sense to add "SetIndexEmptyValue(0,0);" and "SetIndexEmptyValue(1,0);" in the init() function, and thereby define the unassigned value to read as 0. |
|
||||
|
Quote:
you are right - it works but the value is not at the same time as the indi draws the arrow, not even similarly ![]() |
|
||||
|
Quote:
What do you mean more exactly? How do you observe the timing difference between that an arrow is placed and that your EA notices it? |
|
||||
|
Quote:
for example look at the attachement and compare it with the journal: 24.01.2007 - 25.01.2007 EURUSD H1 SIGNAL 1 short 14:04:05 2007.01.24 15:00 ADX_CROSSES_ICUSTOM EURUSD,H1: _____________________________value2 1.3027 ... ... ... 14:04:05 2007.01.24 15:59 ADX_CROSSES_ICUSTOM EURUSD,H1: _____________________________value2 1.3027 SIGNAL 2 long 14:04:05 2007.01.25 08:01 ADX_CROSSES_ICUSTOM EURUSD,H1: _____________________________value1 1.2938 ... ... ... 14:04:05 2007.01.25 08:59 ADX_CROSSES_ICUSTOM EURUSD,H1: _____________________________value1 1.2938 SIGNAL 3 short 14:04:05 2007.01.25 15:18 ADX_CROSSES_ICUSTOM EURUSD,H1: _____________________________value2 1.3007 ... ... ... 14:04:05 2007.01.25 15:59 ADX_CROSSES_ICUSTOM EURUSD,H1: _____________________________value2 1.3007 SIGNAL 5 short 14:04:05 2007.01.25 17:32 ADX_CROSSES_ICUSTOM EURUSD,H1: _____________________________value2 1.3001 ... ... ... 14:04:05 2007.01.25 17:59 ADX_CROSSES_ICUSTOM EURUSD,H1: _____________________________value2 1.3001 SIGNAL 6 long 14:04:05 2007.01.25 18:08 ADX_CROSSES_ICUSTOM EURUSD,H1: _____________________________value1 1.294 ... ... ... 14:04:05 2007.01.25 18:59 ADX_CROSSES_ICUSTOM EURUSD,H1: _____________________________value1 1.294 Signal 7 long 14:04:05 2007.01.25 19:00 ADX_CROSSES_ICUSTOM EURUSD,H1: _____________________________value1 1.2957 ... ... ... 14:04:05 2007.01.25 19:59 ADX_CROSSES_ICUSTOM EURUSD,H1: _____________________________value1 1.2957 3 signals in the chart and 7 in the journal it works sometimes but not everytime ![]() thank u very much ![]() |
|
||||
|
Ok; firstly, of course, the displayed indicator is a different instance of that indicator from the instance that the EA uses. You would like them to present the same indications, but they don't, for a relatively simple but highly technical reason; namely that they are invoked in different ways.
If we fast-forward past the long-winded explanation, you end up with the concern I brought up initially; namely that through the EA, the indicator is queried again and again and with changing result while the most recent bar is being built. In particular, it makes signals as soon as the condition holds, even if it doesn't hold when the bar is complete. The displayed indicator appears to only use the completed bar data. Actually from looking mor closely at the code, I think the combined indicator is doubly weird in that it for bar 0 pulls iADX values relating to the close of bar -1 as well as close of bar 0. Does iADX predict bar close that well? The close of bar -1 is almost 2 hours from now, at least when bar 0 is just started. Basically "close of bar 0" is the always changing "last tick price", until this bar becomes bar 1. And bar -1 is a figment of imagination whose close price is (highly?) uncertain. Thus, as I understand it, the combined indicator should be changed to not set signals on bars 1 and 0, but it should set it on bar 2 (if the condition holds). As a consequence, the EA can only discover such a signal 2 bars behind, i.e. 1 hour after the close of the bar that is marked; i.e., it should look for the bar 2 signal. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| My suggestion for E.A. | forex_for_life | Suggestions for Trading Systems | 23 | 10-08-2007 01:13 PM |
| Property Level Problem - Need Suggestion! | iscuba11 | Indicators - Metatrader 4 | 1 | 06-09-2007 05:24 AM |
| Suggestion for an expert advisor, please help :) | multa | Expert Advisors - Metatrader 4 | 8 | 04-18-2006 09:45 AM |