How I can made a Expert Advisor of a Indicator?

 
 

The best option is probably to take a look at modifying the MACD sample EA that metatrader provides.

Alternatively you could take a look at one of the code generation tools available such as Forex Software - Gordago although in my experience you'll still need to code for these tools to be of any use.

You might get lucky and someone who's trying to learn MQL might just take a look. To get a good coder interested it helps if you can convince them that the method is something worth taking a look at, such as results from a hand back test, or results from a live forward test

 

How about using the iCustom function.

sngSlope0 = NormalizeDouble(iCustom(NULL, 0, "Slope Direction Line", 80, 3, 0, 0, 0), 4);

sngSlope1 = NormalizeDouble(iCustom(NULL, 0, "Slope Direction Line", 80, 3, 0, 1, 0), 4);

if (sngSlope1>=sngSlope0) {

// Long

}

else {

// Short

}

If you have the .mq4 code for the indicator, you can use the iCustom function. I'm assuming "Slope Direction Line.mq4" is the name of the indicator you are using.

 

Hate to pop your idea, but the direction line repaints radically and is unstable to use in an ea (Too many false signals!).

Dave

 
 
The Rock:
--------------------------------------------------------------------------

I have to attempt insert this code but the Expert Advisor don`t start!

sngSlope0 = NormalizeDouble(iCustom(NULL, 0, "Slope Direction Line", 80, 3, 0, 0, 0), 4);

sngSlope1 = NormalizeDouble(iCustom(NULL, 0, "Slope Direction Line", 80, 3, 0, 1, 0), 4);

if (sngSlope1>=sngSlope0) {

// Long

}

else {

// Short

}

Have One here qualities in MQL4 programming and can help me this EA to program?

// Long - means place your Buy routine here. The "//" are comments.

 

Hi everyone.

I have made this EA. It works.

I have not analyzed the Indicator well, but it is maybe a kind of or something.

Type of Trading System is like MA cross reverse entry.

It means You always have buy or sell position.

note:

1. You need Custom Indicator named "Slope Direction Line" ,of course.

2. This EA uses previous bar to judge if Trend has changed.

So it doesn't use "Future" Indicator value.

3. I added "TradeSwitch" function on this EA.

You can turn off Buy or Sell Order.

4. I added "Fake Position Sizing" function on this EA.

This algorithm decides lot size by volatility(ATR).

But remember This EA doesn't set any stoploss.

So you can't limit loss to be exact.

That's why I call it "Fake".

You can turn off the function if you don't want.

5. I recommend D1 timeframe to use this EA.

6. Don't use this EA on real money.

It will need many improvements.

enjoy.

 

Sorry , I forget to attach mq4 file.

 

is it has the ebook how to build EA?

 

Sorry, Here is mq4 file.

Files:
 
faizfakhirin:
is it has the ebook how to build EA?

Not quite sure what this has to do with this thread but what ebook are you referring too exactly?

Lux

Reason: