Attachments forums

List of attachments posted on this forum.


All files on forums: 135953

Re: MT4 Trading Utilities, Chart Tools & Add-ons

mades, Mon May 11, 2020 10:46 pm

Hi friends,

I accidentaly stumpled upon a thread on FF which is 3 years old and just 9 pages so totally hidden from the sight. In that thread, an EA (trade manager) was posted which uses the OrderCloseBy function instead of normal closing of the positions.

This function is a miracle for scalpers: It consolidates all the trades you have on the pair and you pay only 1 commission per 2 trades.

In the words of the guy who brought this to our attention and coded the trade manager:

"There's a neat little hidden gem in MT that's almost entirely undocumented and almost never used by developers (ever) that's called OrderCloseBy. What this function does is takes hedged orders and reconciles the transactions as netted. This allows you to do some neat things we'll talk about in a minute, but for now it's important to understand that if you use this method you are not charged double fees since you are instructing the broker server to reconcile the hedge as a netting transaction"


Im in a phase of testing it but it looks like it works. What is it good for?

A) You want to close multiple trades in one direction. If you do it manually one-by-one, slippage can occur very easily. With this function, you can open a counter(hedge) trade, which will effectively lock your profit and then close it all at once while not being charged multiple times.

B) You are a scalper and your system can produce multiple counter signals during a choppy day. You don't close&reverse the trades, but rather open a double sized counter position and wait until price starts moving in one direction and then close it while paying for only half of all your positions.

This function can be found in metatrader when you want to modify the position and in the window you can choose it from "type". I never used it before, never heard of it and it solves so many problems with costs when doing hedging/scalping.

Attached is the trademanager which was coded to demonstrate this functionality. Note, this is from 2017 (!).
All files in topic