Error creating indicator over another indicator...

 

Dear,


I can create the DEMA over the MA, but I can't create it over the SAR.


If I do:

   int hnd1 = iSAR(_Symbol, PERIOD_M1, 5, 20);
   int hnd2 = iMA(_Symbol, PERIOD_M1, 5, 2, MODE_SMA, PRICE_CLOSE);
   
   if (iDEMA(_Symbol, PERIOD_M1, 9, 5, hnd1) ==  INVALID_HANDLE)
      Print("Error creating DEMA handler over iSAR handler.");

   if (iDEMA(_Symbol, PERIOD_M1, 9, 5, hnd2) ==  INVALID_HANDLE)
      Print("Error creating DEMA handler over iMA handler.");

I receive "Error creating DEMA handler over iSAR handler". 


Somebody would know explain why we can create over one and can't over others?


Best regards!

 

Then guys, any tip about this question?!

 
fernandovm:

Dear,


I can create the DEMA over the MA, but I can't create it over the SAR.


If I do:

I receive "Error creating DEMA handler over iSAR handler". 


Somebody would know explain why we can create over one and can't over others?


Best regards!

Hi   ...I paste Your code and all works with no errors   (mt5)

 

reverse :)   ...compiling process  is clean but if I run the ea then we have error   but


always is useful to find out  what this error mean so  You can google error 4804, and if You would do it You would find out that this indicator can not be applied :)


ERR_INDICATOR_CANNOT_APPLY

4804

The indicator cannot be applied to another indicator


for future  the mt5 documentation is our friend and is fully indexed by google :)

https://www.mql5.com/en/docs/constants/errorswarnings/errorcodes

Regards     ...I'm far far from expert but I try to do as much by my self before posting the question, and not googling the error message ....     :)


Documentation on MQL5: Constants, Enumerations and Structures / Codes of Errors and Warnings / Runtime Errors
Documentation on MQL5: Constants, Enumerations and Structures / Codes of Errors and Warnings / Runtime Errors
  • www.mql5.com
The name of the custom symbol is invalid. The symbol name can only contain Latin letters without punctuation, spaces or special characters (may only contain ".", "_", "&" and "#"). It is not recommended to use characters , :, ", /,\, |, ?, *. The path of...
 

Dear Marcin, thank's by attention.


I do not know why you concluded that I did not check the documentation. Well, I will not go into that merit.


So, if you had gone ahead in the documentation, you would have found other interesting things.

See the DEMA documentation (https://www.mql5.com/en/docs/indicators/idema), the last parameter description:

applied_price

[in]  The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.

Sorry, if I read "or handle of another indicator" I think that I can pass the handle of another any indicator.


But okay, if you did not want to go get the documentation, maybe the code I submitted might serve to intrigue you. You said "if I run the ea then we have error", but you did not think it strange that we have not a error with the MA handler, but only with the SAR's? The code iDEMA(_Symbol, PERIOD_M1, 9, 5, hnd2) works fine!


I'd like to know why it works for some and it does not work for others. I hope that this answer is in the documentation, but I have not found it yet.

Documentation on MQL5: Technical Indicators / iDEMA
Documentation on MQL5: Technical Indicators / iDEMA
  • www.mql5.com
//|                                                   Demo_iDEMA.mq5 | //|                        Copyright 2011, MetaQuotes Software Corp. | //|                                             https://www.mql5.com | "The method of creation of the handle is set through the 'type' parameter (function type...
 
So then guys, would anyone have any clue?
 
fernandovm:
So then guys, would anyone have any clue?

You are right. It doesn't work either if you try it directly on a chart (no code). I don't see why it doesn't work with PSAR, so either is a bug or we missed both the underlying reason.

However if you try with "Parabolic SAR" from "Examples" folder, it works. So probably a bug or a limitation on the standard built-in PSAR.

 
Alain Verleyen:

You are right. It doesn't work either if you try it directly on a chart (no code). I don't see why it doesn't work with PSAR, so either is a bug or we missed both the underlying reason.

However if you try with "Parabolic SAR" from "Examples" folder, it works. So probably a bug or a limitation on the standard built-in PSAR.

I have the same problem embedding a custom indicator that uses iBand. Is there a work around for this?

 
Issue may be due to passing excessive parameters in iCustom. i was using iRSI, then did a custom indicator but when changing from iRSI to iCustom, i forgot to delete one parameter which is not taken on the custom indicator. then i got this error. could have an error code to tell "excessive parameters passed to iCustom" lol.
Reason: