How I can made a Expert Advisor of a Indicator? - page 2

 

The slope direction line repaints at least 2 bars. Backtesting always

make it look pretty but in real life is limited at best in value.

I would add the slope out put to an ea not build around it.

 

I found a bug in the EA I have posted last time.

EA ignores Exit Signal when trend has changed.

So I fixed it.

(You can replace it with any other stop system if you want.)

Also I added a small change.

You can choose microlot account from .

File name is the same. So Just overwrite it.

 

Thanks Latimeria for your EA !

Is it possible for you to create a new version to active order when price penetrated the SDL and add TakeProfit choice. I would use it on 15 min

 

This is a very good idea of turning an indicator into an EA!I will try it with some of my own custom indies,too........

 

Here is the improved version of "SlopeDirectionLine_EA".

This EA has many substantial changes.

1. Entry Logic has changed.

First of all. This EA enter the market only when signal changes.

(previous version enter the market anytime following the trend)

This change allow you to use any kind of Stop System (initial, trailing, period BreakOut, paraboric, etc.).

To tell the truth, I think that Entry Signal itself is not so important,

but considering the advice from Mr. ajk,

This EA uses 5 bars including current one (see the code if you want to know details).

I hope it works better in the real market.

But, as you know, what makes Trading System robust is not Entry Signal but Stop System --- How to Exit the market.

2. You can place initial stoploss (ATR Multiple, Fixed Pips, or No Stoploss)

Placing Initial stoploss allows you "Real" Position Sizing.

3. You can use Trailing Stop (ATR Multiple, Fixed Pips, Reserve Profit, or No Trailing).

4. You can use MA Filter.

If you use this filter, This EA enter the market only when MA direction and Signal direction is the same.

You can change MA Period and Method.

*All the function above can be turn off or change settings.

So you can test the System with various settings and you can see how it works.

Note that functions above does not always result good.

For example, using MA Filter may avoid false Signals, but it reduces your entry chances also.

Tight stoploss (initial or trailing or other stop method) may protect your equity

and secure your profit, but you may miss a rare Large Profit Trade.

Contraly, if you don't use these kind of stop systems or filters, you may meet unbearable large drawdown.

Balance with expectable Profit against (un)expectable Drawdown is what Trader must consider most.

You must find your best Risk / Return ratio yourself.

Anyway enjoy.

*To use this EA, you need a modified version of "SlopeDirectionLine" indicator.

Original indicator has an array named trend[] only used in culcuation procedure.

This value (1 or -1) directly represents trend.

I added a buffer to hold trend[] value so that EA can use this value.

You can see the value of latest 5 bars on the top left of the chart window.

 

Hi, extremfx and everyone.

According to extremfx's request, I made EAs for (maybe) short period Traders.

But It's a nothing but a test version.

So don't blame me even if it doesn't seem profitable.

I have not optimized any settings, so find better settings if you are intersted in.

These EAs are designed to be able to change many settings.

If you find settings and TimeFrame that work well, report here. It may be useful for someone.

notes:

1. Entry Signals

These EAs have 2 selectable different (or reversal) Entry System.

Entry Timing is the same. It's When Price crossed the Line(SDL or MA).

I'm not sure This is what extremfx meant or not.

System 1 uses the Line as BreakOut.

System 2 uses the Line as Resistance.

(see the code for details)

It means, 2 system bet on the opposite direction at the same timing.

So I named these EAs .

(You can use only 1 system at the same time. If you want to test both systems on several same symbol (currency pair) charts at the same time, change the MagicNumber.)

Anyway, You'll see what these EAs do if you test it.

2. Take Profit

I usually don't place takeprofit because it causes missing strong and continuous trend.

And I don't know any effective and reasonable logic to decide takeprofit target that is not obscure.

(If anyone knows, tell me)

But, anyway I added a function to place TakeProfit.

There are 4 TakeProfit Method.

No TakeProfit, Stoploss Multiple, Fixed Pips and S&R(*need another Custom Indicator).

Deciding TP target by S&R may be just a joke.

Indicator looks good, but it uses iFractals

and It seems to took 2 or 3 bars to update S&R and seems unstable.

Regard it as Just a test.

3. Week End Close Function

This function allows you to close position at specified server time on Friday.

It may be useful for short period traders who don't want to hold any positions on WeekEnd.

4. Show Settings by Comment

I added a function to show Settings on the chart window.

These EAs have many settings.

So It will be very convenient when you examine settings.

5. MA version

Not only SDL version, I made a MA version.

You can modify MA settings to your heart's content.

Like this, You can replace entry logic with any kind of them.

6. These EAs open trade only bar opening also.

I just don't want to waste my time on tick by tick backtesting...that's why.

Any impressions are welcome.

enjoy.

1. Indicator

*One of the reason that makes using this Indicator troublesome on EA is

SDL value is housed in 2 different arrays.

So I modified it again (or waste author's effort to change color by trend...).

Now modified version of Indicator holds SDL value in an array(buffer 0) and easy to handle.

2. Indicator

Indicator that shows recent High and Low.

 

I added some functions to "SDLvsPrice_Reversal" and this is the last version.

From the beginning, I see nothing special about this indicator called SDL (In my opinion, it is just as useful as many other popular indicators are).

I tried to make an EA just because this indicator changes color by trend and I have not handled that kind of indicator, and thought it to be helpful for someone who want to try EA with this indicator, that's all.

I got several new ideas while making these EAs and that makes me feel satisfied, but that's nothing to do with this indicator.

So, I'm sorry but I won't improve these EAs anymore.

Feel free to revise if you would like to.

It may not be useful for happy EA collectors just looking for EAs

that "seem profitable as it is" and "downloadable for free",

I think my EA can be fairly good basis of making robust Trading System.

(Entry Signals don't matter much as I said over and over, use your favourite ones)

enjoy.

last version note:

1. Profit Achievement Stop

This is a function to exit the market when profit reaches fixed percentage against your account balance.

This can be used as alternative Take Profit Method.

If your account balance is $10000 and achievement rate is 1.0, EA close position when current profit exceeds $100.

2. Trade time function

If you use this function EA only trade (enter the market) only in specified period of the day.

For example, if you don't want to enter the market on Asian session, you can avoid that period.

This kind of anomaly sometimes works.

 

Thanks latimeria

I'll try this...

 

I have added some codes to indicate current entry price on the right side (for more fun).

System Logic itself has not changed at all.

additional note:

This EA open and close trade only at the bar opening.

So you can backtest this EA by Open Price Only.

 

scalping using Slope Direction Line

hi latimeria

I found this strategy some where (I forgot where is it) and tested with my demo acc for couple days and looks profitable, maybe you can help to make it as an EA ...??

here is the scalping system:

indicators:

- LWMA 5 Close (Red Color)

- SDL : Period 40 , Method 3 , Price 0 (DOWN: Tomato Color, UP: Light Blue Color)

- TrendEnvelops_v2 (attached) (DOWN: Tomato Color, UP: Light Blue Color)

TF = 15M

(template is attached too...)

LONG:

- SDL below LWMA

- TrendEnvelops_v2 below the candle

- SDL and TrendEnvelopes have the same colors

SHORT:

- the opposite of LONG

ENTRY ONLY AT THE OPENING OF SECOND CANDLE AFTER THE SIGNAL.

Look at the chart I attached here,

- Red Dot Line is the signal for Short

- Red Solid Line is the entry for Short

- Green Dot Line is the signal for Long

- Green Solid Line is the entry for Long

PLEASE... take a look at the RED circle, is a false signal because the SDL doesn't show the same color.

And loot at the GREEN circle, it's still a good signal if you can make a trailing stop for protect the profit

I'm waiting for your reply soon ..... thanks

Files: