View Single Post
  #10 (permalink)  
Old 06-17-2007, 08:33 PM
don_forex's Avatar
don_forex don_forex is offline
Member
 
Join Date: Oct 2005
Posts: 67
don_forex is on a distinguished road
I think it is now fixed!

I looked at the code a little closer. When the positive orders are closed the lowest and highest variables are reset. The losing order's ticket number is reset. For example...

CloseBuysinProfit();
OrderSelect(HighestSellTicket, SELECT_BY_TICKET);
OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 5, Red);
LowestBuy=1000; HighestBuy=0;
HighestSellTicket=0;

It closed the buys in profit, LowestBuy and HighestBuy are reset. The HighestSell was closed and it was reset. That is the way it should be. There were inconsistencies with some of the combinations. I have now corrected them.

@ wolfe

You will always have orders that are open and at a loss. Nothing gets closed out until profit is made. That is why it is imperative that optimizations are done!

Then fixed version will be placed on post #1

Don
Reply With Quote