Live charting indicator with every incoming tick

 

Hello

I want to plot my indicator values with each incoming tick. My indicator uses only ticks and does not use 1m,5m and so on candle bars.  I therefore want to see the plot line change shape with each incoming tick, how is this kind of real time plot possible in MT4?

 
delbroooks: I want to plot my indicator values with each incoming tick. My indicator uses only ticks and does not use 1m,5m and so on candle bars.  I therefore want to see the plot line change shape with each incoming tick, how is this kind of real time plot possible in MT4?

You have already asked that here: https://www.mql5.com/en/forum/109552/page4#comment_6098602

... where you asked: "Is it possible to plot every tick in the indicator plot. I want to plot live ticks streaming into an indicator (irrespective of the plot period), is that possible and how?"

... to which I responded with: "Yes, obviously - that was one of the many points of that very comprehensive post you quoted which includes examples of code to achieve just that! Did you even bother to read it and follow the links provided?"

... so here it is again ... read it, follow the links, read the threads, look at the code; there are many examples in the CodeBase section; I even highlighted one very simple example to get you started  ... come on, put in some effort ...

Forum on trading, automated trading systems and testing trading strategies

What is a TICK?

Sergey Golubev, 2017.11.06 08:33

Generate Tick Data

The forum

  1. GenerateTickData indicator - the post. It is the indicator to generate tick data (so place it in indicators folder) and it will work the same regardless of the time frame it is attached to. It will create a file that is starting with "_t" and adds symbol name after it. It "pretends" to be 1 minute chart, but it is not (of course ). Just open that symbol as offline chart and use it (the indicator must be active on some other chart in order to get "live" ticks). 
  2. Tick Indicator and EAs - the key thread  
  3. What is a TICK? - small thread with the explanation
  4. GenerateTickData - final indicator is on this post. Two options added:
    - ResetData - Added it in order to be able to "start from the beginning" (if you turned off your PC and a "time gap" occurs since there is no way to reconstruct tick data or any other reason when you do not want the data to be appended to already existing tick data) If you set this parameter to true, it will start a new tick data history.
    - ShowComment - It is the fastest way to show that it is working, so if you set it to true it will simply comment in the upper left corner that tick data is saved and a time when it was saved.
  5. Tick Data v1.00 indicator - the post. It is next version of GenerateTickData indicator: Added an option to choose how many ticks do you want per bar. Indicator is differentiating 2 basic types:
    - When required number of ticks per bar is 1, it records bid as low and ask as high, so you can have a sort of a "spread control" (since now you can see those ticks as lines but you can see them as bars too, as in this example );
    - When required number of ticks is greater than 1 then you are getting a sort of "equi-volume" charts (every bar is having a same volume when you turn the volume display on) High, low, open and close are constructed from a Bid.
  6. Tick Data v1.01 indicator - the post. This is improved version of Tick Data v1.00 indicator. This indicator can produce an offline chart of ticks simulated by metatrader and if you are testing an EA that depends on a narrow take profits or stops, this indicator shows you that back test can not be trusted at all. The indicator is, apart from having the possibility of recording test data, a revised version with some code optimization and some corrections.
  7. Tick Data v1.02 indicator - the post. It is the Newer version of tick data indicator. Unlike before (previous versions) this one make difference as of how many ticks is chosen and saves it accordingly. As before the name of the symbol for offline charts is "_t"+symbol name, but the difference is in the "time frame" it is saved as : the time frame is in fact number of ticks. So you are going to artificially get a 1 minute, 10 minute, nnn minutes tick charts where minutes are in fact number of ticks per bar. The limitation (due to metatrader naming conventions) is that the maximum number of ticks can be 9999. All the charts are updated live (one 1 tick chart and two 10 tick charts) and both indicators (for 1 tick and 10 tick) are attached to the same chart.
  8. Tick Data v1.03 indicator - the post. It is the next version of Tick Data indicator. A parameter to add a completely new option - there is some explanation of the author: "It occurred to me that a tick chart is a bit "illogical" - illogical in a sense that current bar open is very rarely previous bar open (since it was opened at first tick after a current bar reaches tick count), not when the previous bar was closed. So decided to add on option that takes care of it : UsePreviousCloseForOpen - if set to true, then the open is determined from previous bar close not the first ticks after the bar opens, if set to false it work as before".

The articles

CodeBase

What is a TICK?
What is a TICK?
  • 2011.01.16
  • www.mql5.com
What is a "tick" in MT4...
Reason: