MT4 grid Trading Strategy source code [MT4 formula]

The following is the source code of a grid transaction method that I saw on the Internet. I hope more people will post some source code of grid transaction method. We can learn and improve it together.
//+------------------------------------------------------------------+
//| Grid1.1.mq4 |
//|Copy * 2006|
//| |
//+------------------------------------------------------------------+
#2006 collection and arrangement of Foreign Exchange Union
#property link " service@fxunion.com "
#include < stdlib.mqh >
External double gridstep = 50; / / grid size
External double gridlength = 100; / / grid length
double PivotPr, Multiple, i, Lots=0.1, STOPLEVEL, TP, ST;
tring Text="Grid";
int Magic, j, BuyCount, SellCount, DTS, Ticket;
//+------------------------------------------------------------------+
Int init() / / the initialization part will define parameter assignment: it may be assigned once every time in start, which consumes time
For the complete source code, please refer to:Grid Trading Strategy source code