Custom Indicator vs EA

 

Hello All,

I had a custom indicator that I added some code to in order to take trades, in an attempt to convert it into an EA. However, now when I try to attach it to a chart, it won't attach, and MT4 tells me it's not an EA, it's an indicator.

What am I doing wrong? How does MT4 identify a Custom Indicator vs an EA? Even though I have code in their to execute trades, MT4 insists it's an indicator!

Thanks in advance, for your assistance.

Tim

 

Not completely true, the expert advisor can draw lines, I have several that will draw lines, attached is my modified version of the hans123. buy and sell lines have been added.

I have others that draw fib lines, etc

use your imagination and you can put anything in the ea.

 
Foreverold:
Not completely true, the expert advisor can draw lines, I have several that will draw lines, attached is my modified version of the hans123. buy and sell lines have been added.

I have others that draw fib lines, etc

use your imagination and you can put anything in the ea.

Foreverold,

The lines I meant are the Buffersthat the indicators can draw (ex: moving average , cci etc) while the expert advisors can't.

The only way to see the buffers used in the EA is in the backtesting - after testing the EA click Open Chart button.

P.S: I hope to see this feature in MetaTrader soon.

 
tim_talmadge:
Hello All,

I had a custom indicator that I added some code to in order to take trades, in an attempt to convert it into an EA. However, now when I try to attach it to a chart, it won't attach, and MT4 tells me it's not an EA, it's an indicator.

What am I doing wrong? How does MT4 identify a Custom Indicator vs an EA? Even though I have code in their to execute trades, MT4 insists it's an indicator!

Thanks in advance, for your assistance.

Tim

Hi Tim,

Indicators:

1- The indcator can't use the Trades Fcuntions.

2- The indicators have to start with one of these lines:

#property indicator_separate_window

#property indicator_chart_window

3- You have to place the indicator in expert/indocators folder and compile it.

4- Indicators can draw lines on the chart.

Expert advisors:

1- Can use Trading Functions.

2- They cann't start with the above 2 lines.

3- You to place the EA in experts folder.

4- Expert advisor cann't draw lines (buffers).

 

True,

the buffers (setindexbuffer) function is not allowed

So if you wanted to include your complete system into 1 file as an expert advisor, you can not, but it could be added using the icustom feature, unless

metaquotes takes that away as well.

did you know in the new version 191 you now get an error if you try to get pivot levels using the same code you were using in version 190 (high + low + open) /3 what else will they remove?

 
I think adding Buffers to the Expert Advisor will make the world of MQL4 programming easier.

Just imagine you can draw the EMAs or the CCIs you use in the EA on the chart.

The programmers of the EA have to make an indicator as a visually aid for the user

(Example: EMA CROSS + EMA_CROSS_IND).
 

Hi Guys,

So how easy is it to convert the Indicator to EA....are there any speciall lines to add or delete...???????

Thanks

Babar

 
babarmughal:
Hi Guys,

So how easy is it to convert the Indicator to EA....are there any speciall lines to add or delete...???????

Thanks

Babar

Babar,

You can't convert an indicator to EA, they are completely different programs.

 

Indicators to work with EA

How do I make an EA to trade on indicators functions ?

for example if I want EA to take positions on any particular indicator,

can it be done ?

Thanks in advance.

Mukesh

 
Mukesh:
How do I make an EA to trade on indicators functions ?

for example if I want EA to take positions on any particular indicator,

can it be done ?

Thanks in advance.

Mukesh

Sure! That what the EAs are for!

You build an EA based on one or more indicators to automate your trades!

There are two kinds of indicators in MQ4:

Built in indicators: i.e. Moving Average, MACD, Bollinger bands etc.

To use these indicators you use their built in functions: i.e. iMA(), iMACD() and iBands().

Custom indicators: These are the indicator you downloaded from the net and you can use them in your MQ4 EAs by using the iCustom function.

For more details please review my tutorial at:

http://www.metatrader.info/node/34

 
codersguru:
Sure! That what the EAs are for!

You build an EA based on one or more indicators to automate your trades!

There are two kinds of indicators in MQ4:

Built in indicators: i.e. Moving Average, MACD, Bollinger bands etc.

To use these indicators you use their built in functions: i.e. iMA(), iMACD() and iBands().

Custom indicators: These are the indicator you downloaded from the net and you can use them in your MQ4 EAs by using the iCustom function.

For more details please review my tutorial at:

http://www.metatrader.info/node/34

I'm truly fascinated by your efforts here and in the metatrader.info.

this huge knowledge must have made you a millionaire by now through excellent EAs. If you recommend a specific EA, please let me know

Thanks again, I'm learning a lot from your site!

Reason: