View Single Post
  #149 (permalink)  
Old 06-10-2008, 07:28 AM
amenlo9's Avatar
amenlo9 amenlo9 is offline
Senior Member
 
Join Date: Apr 2006
Location: Malaysia
Posts: 187
amenlo9 is on a distinguished road
Help to Remove Notify Message inside the script

Quote:
//+------------------------------------------------------------------+
//| close.mq4 |
//| Copyright ? 2004, MetaQuotes Software Corp. |
//| Forex Trading Software: Forex Trading Platform MetaTrader 4 |
//+------------------------------------------------------------------+
#property copyright "Copyright ? 2004, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net/"
#property show_confirm

//+------------------------------------------------------------------+
//| script "close first market order if it is first in the list" |
//+------------------------------------------------------------------+
int start()
{

int total = OrdersTotal();
for(int i=total-1;i>=0;i--)
{
OrderSelect(i, SELECT_BY_POS);
int type = OrderType();

bool result = false;

switch(type)
{
//Close opened long positions
case OP_BUY : result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 5, Red );
break;

//Close opened short positions
case OP_SELL : result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 5, Red );

}

if(result == false)
{
// Alert("Order " , OrderTicket() , " failed to close. Error:" , GetLastError() );
if(!IsTesting( ) )
Sleep(0);
}
}

return(0);
}
I want to remove notify message prompt out when i apply this script,may i know how?
__________________
~~Keep The Faith~~
Reply With Quote