IDT_more_profit

Download script
Author: Copyright � 2007, Globus
IDT_more_profit

This tool is designed for active traders who want to automatically extend their winning positions to capture more market movement. It functions as a "profit booster" that scans your open trades and adjusts your exit targets on the fly.

How it Works

When you run this script, it performs a comprehensive sweep of all currently active trades in your account. It looks specifically for positions that are already in a profitable state (where the current price is moving in your favor).

The Logic Flow

Once the script identifies a profitable trade, it applies specific logic based on whether you are "Buying" or "Selling":

  • For Buy Positions: If a trade is currently in profit, the script automatically moves your Take Profit target higher. It adds a predefined amount of extra movement (the "more" value) to your current target, allowing you to ride the upward trend longer.
  • For Sell Positions: Conversely, if a sell trade is in profit, the script moves your Take Profit target lower. It subtracts that same amount of extra movement from your target to ensure you capture more of the downward move.

User Experience

The script is designed to be automated and communicative:

  • Feedback: It provides real-time status updates in the background logs, showing you exactly which tickets it is checking and how much profit they are currently generating.
  • Audio Notifications: To keep you informed without needing to watch the screen constantly, the script plays different sounds based on the outcome. It will play a confirmation sound if the adjustments are successful and an alert sound if it encounters any issues with a specific trade.

In simple terms, this is a "set and forget" utility that helps you stay in winning trades a bit longer to maximize your gains without having to manually move every single price target as the market fluctuates.

Orders Execution
Checks for the total of open ordersIt can change open orders parameters, due to possible stepping strategy
Miscellaneous
It plays sound alerts
2 Views
0 Downloads
0 Favorites
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);   
  }
//+------------------------------------------------------------------+

Comments