This is a mystery to me! - page 2

 
RaptorUK:


The Indicator is probably trying to get the window number from where it is attached so it can draw it's Objects, but it isn't actually attached so it fails to get the Window number, hence -1, so it can't draw it's Objects, does it need these Objects to function correctly ? do you have the source code for the Indicator ?

I have already attached the source code for the indicator in my previous post.

I find that this indicator does not populate itself and draw the indicator chart/graph when I restart my computer or MT4. I have to select and Edit and Close it before the graph is drawn and I can read any data in the Data Window.

I have sometimes have to delete the indicator and reload it on my charts before it gives the correct currency values.

 
ernest02:

I have already attached the source code for the indicator in my previous post.

Ah yes, I should have looked more carefully . . .

You should be able to fix the ObjectCreate message by doing this in the indicator . . .

Where you see this, (3 places) . . .

int windex = WindowFind ( shortName );

replace it with this . . .

int windex;

if( WindowFind ( shortName ) == -1 )
   windex = 0;
else windex = WindowFind ( shortName );
 

I have made the changes to the indicator code as you suggested and it has removed the error message i was getting, but now the indicator is also drawn on the main chart in addition to its own window.

I have solved the problem with the third variable giving a zero value all the time! Look at the code and see if you can find it. (Tip: look at spelling!)

    double USDbefore1 = iCustom(NULL,0,"CurrencySlopeStrength(2)",0,2);
    double USDbefore2 = iCustom(NULL,0,"CurrencySlopeStrength(2)",0,3);
    double USDafter = iCustom(NULL,0,"CurrencySlopeSrength(2)",0,1); 
 
ernest02:

I have made the changes to the indicator code as you suggested and it has removed the error message i was getting, but now the indicator is also drawn on the main chart in addition to its own window.

I have solved the problem with the third variable giving a zero value all the time! Look at the code and see if you can find it. (Tip: look at spelling!)


That's odd, you should have had the message"Unable to load CurrencySlopeSrength(2)"
 
ernest02:

I have made the changes to the indicator code as you suggested and it has removed the error message i was getting, but now the indicator is also drawn on the main chart in addition to its own window.

I have solved the problem with the third variable giving a zero value all the time! Look at the code and see if you can find it. (Tip: look at spelling!)

Do you have it attached to a template as well as calling it via iCustom ?
 
RaptorUK:
Do you have it attached to a template as well as calling it via iCustom ?


Yes. Is that the problem?
 
GumRai:

That's odd, you should have had the message"Unable to load CurrencySlopeSrength(2)"

No such message in the Journal! Could have saved myself days in time and trouble if it was there!:-(
 
ernest02:

Yes. Is that the problem?
It explains the 2 copies, one in the main window and the other in the sub window.
 
ernest02:

No such message in the Journal! Could have saved myself days in time and trouble if it was there!:-(


I think it would be in the experts tab.

I can't remember exactly, but once when I copied an EA and indicator from one platform to another, I mistakenly copied the wrong version of the indicator, and I got this message or something similar in one of the logs. You left the first "t" out of "Strength", so I would have thought that you would have got the same message.

Reason: