#include <Peremen.mq4>// Terminal.mq4//=================================================================int Terminal(){//================================================== Predefinitions =ArrayCopy(Mas_Ord_Old, Mas_Ord_Tek);// Save the preceding historyArrayInitialize(Mas_Ord_Tek,0);// Zeroization of array of the current orders//================================================== ?????? ??????? =for(int i=0; i<OrdersTotal(); i++)// For all orders of the terminal{if(OrderSelect(i, SELECT_BY_POS)==true)// If there is a "living" order{//--------------------------------------- Symbol index definition -string Symb=OrderSymbol();// Determine the current order currencyfor(int ind=1; ind<=25; ind++)// Search in the array of symbols{if(Symb==Instrument[ind])// Index found, the search is completebreak;// Quit the loop by ind}//------------------------ Forming of the new array of orders ----
Mas_Ord_Tek[0][0][0]++;// Count the total amount of orders
Mas_Ord_Tek[ind][0][0]++;// Count the amount of orders for a symbolint k=Mas_Ord_Tek[ind][0][0];// Formal variable
Mas_Ord_Tek[ind][k][1]=NormalizeDouble(OrderOpenPrice(),Digits);// Order open rate
Mas_Ord_Tek[ind][k][2]=NormalizeDouble(OrderStopLoss(),Digits);// SL rate
Mas_Ord_Tek[ind][k][3]=NormalizeDouble(OrderTakeProfit(),Digits);// ?? rate
Mas_Ord_Tek[ind][k][4]=OrderTicket();// Order number
Mas_Ord_Tek[ind][k][5]=OrderLots();// Count of lots
Mas_Ord_Tek[ind][k][6]=OrderType();// Order type
Mas_Ord_Tek[ind][k][7]=OrderMagicNumber();// Magic number//-----------------------------------------------------------------}}//=================================================================return();}//=================================================================
and this is Peremen
// Peremen.mq4//===========================================================================//===========================================================================//===========================================================================double
Mas_Ord_Tek[7][31][8], Mas_Ord_Old[7][31][8];//The current and the new array of orders// the 1st index = symbol number// the 2nd index = order number ...// ... on the plane of the symbol// [][][0] not defined// [][][1] order open rate (absolute value of the rate)// [][][2] StopLoss orders (absolute value of the rate)// [][][3] TakeProfit orders (absolute value of the rate)// [][][4] order number // [][][5] lots of the order (absolute value of the rate)// [][][6] order type 1=B,2=S,3=BL,4=SL,5=BS,6=SS// [][][7] MagicNumber of the order//=================================================================string
Instrument[6]={"EURUSD","GBPUSD","USDJPY","EURGBP","USDCHF","EURCHF"};// Array of symbol names//=================================================================//////=================================================================int start(){return;}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hi, I have a problem with a function could someone help?
I have try to create these functions according to this
'Considering Orders in a Large Program'
and I have an error while compiling
"Wrong Parameters count"
and this is Peremen
many thanks for any help.....