IDT_more_profit





//+------------------------------------------------------------------+
//|                       IDT_more_profit.mq4                          |
//|                      Copyright © 2004, Globus                    |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, Globus"

#include <stdlib.mqh>
#include <WinUser32.mqh>

#define SLIPPAGE  1   // value of slippage
#define MORE 2   // more pips in profit ticket

//+------------------------------------------------------------------+
//| script "intraday trading - take more profit from tageting tickets"                            |
//+------------------------------------------------------------------+
int start()
  {
  int ticket;
  PlaySound("Tick.wav");
  double sum=OrdersTotal();
  double change=0;
  Print ("Count of ticket ",sum);
 
  while (sum>0)
    {
    OrderSelect(sum-1,SELECT_BY_POS);
    Print ("Ticket : ",OrderTicket(), "  Profit :" ,OrderProfit(), "  Order type :", OrderType());
    RefreshRates();
      if (OrderProfit()>0)
      {
        if (OrderType ()==0)
         {
          ticket=OrderModify( OrderTicket(), 0, OrderStopLoss( ), OrderTakeProfit( ) + MORE*Point ,0,CLR_NONE);
         }
         if (OrderType ()==1)
         {
          ticket=OrderModify( OrderTicket(), 0, OrderStopLoss( ), OrderTakeProfit( ) - MORE*Point ,0,CLR_NONE);
         }
        change++;    
       }
 
     sum--;
    
    }
      
  Print ("Count of changes ",change);
  
  Print("ticket : ",ticket); 
  if(ticket>1 && ticket<150)
     {
      int error=GetLastError();
      Print("Error = ",ErrorDescription(error));
      PlaySound("alert2.wav");
     }
  else PlaySound("Ok.wav");      
  return(0);   
  }
//+------------------------------------------------------------------+



Sample





Analysis



Market Information Used:



Indicator Curves created:


Indicators Used:



Custom Indicators Used:

Order Management characteristics:
Checks for the total of open orders

It can change open orders parameters, due to possible stepping strategy

Other Features:

It plays sound alerts