I am a bit confused du to the behaviour of scripts in b 3476:
My little script which is started on a H1 timeframe but deals with M! and an indicator (MACD) in H1 tries to get the data of the MACD as of 2019 (on a MQ demo acct).
First the times are set
void OnStart() { //--- datetime start = D'2019.09.21 00:00:00'; int iB = iBarShift(_Symbol,PERIOD_M1,start,false), iAll = Bars( _Symbol,PERIOD_M1); // datetime tNull = iTime(_Symbol,PERIOD_M1,0), tAll = iTime(_Symbol,PERIOD_M1,iAll), tChck = iTime(_Symbol,PERIOD_M1,iB); Print("tCheck[",iB,"] ",TimeToString(tChck,TIME_DATE|TIME_MINUTES)," tNull[0] ",TimeToString(tNull)," tAll[",iAll,"] ",TimeToString(tAll));
This prints out:
(USDJPY,H1) tCheck[500596] 1970.01.01 00:00 tNull[0] 2022.10.27 21:39 tAll[500597] 1970.01.01 00:00
I learned and expected that at 0 I can find the oldest value.
Anyway I start the loop at iB=500597 down to 0:
int hMacd = iCustom(_Symbol,PERIOD_H1,"Examples\\MACD"); // get the handle of the MACD double Macd0[],Macd1[],Macd2[],Macd3[]; for(iB=500597;iB>0;iB--) { datetime tC = iTime(_Symbol,PERIOD_M1,iB); // get the actual time of iB int nCopy = CopyBuffer(hMacd,0,tC,5,Macd0); // get the values of the MACD if (nCopy<3) continue; // if there weren't enough values: next iB nCopy = CopyBuffer(hMacd,1,tC,5,Macd0); // get the values of the MACD if (nCopy<3) continue; // if there weren't enough values: next iB nCopy = CopyBuffer(hMacd,2,tC,5,Macd0); // get the values of the MACD if (nCopy<3) continue; // if there weren't enough values: next iB nCopy = CopyBuffer(hMacd,3,tC,5,Macd0); // get the values of the MACD if (nCopy<3) continue; // if there weren't enough values: next iB Print("first indicator values at [",iB,"] ",TimeToString(tC,TIME_DATE|TIME_MINUTES) ); return;
And what do I get:
- WHY first values of the MACD only as of 2021?
- WHY the circle of time => iB => time fails?
- WHY is the direction of the iTime and iBarShift are just the other way around?
Here is this little script that spoiled my day.
Please tell me if I am missing anything.

- www.mql5.com
I guess users will just have to fall back on using the older SendMail() instead for now until web push notifications are implemented by MetaQuotes.
Is there any chance that the web terminal could be built inside some type of desktop app, using electron or something?
Also is there any chance to create custom indicators and expert advisors in JavaScript for the web terminal?
Why? There is already a MetaTrader desktop application, which has custom indicators, EAs, etc.
TradingView is a web based trading platform, yet they didn't go the JavaScript route. In fact, I don't know of any popular trading platform that uses JavaScript for algorithmic trading. Do you know of any?
TradingView is a web based trading platform, yet they didn't go the JavaScript route. In fact, I don't know of any popular trading platform that uses JavaScript for algorithmic trading. Do you know of any?
TradingView is no good for some brokers because you can't write to the broker's API if it's not supported by TradingView. Also it's a subscription software when MT5 does the same thing for free.
A Web trader is built on JavaScript, it requires JavaScript to be web based. It wouldn't be too difficult to export some of the libraries to JavaScript for a web based app.
I'm well aware of how a web application is coded, I made my living doing just that for many years.
That was however not my question. My question was — do you know of any popular platform that offers a JavaScript API for algorithmic trading?
I'm well aware of how a web application is coded, I made my living doing just that for many years.
That was however not my question. My question was — do you know of any popular platform that offers a JavaScript API for algorithmic trading?
That's why I asked if the idea was considered to be implemented. JavaScript is native to the browser and doesn't even need to be compiled or decoded by the platform. Obviously the functions used by indicators already exist or the native indicators wouldn't work. They simply need to expose the API to the browser, the browser takes care of the rest.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
The MetaTrader 5 platform update will be released on Friday, November 4, 2022.
The update introduces the new Web Terminal with full support for mobile devices. Now its interface automatically adapts to the user screen size.
In addition, we have improved the task manager for a more accurate monitoring of consumed resources and have added the OpenCL tab for managing available devices. The new OpenCL manager enables explicit specification of devices to be used for faster calculations.
We continue to expand platform capabilities in working with matrices and vectors. MQL5 features new functions for operations with price ticks and for data exchange between matrices and vectors. It also provides expanded assignment methods.
In addition, we have implemented multiple fixes and improvements in all platform components. All new features, fixes and performance improvements are described in detail below.
Mobile version of the web platform
The new Web Terminal provides full-featured support for mobile devices. The interface will automatically adapt to the screen size, enabling efficient operations from iOS and Android phones and tablets:
Also, the Web Terminal features a lot of fixes and improvements.
The new MetaTrader 5 Web Terminal supports the full set of trading functions. It enables users to:
MetaTrader 5 Client Terminal build 3490
According to the FIFO rule, positions for each instrument can only be closed in the same order in which they were opened. To ensure FIFO-compliant position closing by stop levels, the following logic has been implemented on the client terminal side:
If multiple positions exist for the same instrument, the placing of stop levels for any of the positions causes the same levels to be placed for all other positions as well. Accordingly, if a level triggers, all positions will be closed in a FIFO-compliant order.
Now, when the user opens the Depth of Market for an instrument which already has open positions for, the levels of existing positions (if any) are automatically specified in the Stop Loss and Take Profit fields.
The copied data type is specified in the 'flags' parameter using the ENUM_COPY_TICKS enumeration. The following values are available:
If multiple data types are selected (only available for matrices), the order of the rows in the matrix will correspond to the order of values in the enumeration.
Now the matrix can be assigned a one-dimensional array or vector:
The result will be a one-row matrix.
Also, a matrix can now be assigned to a vector (matrix smoothing will be performed):
Each array, vector or matrix refers to a memory buffer which contains the elements of that object. The Swap method actually swaps pointers to these buffers without writing the elements to memory. Therefore, a matrix remains a matrix, and a vector remains a vector. Swapping a matrix and a vector will result in a one-row matrix with vector elements and a vector with matrix elements in a flat representation (see the Flat method).
The Swap() method also enables operations with dynamic arrays (fixed-sized arrays cannot be passed as parameters). The array can be of any dimension but of an agreed size, which means that the total size of a matrix or vector must be a multiple of the array's zero dimension. The array's zero dimension is the number of elements contained at the first index. For example, for a dynamic three-dimensional array 'double array[][2][3]', the zero dimension is the product of the second and third dimension sizes: 2x3=6. So, such an array can only be used in the Swap method with matrices and vectors whose total size is a multiple of 6: 6, 12, 18, 24, etc.
Consider the following example:
The update will be available through the Live Update system.