PipsingV2_Setup
Download scriptThis script is designed to streamline and automate the process of placing trades within the MetaTrader platform, specifically aimed at assisting traders who prefer manual execution but want to eliminate the repetitive task of entering precise order details. It acts as a "setup" tool that handles the heavy lifting of technical data entry.
Core Functionality
The primary purpose of this tool is to manage how trade orders are sent to the market. It offers two distinct methods for executing these trades, allowing the user to choose the level of automation they prefer:
- Standard Execution: The script sends a complete trade order instantly with all specified parameters (such as volume, profit targets, and stop-loss limits) included in a single action.
- Two-Step Execution: For environments where immediate placement might be restricted or where a specific sequence is required, the script can operate in two stages. First, it places a "blank" order without any profit targets or stop-loss limits. Once that order is live, it automatically modifies that existing trade to add the specified targets and limits.
Key Features & Management
- User-Defined Parameters: The tool allows you to pre-set essential trading variables, including:
- Lot Size: The volume of the trade.
- Slippage: The allowed tolerance for price variation.
- Profit Targets (TP) and Stop-Loss Limits (SL): Specific goals for both Buy and Sell positions.
- Repetitions: How many times an action should be performed.
- System Synchronization: The script includes a verification system that checks if your current settings are properly saved in the system's memory. If it detects that any of your parameters have not been correctly registered, it will alert you with a clear notification.
- Visual Dashboard: To keep the trader informed, the script creates an on-screen text display. This dynamic label shows your current active settings (Lot size, Slippage, Repetitions, and various TP/SL values) directly on the trading chart. It is designed to move automatically with the price action so that it remains visible regardless of where you scroll on the chart.
Summary for the User
Essentially, this tool removes the manual "typing" work from your trading routine. By defining your rules once in the script settings, you ensure that every trade is executed consistently. It bridges the gap between manual trading and fully automated bots by giving you the control to decide when to trade, while the script handles the how of the technical execution.
//+------------------------------------------------------------------+
//| Pipsing_Setup_V1.mq4 |
//| Copyright © 2008, AP |
//| Aleksandr Pak, Alma-Ata ekr-ap@mail.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, AP"
#property link "ekr-ap@mail.ru"
#property show_inputs
//----
#include <WinUser32.mqh>
//Êîìïëåêò èç òðåõ ñêðèïòîâ äëÿ àâòîìàòèçàöèè ðó÷íîé òîðãîâëè.
//Âåðñèÿ 2 => ïî êîììåíòàðèþ "stace" äîáàâëåí ðåæìèì.
//Îòñûëêà îðäåðà ïî îäíîé ç äâóõ ñõåì
//1. âàðèàíò ôëàã Two_Slash=0 - îòñûëêà ïîëíîãî îðäåðà.
//2. âàðèàíò Two_Slash=1 - îòñûëêà â äâà ýòàïà:
// - ñíà÷àëà îðäåð ñ tp/sl=0, çàòåì ìîäèôèêàöèÿ +tp +sl
//òàêæå èñïðàâëåíû íåóäîñòâà ñ òåêñòîâîé ñòðîêîé, - ïîëîæåíèå, óáðàíà t çàäåðæêà,
//èçìåíåíû èìåíà ãëîáàëüíûõ ïåðåìåííûõ, ÷òîáû áûëè â îäíî ìåñòå => Ñåðâèñ/Ãëîáàëüíûå ïåðåìåííûå
//Íàïîìèíàíèå: âàðèàíòû ïàðàìåòðîâ Setup óäîáíî õðàíèòü â ôàéëàõ, ïîëüçóéòåñü => ñîõðàíèòü/çàãðóçèòü
extern double Lot=0.1;
extern int Slippage=3;
extern int Repetitions=1;
extern int Buy_tp=10;
extern int Buy_sl=40;
extern int Sell_tp=10;
extern int Sell_sl=40;
extern double Blank_buy=0;
extern double Blank_sell=0;
extern double Two_slash=0;
int start()
{ string r="error from"; string ex; double y_pipsown; int i;
if(GlobalVariableSet("P_Lot",Lot)==0) r=r+"1 ";
if(GlobalVariableSet("P_Slippage",Slippage)==0) r=r+"2 ";
if(GlobalVariableSet("P_Repetitions",Repetitions)==0) r=r+"3 ";
if(GlobalVariableSet("P_Buy_tp",Buy_tp)==0) r=r+"4 ";
if(GlobalVariableSet("P_Buy_sl",Buy_sl)==0) r=r+"5 ";
if(GlobalVariableSet("P_Sell_tp",Sell_tp)==0) r=r+"6 ";
if(GlobalVariableSet("P_Sell_sl",Sell_sl)==0) r=r+"7 ";
if(GlobalVariableSet("P_Blank_buy",Blank_buy)==0) r=r+"8 ";
if(GlobalVariableSet("P_Blank_sell",Blank_sell)==0) r=r+"9 ";
if(GlobalVariableSet("P_Two_slash",Two_slash)==0) r=r+"10 ";
if(StringLen(r)>10) {MessageBox(r,"",MB_OK|MB_ICONERROR); }
else
{
ex="PiPsing= "+DoubleToStr(Lot,1)+" "+DoubleToStr(Slippage,0)+" "+DoubleToStr(Repetitions,0)+
" "+DoubleToStr(Buy_tp,0)+" "+DoubleToStr(Buy_sl,0)+
" "+DoubleToStr(Sell_tp,0)+" "+DoubleToStr(Sell_sl,0)+
" "+DoubleToStr(Blank_buy,0)+" "+DoubleToStr(Blank_sell,0)+" "+DoubleToStr(Two_slash,0);
i=0.3*WindowBarsPerChart(); //place for text
y_pipsown=0.95*(WindowPriceMax(0)-WindowPriceMin(0))+WindowPriceMin(0);
if(ObjectFind("PipsOwn2")==-1)
{ObjectCreate("PipsOwn2",OBJ_TEXT,0,iTime(NULL,0,i),y_pipsown);
ObjectSetText("PipsOwn2", ex , 9,"",White);
}
else
{
ObjectSetText("PipsOwn2", ex , 9,"",White);
if ( iBarShift ( NULL,0,ObjectGet ( "PipsOwn2",OBJPROP_TIME1),FALSE )>0.5*WindowBarsPerChart())
ObjectSet("PipsOwn2",OBJPROP_TIME1,iTime(NULL,0,i)); //åñëè çà êðàé ýêðàíà
}
}
WindowRedraw();
return(0);
}
//+------------------------------------------------------------------+
Comments