MQL4 - automated forex trading   /  

Forum

Slippage?

Back to topics list To post a new topic, please log in or register

avatar
123
janklimo 2006.10.04 17:17 
The expert I entered for the contest is set to close all orders as soon as the profit is over 100 usd. However, it seems like there is a certain lag, so my orders are closed with much smaller profits, the last one was a loss :(. What could be the reason... slippage, server? My account: http://championship.mql4.com/2006/users/janklimo/

thanx
How to Make the Detection and Recovery of Errors in an Expert Advisor Code Easier

How to Make the Detection and Recovery of Errors in an Expert Advisor Code Easier

In Export Advisors development, the questions of code errors detection and recovery are very important. The peculiarity is that a not detected in time error may ruin a precious idea of a trading system already on the stage of its first testings. That is why any sensible EA developer takes into account such problems from the very beginning. This article dwells on some approaches, helping in this difficult matter.


avatar
97
Digger 2006.10.05 07:12 
Dear Jan

You may close the positions by Stop loss,Take profit or if some conditions will reach.
1) You have no Stop Loss.
2)TakeProfit=Profit in pips*Cost of pip*Contract size.
So,Order 4263828: 1000points*$10*2.5=$25000
3) Let's suppose that you have some block of closing positions in your code. Look at the journals. There are no messages about requotes
or invalid prices, whatever.
So,what's conclusion ? You have a bug(bugs),sorry. If you will share your code may be somebody help you.

Good luck with no more lag

avatar
123
janklimo 2006.10.05 13:55 

Thanks for your reply, digger. The logic is that whenever price moves, the total profit of all orders is calculated, I can't set fixed stop loss or take profit. If it is over $100, they are all closed. It works flawlessly at my personal computer, so I wonder what is the reason here.


avatar
97
Digger 2006.10.05 14:57 
janklimo wrote:

Thanks for your reply, digger. The logic is that whenever price moves, the total profit of all orders is calculated, I can't set fixed stop loss or take profit. If it is over $100, they are all closed. It works flawlessly at my personal computer, so I wonder what is the reason here.


In any case You have look the failures in terminal journal. If no-bugs. Try debug you code. There is new exellent debug feature in build 197-
visualization. It's really help me and I hope will usefull for you.

Regards 
Back to topics list  

To add comments, please log in or register