Has any programmers seen this problem, and knows of the solution

 

I have had an EA written for me by someone in Freelance. However, although it partly works, but doesn't work as it should.

The problem is that at the bottom of a chart( start of a bullish trend) I wanted to enter a BUY trade, and vice versa.

However, the EA enters a SELL trade, and a BUY trade at the top.

All trades are closed by trailing stops.

The EA does NOT use any Indicators of any description.

The person that wrote my EA doesn't know the solution. As a retired Analyst/Programmer with 40+ years of experience, even my contacts can't help.

So I was hoping that someone may be able to help me out of this hole I am in. If you don't know, can you suggest what I can do, or who I can contact ?

I have attached a screenshot of what is happening at the present, and the coding will be made available. On the screenshot, the red arrows should be at the top, and the blue ones at the bottom.

Files:
XAUUSDM1-1.png  47 kb
 
grahambl:

I have had an EA written for me by someone in Freelance. However, although it partly works, but doesn't work as it should.

The problem is that at the bottom of a chart( start of a bullish trend) I wanted to enter a BUY trade, and vice versa.

However, the EA enters a SELL trade, and a BUY trade at the top.

All trades are closed by trailing stops.

The EA does NOT use any Indicators of any description.

The person that wrote my EA doesn't know the solution. As a retired Analyst/Programmer with 40+ years of experience, even my contacts can't help.

So I was hoping that someone may be able to help me out of this hole I am in. If you don't know, can you suggest what I can do, or who I can contact ?

I have attached a screenshot of what is happening at the present, and the coding will be made available. On the screenshot, the red arrows should be at the top, and the blue ones at the bottom.

It will be down to the conditions that have been set and/or the way they have been programmed. So you should go back to the programmer and go through it in detail

 
You can ask him to just reverse the order logic then a buy will become a sell and a sell will become a buy but it will not make it perform any better.
 
Paul Anscombe:

It will be down to the conditions that have been set and/or the way they have been programmed. So you should go back to the programmer and go through it in detail

Hello Paul,

Have you had this problem in the past, or is your solution just an educated assumption.


Graham Blake

 
Marco vd Heijden:
You can ask him to just reverse the order logic then a buy will become a sell and a sell will become a buy but it will not make it perform any better.

Hello Marco,

I did change it round, but it didn't solve the problem.


Graham Blake

 

You're trading on M1.

Turn on the ask line and check the spread.

Buy orders are executed on ask price, sell on bid. High spread and short candles can make it look like this.

But, it still can be some bug in the code.

 
grahambl:

Hello Paul,

Have you had this problem in the past, or is your solution just an educated assumption.


Graham Blake

Hi Graham,

It is the logical conclusion, the chances of there being a bug in MT4 that is swapping just your positions around is practically non-existent because many others would be shouting. The reality is that either the code is bugged, or the rules that have been coded are either wrong or not taking into account real life variables like spread etc.

The programmer should be able to use the debugger to see what the variables are at the point of entry/exit and other key steps in the program. You can compare that to your expectations and see the difference. It should be a standard part of testing a piece of code, ie: checking a few sets of data for behavior through the program.

regards

Reason: