# SYNERGY Trading Method - page 50

345

autumnleaves:
Good point Derk,

However, I think that PSAR should be used as one of at least 2 exit strategies, including one based on the oscillators (e.g. Stochastic and RSI fast reversing direction, but not yet crossing slow).

autumn

I could certainly add a PSAR trailing stop option. I have thought about adding it as a standard trail option for some time....

6

DerkWehler:
Hey Bryan: Is this for another Synergy EA that you have been developing? Or something unrelated? It doesn't sound too hard, but unfortunately, I have a bit much on my plate now to take on new things.

It would be for both. I am working on an EA and would like to try it on your Synergy EA as well. I undersand you are busy and wouldn't ask you to write it for me. I had hoped you already had such language written and stored in the archives, or could point me in the direction of someone who could help. Thanks for your time!

B

345

Eureka!

Regarding all the problems people have had with the EA: Closing orders too soon, failing to close, failing to move trailing stop, etc:

With the kind help of a programming associate, a couple of things have been discovered. First off, MT4 has bugs and cannot be trusted to do double comparisons with equality. Here is an example:

double d1, d2;

if (d1 < d2) // Works reliably

if (d1 > d2) // Works reliably

if (d1 <= d2) // FAILS (at times -when they are equal)

To get it working correctly, one has to convert to integers. In my example d1 & d2 contained prices, so we tried:

if ((d1 / Point) <= (d2 / Point))

This also failed when d1 and d2 were equal. In order to get it to work, we had to do:

if (NormalizeDouble((d1 / Point), 0) <= NormalizeDouble((d2 / Point), 0))

I have seen a bug like this more than a year ago, but hadn't realized the extent of it, or thought it Metaquotes had fixed it. So I will have to change a lot of code around to work around it. I think right now we are mostly seeing its effects in the trailing stop code.

Another matter we both saw at the same time on the same broker, was that the function IsConnected(), which checks if you are connected with your broker, failed. It was reporting false on FXDD, when in fact it was surely connected. The OrderReliable library uses this function to figure out how to approach getting the order sent.

REQUEST: Anyone who experiences problems with the EA; if it fails to open or close or modify orders, can you keep an eye on your experts tab and let me know if you see "not connected" errors being reported from the OrderReliable library? Do not bother if you use FXDD, we already know that has problems. I want to know if there are problem with other brokers or if it was somehow just FXDD.

Thank you and I'll let you know when there is a fix available.

-Derk

42

am back guys

hello everybody,

Am back to this our project. i've missed everybody....derk! missed you

345

Mike:

Welcome back; good to hear your around.

Everyone:

It is looking increasingly like most if not all problems with Synergy are related to MT4 bugs. I am devising workarounds now. I'll test them for a couple days, and if they seem to be working, I will make a new release.

-Derk

[Deleted]

CompassFX | SYNERGY Method

anyone have info & indicators on the advance methods?

733

DerkWehler:
Regarding all the problems people have had with the EA: Closing orders too soon, failing to close, failing to move trailing stop, etc:

With the kind help of a programming associate, a couple of things have been discovered. First off, MT4 has bugs and cannot be trusted to do double comparisons with equality. Here is an example:

double d1, d2;

if (d1 < d2) // Works reliably

if (d1 > d2) // Works reliably

if (d1 <= d2) // FAILS (at times -when they are equal)

To get it working correctly, one has to convert to integers. In my example d1 & d2 contained prices, so we tried:

if ((d1 / Point) <= (d2 / Point))

This also failed when d1 and d2 were equal. In order to get it to work, we had to do:

if (NormalizeDouble((d1 / Point), 0) <= NormalizeDouble((d2 / Point), 0))

I have seen a bug like this more than a year ago, but hadn't realized the extent of it, or thought it Metaquotes had fixed it. So I will have to change a lot of code around to work around it. I think right now we are mostly seeing its effects in the trailing stop code.

Another matter we both saw at the same time on the same broker, was that the function IsConnected(), which checks if you are connected with your broker, failed. It was reporting false on FXDD, when in fact it was surely connected. The OrderReliable library uses this function to figure out how to approach getting the order sent.

REQUEST: Anyone who experiences problems with the EA; if it fails to open or close or modify orders, can you keep an eye on your experts tab and let me know if you see "not connected" errors being reported from the OrderReliable library? Do not bother if you use FXDD, we already know that has problems. I want to know if there are problem with other brokers or if it was somehow just FXDD.

Thank you and I'll let you know when there is a fix available.

-Derk

THANK GOD SOMEONE ELSE HAS SEEN THIS!!!!

I've been kicked off of the MQL forums, under a different nik, for screaming about this for months. Metaquotes said I was full of it.

Now maybe if more coders out there can speak up on this, MAYBE, they'll listen.

Personally, if they would improve the DDE functionality to at least eaqual what Visual Trading Systems (Visual Trading Systems - Home of the VT Trader Forex Trading Platform - Visual Trading Systems, LLC) has, I'd write the damn thing in C# in Excel.

Thanks for listening everyone.

345

Indeed...

From all appearances, MetaQuotes doesn't give a rat's ass about any sort of customer service (i.e. responding to bug reports), whether it's us end users, or brokerages.

I have removed calls to IsConnected() from the OrderReliable library, hoping instead to depend on responding to actual errors if indeed it is not connected, because I am seeing this often.

Regarding the floating point comparisons, there is a function in stdlib.mq4, called CompareDoubles(), which does this:

if(NormalizeDouble(number1-number2,8)==0) return(true);

Following this example, I have created functions in MY standard library called dGTE(), dLTE() & dEQ(). Naturally, any "C" programmer has probably run into this "not equal by virtue of the Nth decimal place" phenomena, but it's just that when you fetch a bid or ask, you expect it to be of precision 4 (or 2), so comparing it with another precision-4 should not cause problems.

Using these new functions instead of direct compares seems to be working so far. MT4 is a not a robust product, and yes, one would hope they would be forever improving it. But their responses to all the people who complained about the "Recalculate" box disappearing after release 208, fairly proved their attitude.

As time passes, demand will provide for better solutions and the Metaquotes can either step up or die. Personally, the fact that the MT4 server is designedto be a market-making product, encouragingthe broker to screw the user, makes me look forward to moving on to something a little more professional.

Guess I rant too.

nondisclosure007:
THANK GOD SOMEONE ELSE HAS SEEN THIS!!!!

I've been kicked off of the MQL forums, under a different nik, for screaming about this for months. Metaquotes said I was full of it.

Now maybe if more coders out there can speak up on this, MAYBE, they'll listen.

Personally, if they would improve the DDE functionality to at least eaqual what Visual Trading Systems (Visual Trading Systems - Home of the VT Trader Forex Trading Platform - Visual Trading Systems, LLC) has, I'd write the damn thing in C# in Excel.

Thanks for listening everyone.
15

Hi Derk,

My exit setting is UseOppOrSmall on, but my open positions are not closed when the HA candle turns opposite colour. Attached are my set file and a screenshot of one of the trades. I am not sure if there is a problem with the EA or its my settings are not right. Can you take a look? Thanks.

Files:
345

Franco:

Unfortunately, the picture is too small for me to read. You can email it to me at derkwehler@gmail.com. And tell me what broker. Then maybe I can backtest that time and see what happened.

In the mean time, I will run some tests w/your .set file and see what I find. Your settings look fine (assuming you want them that way). For the time being, I have personally gone to disabling UseVolExpanding, but I assume you want that...

-Derk

EDIT: I have been testing it on mine (FXDD) and the option to close on opposite candle seems to work fine. However, I have made some changes, so I will be posting a new version soon.

francoc30:
Hi Derk, My exit setting is UseOppOrSmall on, but my open positions are not closed when the HA candle turns opposite colour. Attached are my set file and a screenshot of one of the trades. I am not sure if there is a problem with the EA or its my settings are not right. Can you take a look? Thanks.