Close at Total Profit

 

hi,

i'm searching an expert for Mt5 that can close all the orders when a monetary total profit is reached.

some ideas?

thanks



 
cangoo77:

hi,

i'm searching an expert for Mt5 that can close all the orders when a monetary total profit is reached.

some ideas?

thanks

We are not allowed to suggest solutions in the forum, so you should make your own search in Codebase and the Market or post your request as a job in the Freelance section.

 
cangoo77: i'm searching an expert for Mt5 that can close all the orders when a monetary total profit is reached.

Won't work with sell orders.

You buy at the Ask and sell at the Bid. So for buy orders you pay the spread on open. For sell orders you pay the spread on close.
  1. Your buy order's TP/SL (or Sell Stop's/Sell Limit's entry) are triggered when the Bid reaches it. Not the Ask. Your SL is shorter by the spread and your TP would be longer. Don't you want the same/specified amount for either direction?
  2. Your sell order's TP/SL (or Buy Stop's/Buy Limit's entry) will be triggered when the Ask reaches it. To trigger at a specific Bid price, add the average spread.
              MODE_SPREAD (Paul) - MQL4 programming forum - Page 3 #25
  3. The charts show Bid prices only. Turn on the Ask line to see how big the spread is (Tools → Options (control+O) → charts → Show ask line.)
 
William Roeder:

Won't work with sell orders.

What a weird answer.

Of course it's possible it's even trivial.

if(Equity-Balance>=TriggerAmount)
  CloseAllOrders();
 
Eleni Anna Branou:

We are not allowed to suggest solutions in the forum, so you should make your own search in Codebase and the Market or post your request as a job in the Freelance section.

Really? Not allowed to help others? If so, then what is the purpose of this forum?
 
cangoo77 :

hi,

i'm searching an expert for Mt5 that can close all the orders when a monetary total profit is reached.

some ideas?

thanks



Code: Close Delete By Loss Or Profit . Attention: closes only those positions that were opened manually!

Principle of operation

The EA expects when the profit reaches the value of ' Target profit ' or when the loss reaches the value of ' Loss ' (both parameters are measured in money). The EA has the filter ' Only Manual ' - if the value is 'true' ONLY those positions will be closed and ONLY those pending orders that were placed manually (without the help of a script or expert advisor) will be deleted.

 
Alain Verleyen: What a weird answer. Of course it's possible it's even trivial.

I think you missed my point. OP wants to close at a total profit. If you close at that profit, you will not get that profit because you pay the spread on sell close.

 
William Roeder:

I think you missed my point. OP wants to close at a total profit. If you close at that profit, you will not get that profit because you pay the spread on sell close.

That's not exact, Equity and close price already takes into account the spread.

But I really don't want to argue.

Forum on trading, automated trading systems and testing trading strategies

The "opening" spread vs The "closing" spread

Alain Verleyen, 2019.12.10 17:04

No. Whatever how the chart is built, the mechanism you described in your previous post  is always right. Using mid prices, bid prices or any other price to show on the chart, is totally independent of how the spread take part to a trade.

People using a "mid price" platform think the bid is midprice-1/2 spread  and ask is midprice+1/2 spread (and so it's "paid" half at the open, half at he close) because they don't understand that this midprice is only an abstraction.

People using a "bid price" platform, like MT4 and MT5, think the ask price is bid price+spread, as if the spread was something existing by itself. It's not, the spread is the difference between the 2 real prices which are bid and ask. All of this is obscured by things like fixed spread offered by some market maker brokers or other spread manipulations. But we are talking here about the essence of a Forex market. The bid price is the best price offered by buyers at which you can sell, the ask price is the best price offered by sellers at which you can buy. That's the only 2 realities on a Forex market.

Beside that, using the word "pay" as in "the spread is paid at open" (or at close or in the middle of a trade, doesn't matter here) is misleading and confusing. The spread is not something paid in the usual sense, as I explained above it's the difference between bid and ask price and it influences directly your trade (It's completely different from paying a commission for example). Let's take a buy open at 1.1002 (ask), bid price is 1.1000 at that time, so the spread is 2 pips. You want to realize 5 pips profit so close at 1.1007, the price has to move 7 pips. Now, imagine the same trade but on an other broker you buy at 1.1002 (ask) but the bid price is 1.1001 for a spread of 1 pip. You still want to realize 5 pips profit, so close at 1.1007. The price has to move only by 6 pips this time. It's not that you "pay" 1 pip instead of 2 pips, it changes your trade because in the first case if the market moves only for 6 pips your trade will not reached 1.1007 and could eventually never reached it.

You are totally right saying the spread is taken into account at the opening, once a buy trade is open the only price which matters is the bid price because when you will want to close your trade you will need to sell, find a buyer and so the best bid price. Once a sell trade is open the only price which matters is the ask price because when you will want to close your trade you will need to buy, find a seller and so the best ask price.


 
Alain Verleyen:

What a weird answer.

Of course it's possible it's even trivial.

This is a very weird answer. I'm convinced that either Roeder's account was hacked or he has devolved into full on troll mode. Love him or hate him, at least his answers were never this inaccurate before recently. 

That's not exact, Equity and close price already takes into account the spread.

So does POSITION_PROFIT. After you add the commission, the only unknown variable is slippage.
 
cangoo77:

hi,

i'm searching an expert for Mt5 that can close all the orders when a monetary total profit is reached.

some ideas?

thanks



Please let me know what exactly you need becouse i've one some EA of the same kind
 
Alain Verleyen: That's not exact, Equity and close price already takes into account the spread.

Charts are bid prices, so I didn't think equity/profit would be based off OCP, but the bid. I stand corrected.

Reason: