Trading filter EA

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

Trading filter EA

Postby Rocco_Rod » Sat Nov 14, 2020 2:05 am

Hello Apprentice / team,

I am looking to have an EA that filters as follows :

- so i cannot trade when the market price is not between Price A [low] and Price B [high].
- so i cannot sell at a price that is not lower than the opening level of the current on-going candle (on M1 chart).
- and so i cannot buy at a price that is not higher than the opening level of the current on-going candle (on M1 chart).

Also and only if possible without being too much of a headache in the same code :

- the EA should automatically set a stop loss (with trailing option) and a take profit by a chosen number of pips or points (= distance to market price at opening of the trade) when I place a trade.

Thank you very much for your help
Last edited by Rocco_Rod on Sun Nov 15, 2020 6:58 am, edited 1 time in total.
Rocco_Rod
 
Posts: 27
Joined: Tue Apr 21, 2020 1:10 pm

Re: Trading filter EA

Postby Apprentice » Sun Nov 15, 2020 3:55 am

Can you provide an MQ4 version of EA or provide EA entry/exit rules.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36476
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Trading filter EA

Postby Rocco_Rod » Mon Nov 16, 2020 5:20 am

* Filter rule to open a buy trade - the buy price (B) has to be higher than the opening price of the current M1 candle.
* Filter rule to open a sell trade - the sell price (S) has to be lower than the opening price of the current M1 candle.

Only one trade at a time can be opened on a given instrument (to avoid a conflict of rules). For the exit/closing of the opened trades :

* a (trailing) SL is placed by number of points/pips (X) from the price at which the trade was opened.
* a TP is placed by number of points/pips (Y) from the price at which the trade was opened.

[The EA would also allow to exit an open position manually at any price before the SL or TP is hit.]

Thank you
Rocco_Rod
 
Posts: 27
Joined: Tue Apr 21, 2020 1:10 pm

Re: Trading filter EA

Postby Apprentice » Tue Nov 17, 2020 6:21 am

Your request is added to the development list.
Development reference 2321.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36476
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Trading filter EA

Postby Apprentice » Wed Nov 18, 2020 9:27 am

EA can't stop you from opening a position.
As I understand you need EA that does exactly that.
You need to define entry rules, to apply filters on.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36476
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Trading filter EA

Postby Rocco_Rod » Wed Nov 18, 2020 8:50 pm

Thanks for your feedback. I will clarify the definition of entry rules by starting to define a couple of key thoughts:

I call "reverse limit order" the opposite of a standard limit order. When a "sell - reverse limit order" is placed at price level L, a sell position is opened at current market price if current market price is below price level L. When a "buy - reverse limit order" is placed at price level L, a buy position is opened at current market price if current market price is below price level L.

I hope the above makes sense to you. If not please let me know.

EA can't stop you from opening a position. But EA can prevent an order (stop order, limit order or even reverse limit order) from being executed within a certain price zone defined by a price (the maximum or the minimum of that zone). Let's call such a filter a "no execution zone". Example 1- ; example 2- .

The following is what the input setup panel should look like for the EA we are building. No additional inputs/option required :

* price level L for reverse limit order : _____
* reverse limit order : buy or sell
* no execution zone -minmax : automatic (by default) or _____
* Quantity in lots : __
* stoploss in pips: __
* trailing: true / false
* take profit in pips : __

Detailed entry rules :

* reverse limit order to be placed at price level L. "Buy" or "sell" also to be selected by user on the setup panel for that reverse limit order.

* The automatic "no execution zone -minmax" is defined by EA as the non-execution of the reverse limit order until current market price
- is lower than the opening price of the current M1 candle (in case of a sell - reverse limit order) ; or
- is higher than the opening price of the current M1 candle (in case of a buy - reverse limit order).


Final comment: both a sell order and a buy order can be placed at the same time on a given instrument if the instrument is opened on 2 separate charts at the same time.
Rocco_Rod
 
Posts: 27
Joined: Tue Apr 21, 2020 1:10 pm

Re: Trading filter EA

Postby Rocco_Rod » Wed Nov 18, 2020 11:03 pm

Hello Apprentice, lets disregard this thread/request to focus on the "Trading zones - momentum strategy" one. They now both deal with the exact same matter.

Cheers
Rocco_Rod
 
Posts: 27
Joined: Tue Apr 21, 2020 1:10 pm


Return to Indicator and Signal Requests

Who is online

Users browsing this forum: Bing [Bot] and 43 guests