Rating: Empty Star Empty Star Empty Star Empty Star Empty Star
Total different performance of exactly same EA on different brokers.
Previous 1 2 3 Next
pc8multifx

Member Since Sep 04, 2009  786 posts pc8multifx (pc8multifx) Jul 28 2010 at 10:23 (edited Jul 28 2010 at 10:24 )
salmas64 posted:
    Thanks for ideas. Hmm.... it seems to the world of MT4 is less ideal that I thought confused

My EA works on idea of martingale system, but if case of larger movement of the market it opens hedges for some trades to protect equity. EA calculates combined profit for all opened BUY and SELL positions and if reaches 'Target combined $ profit' or 'Target Stop loss $ profit' closes all trades immediately with minimal slippage as possible.

EA calculates profit for each trade the way ( OrderProfit()+OrderSwap() ) so I believe this should be independent from broker's feeds. And big differences on balance I'm getting after closing those trades on some broker getting negative trend. sad]

Example: EA has open 30 trades (buys and sells) of size 0.01 lot and current combined profit is +$20.00.

After closing all 30 trades getting differences on closed trades:
Broker 1 = +$18.30
Broker 2 = +$17.80
Broker 3 = +$12.20
Broker 4 = -$2.20

I don't think that this is caused by slippage and different spread. That would be too high and I think EA calculates somehow differently on each broker the 'Combined profit' or is idea of combining trades bad way of trading? This is still on demo accounts, now I can imagine how it would be worse on real accounts.

Actually I'm not sure what is the real unit for OrderProfit() is it in traded currency, deposit currency or broker currency? See attached definition from MQL4 help, it's not quite clear to me.







Its order execution delay and slippage what causes the differences. Check it in the journal. One of the reasons can be the broker latency.

Minds are like parachutes... they work best when open!
salmas64

Member Since May 26, 2010  5 posts Slavo (salmas64) Jul 28 2010 at 10:30
Thanks Kenny.

Closing 30 trades takes about 1-5 seconds, it seems to me pretty fast. Maximum within 1-3 ticks, that's why I think can't be caused by spread sad]

Minimal slippage I managed to do via recursive loop with increasing slippage value.

In other words:
         EA tries to close trade with slippage 0. if fails
                          tries again with slippage 1. if fails
                          tries again with slippage 2. if fails
                          tries again with slippage 3. if fails
                          .........
                          until trade is closed successfully.

I know how to use indicators ( on my car ) ...... So far so good!
stevetrade

Member Since Oct 28, 2009  1036 posts Steve Boardman (stevetrade) Jul 28 2010 at 10:34 (edited Jul 28 2010 at 10:37 )
Not sure why you are doing it this way. Provided you have an honest broker submit it with a maximum slippage and if it can't close with no slippage then it will close with slippage.

In fact thinking about it further at the point you submit the request to close with zero slippage they might not be able to close at zero slippage.
When you then submit your request to close with 1 pip slippage they might actually be able to close with zero slippage etc.

Whenever I code EA's I always try and strip out any code that is not absolutely necessary. The more code you put in there the more there is to go wrong and to hold things up.

11:15, restate my assumptions: 1. Mathematics is the language of nature. 2. Everything around us can be represented and understood through numbers. 3. If you graph these numbers, patterns emerge. Therefore: There are patterns everywhere in nature.
compuforexpamm

Member Since Aug 20, 2009  181 posts kennyhubbard (compuforexpamm) Jul 28 2010 at 10:47 (edited Jul 28 2010 at 10:47 )
Slavo,

I'm inclined to agree with Steve. Slippage is a parameter that you can use to give yourself a choice of accepting a fill or not. Once you have decided to close a string of orders, you are actually committed to accepting whatever fill you get by your strategy...............changing the slippage does not improve the fill that you receive.

A normal broker will not look at your slippage before 'getting' you a price. They will find you a price and then they will look at the slippage parameter to determine whether to accept or to re-quote.

You should also tell me which broker you are with, as to be quite honest, 1 - 5 seconds to close 30 trades seems beyond belief. I would be interested to see that close routine. Do you use OrderCloseBy()?

Wealth Creation Through Technology
Elkart

Member Since Aug 01, 2009  941 posts Elkart (Elkart) Jul 28 2010 at 10:52
Kenny,

I can't get over a transaction a second. Mostly because all the crap we had to write in to double check everything's happening as it should. Mt4 not the best piece of software around.

Have to write all the issues out and that takes time to check.

Chang beer is evil.
Elkart

Member Since Aug 01, 2009  941 posts Elkart (Elkart) Jul 28 2010 at 10:56
Saying that, I did do 5000 trades yesterday in an hour. So I guess I shouldn't complain to much.

Chang beer is evil.
Elkart

Member Since Aug 01, 2009  941 posts Elkart (Elkart) Jul 28 2010 at 11:06
Not that I wanted to mind you. Fat fingers, but old MT put it out there and Go markets took it without as much as a squeal...

Chang beer is evil.
compuforexpamm

Member Since Aug 20, 2009  181 posts kennyhubbard (compuforexpamm) Jul 28 2010 at 11:59 (edited Jul 28 2010 at 12:02 )
Actually just been running some tests. I have been eyeing out this OrderCloseBy() function for a while.

I don't do hedge Grid trading, but for those that are interested, here is some good ideas to pass on to your programmers....

There are 3 scripts attached to this post. Use the Open_Hedge_Trade script to open 30 trades on your demo account......make sure it is a big account cos it open 1 full lot per trade.

Run the Close_All script and note the time in the experts tab. Then Open the 30 trades again and run the Quick_Close script. Note the time in the experts tab. You will see the Quick_Close script closes all the trades about 50% - 100% quicker than the regular close script.

How does this work you ask? When a broker closes your trade he actually has to enter a trade for you in the opposite direction and this matching off take time. By using this OrderCLoseBy() function, you are telling the broker that there is a matching trade within your own account that you wish to close. This means that broker does not have to find a trading partner for you plus it kills 2 trades with 1 instruction.

Another benefit I can see here is that you would have no naked exposure in the market while you are closing one side of the hedge.

BTW, my times from my VPS were 6594 ms for the normal way and 4391 ms with the quick close. Also note the scripts are rough and dirty so there is no error handling and so on, they were just intended for demonstration purposes.

Wealth Creation Through Technology
stevetrade

Member Since Oct 28, 2009  1036 posts Steve Boardman (stevetrade) Jul 28 2010 at 12:08
Excellent work Kenny and well worth knowing

11:15, restate my assumptions: 1. Mathematics is the language of nature. 2. Everything around us can be represented and understood through numbers. 3. If you graph these numbers, patterns emerge. Therefore: There are patterns everywhere in nature.
salmas64

Member Since May 26, 2010  5 posts Slavo (salmas64) Jul 28 2010 at 15:34 (edited Jul 28 2010 at 15:35 )
Thanks Kenny that's very useful information. Honestly I don't understand mechanics what's happening on broker's side. Why he has to enter opposite trade when I'm closing trade? I thought broker is passing and leveraging my trade somewhere 'farther away' smiley. Does it work other way as well? What broker does when I'm entering new trade? Has he closes his existing trade in opposite direction?

I really didn't notice OrderCloseBy() function. smiley Thanks for the examples, so far I used in closing routine similar way like in your Close_All script.
In my case I have mixed bag of BUYs and SELLs, but not always equal ratio, but I can use OrderCloseBy() for pairs and OrderClose() for leftovers.


I know how to use indicators ( on my car ) ...... So far so good!
Previous 1 2 3 Next
Tools Community Reviews Platform Company Support
Economic Calendar Community Brokers Features About FAQ
Forex Broker Spreads New Systems Expert Advisors API Blog Help
Streaming Forex News Strategies Signal Providers Translations Twitter Contact Us
Community Outlook Contests VPS Services Mobile Facebook Report A Bug!
Widgets EA Programming        
RSS          

Site Map  |   Terms & Conditions  |   Privacy Policy
©2011 Myfxbook Ltd. All Rights Reserved.
HIGH RISK WARNING: Foreign exchange trading carries a high level of risk that may not be suitable for all investors. Leverage creates additional risk and loss exposure. Before you decide to trade foreign exchange, carefully consider your investment objectives, experience level, and risk tolerance. You could lose some or all of your initial investment; do not invest money that you cannot afford to lose. Educate yourself on the risks associated with foreign exchange trading, and seek advice from an independent financial or tax advisor if you have any questions. Any data and information is provided 'as is' solely for informational purposes, and is not intended for trading purposes or advice.
*GFT is a sponsor of myfxbook.com for advertisement purposes only. GFT does not endorse any other products, services, or companies represented on myfxbook.com. The views of myfxbook.com and all other parties contained therein are not necessarily those of GFT, and GFT makes no warranty as to the accuracy of information provided.