Realtime Indicators in MetaTrader - Possible?

Not to get the cart too far ahead of the horse, I wonder if anyone might happen to know of any place where one could search for any realtime data support for MetaTrader MQL?

I’ve begun reading the documentation in the MQL4 book - would link to it here, for convenience but this is my forum post nr. 3 so I can’t add URLs into forum posts yet. To my best estimate, the MQL4 book describes basically everything there is to know about MQL4, as it being a programming language - moreover, a programming language very much like the C programming language, such that has found a lot of popularity in UNIX systems development and in software development overall. So, there’s hopefully a lot of opportunity for crossover between C applications and MQL applications, for any specific usage scenarios.

Reading the documentation, I’ve learned that MQL has functions for operations about charts, windows, OHLC data tuples, and file I/O. Of course, the Charts and OHLC data tuples in MetaTrader are available at discrete data sampling rates - e.g. one tick every 1 minute, 60 minutes, etc. The shortest data sampling rate in the charts is 1 minute.

I’ve been studying MetaTrader with a demo account, of course. I’ve noticed that the conventional MetaTrader “New Order” window illustrates a realtime data feed about the respective buy/sell market rates in any single currency pair.

I don’t imagine MQL4 itself would offer access for MQL Programs - i.e MQL Scripts, Expert Advisers, an Indicator calculations - that it would or (so I estimate) probably would not offer access to the same realtime data illustrated in the “New Order” window. I wonder if there might be any sort of a third-party add-on that might offer such a fine-grained depth of data access, though, for analysis of the market data?

The following are just some of my observations so far:

I’ve noticed that there are - so I believe - some occasional trends illustrated in the realtime data, such in analyzing how the market trends progress within the margin of a {StopLoss, EntryRate, TakeProfit} tuple of any single paper trading bid, and how that seems to relate to the profit from the individual bid. One thing I’ve noticed, this morning, is that if there is a reversal in the market trend - that is, if the market trend exits the margin on the same side of the margin as at which the market trend had entered the margin, when the bid’s entry price was reached, then it is probably not going to be to a profit, for the individual bid.

There are a lot of oscillations in the market data, apparent in the realtime data view. I don’t imagine I’m able to estimate what could be the causes of those very fine-grained market data oscillations. I’m sure it has something to do with any number of software services, somewhere, but - in any ways beyond that simple estimate - I think it would be like trying to reverse-engineer a black box, LoL, to try to guess out what’s causing the fine-grained market rate oscillations. Inasmuch as that those fine-grained market rate oscillations may illustrate - ever - a sort of “Bounded” quality, if not a “Walking bound”, I believe it could be ideal if one could be able to analyze the limits of each such bound, and ideally to set the stop-loss and take-profit margins of any bid such that those limits will occur within the same bounds - as to ensure, to the greatest algebraic accuracy hypothetically possible that for each bid, the bid could be be calculated as that the market rate would not perform a reversal within the bid.

Maybe that’s a little too narrow-going for a software idea? Hypothetically, if the bounds of such a bounded oscillation would not be too narrow to place a bid within, then - if the realtime data would be available for calculation in Indicators - it could be to a sort on ideal, though very fine-grained automated trading system, possibly?

So, that’s why I wonder if there’s any possibility of accessing the data in real time, from any applications in MetaTrader’s MQL?

Of course, to produce any sort of a mechanical trading system as would hypothetically operate on the same realtime data, it might be well if the hypothetical application would be produced on - ideally - a very well performing program implementation, on a suitably fast computer. Candidly, so, I don’t know if any of these ideas may seem very realistic in any manner of a longview. I simply thought I’d like to inquire about the realtime data, so - and there is my best effort at synopsis as to “Why?”

I think it’s a really computationally interesting platform, MetaTrader. I believe I’ll resume staring at the realtime data feed, shortly.

Sure, though, even at a sampling rate of 5M there are some periodic trends visible in the market rate data, this early in the week at last - the USCDAD(i) exchange - image produced with MetaTrader 4


The magenta vertical line denotes the start of the week, in the chart as illustrated.

Though it differ slightly across each time period delineated in the chart, it seems to describe a periodic function of some kind? Roughly, it’s like there are three or four major, distinct curving-slope trends, as {A, B, C} or {A, B, C, D} in each period between the respective “Yellow Lines”, - those, as I’ve added to the chart in order to annotate, albeit in a simple illustration, the estimable period off time in the matter recurring as a sort of periodic function? Notably, at start-of-week, the “A” curve is pretty low, albeit - and there’s a short lead-up time before the matter commences at the start of the week?

It seems that there’s a certain similarity across the overall shape of each respective curve in the trend? If not a ratio between the maximum magnitude of each respective “Crest”? I’m not sure if this could seem occur in any other markets, though.

Updated: In a metaphor onto analog radio systems, if there are software services establishing a sort of carrier wave in the market, then perhaps one could say that any number of market interactions may be providing a modulating signal such that the market rate fluctuates in something of a mathematical combination of the Carrier wave and the Modulating Input? Maybe this could seem a like bit of an abstract metaphor, but I think it makes sense - perhaps towards a bit of a cross-domain study about market rate analysis, but in a manner like a radio systems analysis? Assuming that the week’s early market data might illustrate a general shape of the carrier wave, as such - but I haven’t looked at previous weeks, yet, to see if any other weeks start of as so, in that specific currency pair.

The “Small-scale reversals” in this first day of USDCADi trading - prototypically - these reverals seem to look approximately like so, in and albeit rudimentary representation of realtime market data within a minute’s interval … resolving a momentary technical difficulty, I’ll add the graphic in a reply.

The “Small-scale reversals” in this first day of USDCADi trading - prototypically - these reverals seem to look approximately like so, in an albeit rudimentary representation of realtime market data within a minute’s interval


Ironically perhaps, for a series of three bids that I’ve placed on this market with a 10 point (?) margin* on the bids, all three are going out almost exacty a -38.73 loss. These oscillations, I believe they mean something. Of course, this is only in paper trading - an imaginary $10 invested on each -$39 loss

I sure don’t want to overthink the market data, just trying to understand an algebra of the market, towards a simple kind of bread-and-butter trading.

  • Margin between stop-loss and take-profit limits, here applying a 1:1 ratio for the difference between bid entry rate and each of those limiting rates, i.e stop-loss and take-profit limits

This oscillations system has me intrigued. Albeit in paper trading, a ledger of a a spread of a four bids at $10 each onto USDCADi this morning:


I’m seeing a consistent $39 loss, on all of three of the bids that have closed, so far:


I’m applying MetaTrader in this study.

So, what may be the meaning of this data - I wonder? I’m afraid this trend is distracting my otherwise bread-and-butter oriented trading logic.

Back to the concepts of the forum title though: In applying a manner of organic real-time analysis about the real-time data, I’ve discovered a way by which one receives a 390% loss consistently, regardless of whether one executes a ‘buy’ or ‘sell order’. I know that this means something, and though I am cautious of guessing, to any too-far detail, “What does it mean?” I am fairly sure it could mean that someone, somewhere might be creating a machine-produced trend on the USDCADi market?

As well as that I would like to understand what it means, but in a shorter sense of scale, I would like to be able to ensure that any bid I would place on the USDCADi market will not be negatively affected of that oscillating trend.

I’m applying a demo account for this paper trading - assuming it uses the same data feed as the accounts on to the real market data? I don’t have the leverage to invest in a consistent 390% loss as if to experiment with a “Real Dollars” account, candidly.

Personally, I hope that this characteristic might be unique to the USDCADi market, but I don’t believe I may assume as if it would be found “Only there”…

Obviously enough, all of the bids have executed at the stop-loss rate. I’m sure that that means something, too - probably, that quality being semantically related to the oddly consistent oscillating reversals that I’m seeing, in this market data.

the space between TP and SL is 1 pip. So if your spread is 0.9 pip spread, then there is a almost 99% probability it will hit the SL. Am I right?
Another thing, what do we know about the market? there are a couple of fact guarantees regarding the price in the forex chart, can you also name them?

There are a lot of oscillations in the market data, apparent in the realtime data view. I don’t imagine I’m able to estimate what could be the causes of those very fine-grained market data oscillations. I’m sure it has something to do with any number of software services, somewhere, but - in any ways beyond that simple estimate - I think it would be like trying to reverse-engineer a black box, LoL, to try to guess out what’s causing the fine-grained market rate oscillations. Inasmuch as that those fine-grained market rate oscillations may illustrate - ever - a sort of “Bounded” quality, if not a “Walking bound”, I believe it could be ideal if one could be able to analyze the limits of each such bound, and ideally to set the stop-loss and take-profit margins of any bid such that those limits will occur within the same bounds - as to ensure, to the greatest algebraic accuracy hypothetically possible that for each bid, the bid could be be calculated as that the market rate would not perform a reversal within the bid.

All the charts show real historical data. The Order window shows a lot more movement because you can see more detail.
The price you see on your chart is the bid price. It will be the same as in the order window.