iCustom communication problem

 

Hi 

i ve got the following situation.

I call iCustom for indicator A to call indicator B that return data almost instantly. I say almost cause it takes a few ms cause of some data validation indicitor B it does. Cause of these ms, the Buffer in indicator A is filled up with carbage. 

The only way to fix this is to manually switch timeframe and come back to the original one.

Is there any other way to overcome this situation?

 I do some short of error checking, like checking what the indicator_B returns, but there are many different scenarios that can occur, like: it may be ok for the first few bars and then the rest of the bars have carbage. Or all the bars be the same. 

Also there is the scenario that everything is fine, even buffers in indicator_A are filled in fine but cause of that delay are not displayed at all cause of that delay till i switch timeframe.

Any ideas? Anyone occured such a case before?

Thanks 

 

I had a similar problem in the past and a final solution which got rid of data inconsistency was to merge indicators A and B into a single indicator.

Indicators have to be coded a certain way to give same results in tester and live since tester handles indicators differently from EAs (for example you shouldn't use TimeCurrent() in CI). This brought me to a conclusion that having an EA calling indicator A which in turn calls indicator B could possibly lead to some other new issues in tester and those issues would be hard to track down so I prefer to keep a single level of dependency EA->ind1, EA->ind2, etc.

 
  1. Indicator's can not wait.
  2. Switching TFs (usually) makes them recompute all values.
  3. FIX the indicators. One or both are broken.
  4. No mind-readers here attach the code.
 
WHRoeder:
  1. Indicator's can not wait.
  2. Switching TFs make them recompute all values.
  3. FIX the indicators. One or both are broken.
  4. No mind-readers here attach the code.

What do you mean by broken?
 
athanfx: What do you mean by broken?
What do you mean by "indicator A is filled up with carbage?"
 
WHRoeder:
What do you mean by "indicator A is filled up with carbage?"


:)

I just mean that the return of iCustom(indictor_B) returns back  what it whould unless i switch timeframe.

On the other hand if i ll just use indicator_B on its own it works perfectly. Buffer is filled great.

I ll try to post some code later on. 

Reason: