View Single Post
  #23 (permalink)  
Old 06-23-2007, 02:54 AM
Neo Neo is offline
Junior Member
 
Join Date: Jun 2006
Posts: 22
Neo is on a distinguished road
Okay.... found a few things that needed attention and tidied up the source a little in the process.

Main things were:

1) removed a couple of redundant variables
2) added RefreshRates() at appropriate points

In CheckForBuy() & CheckForSell():

1) added a check for zero lot sizes
2) commented out the "for loops" around the calls to OrderSend() as I couldn't see what they achieved

In Start():

1) added checks for HighestBuyTicket, LowestBuyTicket, HighestSellTicket & LowestSellTicket being zero before trying to select/close the distant order


I've run a quick test from Sept 06 to June 07 and no errors are now being reported either for opening or closing orders. In the test, as a batch of SELLs was closed at a profit, the most losing BUY was also closed and vice-versa.

Obviously, some more checking would be good, just in case I've missed something but the updated source is here.....
Attached Files
File Type: mq4 PipMakerv3a.mq4 (19.5 KB, 340 views)
Reply With Quote