use bought indicator in EA

 

Hi,

 

is it possible to use an bought indicator (I don't have the source code) in my own EA?

Thank you,
Alex 

 
If it uses buffers, yes. Regards
 
Jose Francisco Casado Fernandez:
If it uses buffers, yes. Regards

Thank you for your reply!
Can you clarify things a little bit?

Do you mean: inserting the indicator as iCustom (what about the input params?) and accessing the buffer(s) from outside (from EA) then?
How can I see, if it uses buffers at all?
Can it be tested while indicator is in demo mode? As I have seen, a indicator in demo mode can only run in tester, can it run in tester within an EA? 

 
Alex:

Thank you for your reply!
Can you clarify things a little bit?

Do you mean: inserting the indicator as iCustom (what about the input params?) and accessing the buffer(s) from outside (from EA) then?
How can I see, if it uses buffers at all?
Can it be tested while indicator is in demo mode? As I have seen, a indicator in demo mode can only run in tester, can it run in tester within an EA? 

https://www.mql5.com/en/docs/indicators/icustom
Documentation on MQL5: Technical Indicators / iCustom
Documentation on MQL5: Technical Indicators / iCustom
  • www.mql5.com
Technical Indicators / iCustom - Reference on algorithmic/automated trading language for MetaTrader 5
 
Alex:

Thank you for your reply!
Can you clarify things a little bit?

Do you mean: inserting the indicator as iCustom (what about the input params?) and accessing the buffer(s) from outside (from EA) then? If it uses buffers there's no problem. Yes, you could use iCustom. Params are visible in indicator's inputs tab.
How can I see, if it uses buffers at all? If it shows one or several values into Data Window, it uses buffers. Otherwise, it doesn't.
Can it be tested while indicator is in demo mode? Yes. As I have seen, a indicator in demo mode can only run in tester,  Yes. can it run in tester within an EA?  No.

My answers in red color. Regards.
 
Jose Francisco Casado Fernandez:
My answers in red color. Regards. can it run in tester within an EA?  No.
Why "no"? AFAIK, one can call a demo indicator via iCustom from EA, but the test will be automatically stopped some days before current time.
 
Stanislav Korotky:
Why "no"? AFAIK, one can call a demo indicator via iCustom from EA, but the test will be automatically stopped some days before current time.
A demo indicator from the market????. Really, I have never tested it, as I code indicators and I don't use demo indicators, but I tried to attach a demo indicator to a EA backtesting chart and it was not possible. Regards.
 
Jose Francisco Casado Fernandez:
A demo indicator from the market????. Really, I have never tested it, as I code indicators and I don't use demo indicators, but I tried to attach a demo indicator to a EA backtesting chart and it was not possible. Regards.
I did the test some time ago, and it worked as I said. Probably something has changed, or some other nucances differ. I did not attach the demo indicator to the chart, I called it from iCustom in EA (as OP asked).
 

I managed to insert the indicator now, and it is working in my own EA in strategy tester :-)  so I can confim what Stanislav Korotky said.
The problem was, that I forgot to correctly set the "dummy params" that are used in the indicators' input tab (these dummy params are used for dividing the input params in 'sections').

I copied now four indicator buffers for output with function CopyBuffer(hndl,0,0,1,out):

[...]
Buffer4 17976931348623157[... very long number ...]97826204144723168738177180919299881250404026184124858368.00000000
Buffer3 1.14122000
Buffer2 17976931348623157[... very long number ...]97826204144723168738177180919299881250404026184124858368.00000000
Buffer1 1.14207000
[...]

1.14207000 and 1.14122000 are current quotes, but what is the long number and what does it say to me? Did I fetch the buffers in a wrong way?

What I want to do: The indicator shows me the trend and from time to time it changes from bullish to bearish and vice versa. I want to check for this point of time to make trading decisions.

 
Alex:

I managed to insert the indicator now, and it is working in my own EA in strategy tester :-)  so I can confim what Stanislav Korotky said.
The problem was, that I forgot to correctly set the "dummy params" that are used in the indicators' input tab (these dummy params are used for dividing the input params in 'sections').

I copied now four indicator buffers for output with function CopyBuffer(hndl,0,0,1,out):

[...]
Buffer4 17976931348623157[... very long number ...]97826204144723168738177180919299881250404026184124858368.00000000
Buffer3 1.14122000
Buffer2 17976931348623157[... very long number ...]97826204144723168738177180919299881250404026184124858368.00000000
Buffer1 1.14207000
[...]

1.14207000 and 1.14122000 are current quotes, but what is the long number and what does it say to me? Did I fetch the buffers in a wrong way?

What I want to do: The indicator shows me the trend and from time to time it changes from bullish to bearish and vice versa. I want to check for this point of time to make trading decisions.

Ok. You were talking about MT5. I thought it was about MT4. Now, we know another thing else. We can not attach a demo indicator to an EA chart, but we can call it from inside EA through iCustom. Regards.
 
Alex:

[...]
Buffer4 17976931348623157[... very long number ...]97826204144723168738177180919299881250404026184124858368.00000000
Buffer3 1.14122000
Buffer2 17976931348623157[... very long number ...]97826204144723168738177180919299881250404026184124858368.00000000
Buffer1 1.14207000
[...]

1.14207000 and 1.14122000 are current quotes, but what is the long number and what does it say to me? Did I fetch the buffers in a wrong way?

What I want to do: The indicator shows me the trend and from time to time it changes from bullish to bearish and vice versa. I want to check for this point of time to make trading decisions.

I think the very long number is EMPTY_VALUE. I suppose there should be 1 or 2 buffers to indicate bullish or bearish trend, so you need to discover how they code the trend (or ask the indicator author).
Reason: