• Overview
  • Reviews
  • Comments
  • What's new

Exit By Indicators

Exit based Indicator - What is it?

Exit your open positions based on up to 10 indicators. Even those you buy in Market !!!

Use any indicator that provides buffer values (most of them output buffers).

You can use any available buffers and even compare various indicator values.

Selectors for exiting Buy Positions and Sell Positions are separate.

The EA works in AND or OR mode. You can combine multiple instances to create elaborate rules.


Usage Ideas / Examples

- Exit all buy trades when slow MA below fast MA (MA cross over)

- Exit all sell when macd signal above macd value

- Exit trade when ATR below certain level

- It can be used in addition to or in spite of a stop loss. 

How to Use (Please see screenshots):

1. Attach the indicator(s) to chart.

2. Press the FillCombos button to refresh indicator list.

3. Select indicators to use in drop down.

4. Select the buffer number.

5. Select operator. Supports: =, >, <, <=, >=, !=

6. Select a value to compare with (comparison value).

7. Optionally check the c tickbox. If ticked, it will only take the value at close of candle.

8. Press LoadIndicators when done.

9. Remember to confirm the EA mode (AND / OR)

Important Backend Values:

Please use the Magic Number to govern what trades will be closed.

You MUST provide hard price boundaries for the EA.

If you want the EA to operate at all times, use boundaries that are very high.

e.g. if buy upper limit is 1.17 and buy lower limit is 1.16, the EA will only work when price is in this range.

In case of EURUSD e.g. if I set upper limit as 2 and lower limit as 1, the EA will pretty much all the time.


Each EA instance can work in AND mode or OR mode.

In AND mode, all the given conditions should be true.

In OR mode, any of the given conditions can be true.

Remember, you can have multiple instances.

Advanced Feature - Compare with ASK price

You can use the letter "a" om the comparison value. It represents the ask price.

You can also use + or - to add or subtract

e.g. in EURUSD "a + 0.00001" means add 1 point to the ask price

Advanced Feature - Compare buffers

You can compare a buffer of the indicator with another buffer of same or another indicator.

E.g. lets take a chart of EURUSD with macd attached to it.

Window will be 1 (since the chart window is numbered 0)

Indicator will be 0 (since the only indicator in that window. We start count by 0)


- The macd value buffer is 0 (you can check either from data window or ask the developer)

- The macd signal buffer is 1

Now you can compare like this for condition that signal is greater than macd:

---------- Example of row of selector

Indicator  (dropdown): 1 0 MACD    Buffer: 0    operator: <    Comparison Value: f 1 0 1

--------- Example explained

"f" means we are evaluating a function. It is mandatory.

Exactly one <space> is required between the function statement values.

First Function value 1 stands for the window number.

Second Function value 0 stands for the indicator number.

Third Function value 1 stands for the buffer number.


1) You can often find buffer values in the data window.

2) While the order of the buffer numbers in the data window starts with 0, it is not always in order.

3) You can get buffer number and description from developer or looking at code, if available.

4) You can simply increase the buffer numbers and see if you get a value.

5) If you can see a value in chart, chances are it is being output in a buffer.

I am here for support:

This indicator is definitely work in progress. I use it myself.

It may need some getting used to. Please feel free to ask for support.


- No back test

Reason: The nature of this EA does not permit any back testing. You can test on a demo account.

- Sometimes the indicator buffer value will translate to N/A. 

Possible reason: The buffers could not be read.

Solution: Wait for about 10s then press FillCombos. Then proceed to select indicators again.

Troubleshoot: Remember to press LoadIndicators to refresh/populate values.


I cannot claim that this expert advisor will work perfectly, or even to your satisfaction. It is given on as is basis and you can use it only if you indemnify me from any direct or indirect loss incurred by use of this expert advisor.

No reviews
Version 1.18 2018.08.28
- Error corrected when sometimes all orders would be closed, rather than one direction
- Error corrected where a - value was not working properly