Watch how to download trading robots for free
Find us on Twitter!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Views:
24712
Rating:
(11)
Published:
2008.05.31 08:53
Updated:
2016.03.29 13:14
EA_template.zip (7.48 KB)
Manual_EA.mq4 (2.57 KB) view
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

Revised template attached to article MetaEditor: Templates as a Spot to Stand On. The main idea of this revision was to avoid redundant size definitions of service arrays and dynamic changes of these arrays sizes. Service arrays are immediately allocated with the size of up to 100 orders, counters that indicate the array size are added,

int OurTicketsCounter;   // counter of "friendly" orders, it specifies the limitation for arrays Tickets[100][9],CommentsTicket[100][2]
int SL_TP_Counter;       // counter of orders to be modified: for array newSL_and_TP[100][5]
int OrdersToCloseCounter;// counter of orders to be closed: for arrays ticketsToClose[100][2] and lotsToClose[100] 
int OrdersToDeleteCounter;// counter of orders to be closed: for arrays ticketsToDelete[100]

that are initialized with zero value at each launch of the function start() in the separate special function InitCounters():

//+------------------------------------------------------------------+
//| reset all counters of service arrays                             |
//+------------------------------------------------------------------+
void InitCounters()
   {
//----
   OurTicketsCounter = 0;
   SL_TP_Counter = 0;
   OrdersToCloseCounter = 0;
   OrdersToDeleteCounter = 0;
//----
   return;   
   }


Modifications result in that the EA created using the template loses out only two times to a specially designed EA written fully manually. I would consider this result more than acceptable.

Store it in the folder 'experts/templates'.


Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/8159

ReConnecter - A Script for Periodical Reconnections ReConnecter - A Script for Periodical Reconnections

The script should solve the "fading charts" problem - the situation when the charts stop being updated while the connection to the server remains ok

LinearRegSlope_v1 LinearRegSlope_v1

Indicator LinearRegSlope_v1.

up3x1 Krohabor D up3x1 Krohabor D

EA up3x1 of the Krohabor_D series with a universal technology of "win-win" trading.

Currency Loader Currency Loader

The EA unloads historical data in the *.csv format for several timeframes of the symbol it is attached to.