Rajandran R Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, USDINR and High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in)

How to Setup Tick Charts in Metatrader 4

1 min read

Day trading charts can be based upon several different criteria, with the most popular being time, ticks (number of trades), volume (number of contracts), and price range. All four types of charts use the same market information (price, volume, etc.), but they display the information slightly differently.
EURUSD 1 min Chart with Indicators Applied

Tick Charts

Charts based upon ticks make a new price bar (or candlestick, line, etc.) every time a specific number of trades are completed. Popular numbers of ticks are 33 ticks, 133 ticks, and 233 ticks, which are all short term timeframes. As tick based charts only make new bars when there have been enough trades, they adjust to the market, making bars less often when the market is moving slowly. Some day traders believe that this gives tick charts an advantage over time charts, but this really depends upon the trading system being used.

Steps to Setup 5 Tick Bar Chart in Metatrader
1)Download LogTickData and PostTickData mql4 codes
2)Put the Files inside c:Metatrader4ExpertsIndicator Folder
3)Open MetaEditor and Compile the Files LogTickData.mq4 and PostTickData.mq4
4)Open Metatrader
5)Open 1 Min EURUSD Chart
6)Put the LogTickData-indicator on this “naked” M1 EURUSD chart (enable DLL). Wait for some time so that tick data will be collected and stored.
7)Drag the PostTickData-indicator into the same chart on the Price-window (enable DLL).and choose your own preferred ticks per bar on the inputs-tab, (5 if you wish a 5-tick bar chart) but 33 – 133 – 233 are more random tick charts and the 133 is the one used most commonly.
8)Then you open the offline-chart !TickEURUSD, M5 (leave the time as is) This chart will start to collect tick data and you will see bars starts to form. Wait until sufficient bars has formed, and then add your favorite indicators.

Note :
1)Always leave the leading M1-chart open, don’t close it! There is one big disadvantage on this system – once you close MT, you must wait again building new data to produce a new actual tick chart.
2)The Tick data starts from 1970s

EURUSD 1min Chart

EURUSD 5-Tick Chart(Offline)

Rajandran R Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, USDINR and High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in)

Algomojo Button Trading Expert Advisor for Metatrader 4 Platform

Here is a video tutorial and button trading expert advisor code for MetaTrader 4 platform. You can use the expert advisor to send automated...
Rajandran R
4 min read

Metatrader 4 – Simple Expert Advisor for Algomojo Platform

f writing a simple expert advisor for Metatrader 4 to send automated orders from MT4 to Algomojo - Cloud-Based Trading Platform. This tutorial provides...
Rajandran R
1 min read

How to Send Orders from Metatrader 4 Expert Advisor…

This tutorial helps you to convert your Metatrader 4 expert advisor to send automated orders to the Algomojo Platform. Currently, Algomojo supported brokers are...
Rajandran R
2 min read

39 Replies to “How to Setup Tick Charts in Metatrader 4”

  1. rajendra sir
    please help me
    i want to convert mt4 indicators to mt5 but its showing me errors while compiling please can u help me for this
    thnks in advance

  2. Hello
    I did everything but the price is not moving. Any idea?
    Here is my chart

  3. Rajendra sir,

    i want to metatrader 5 mcx live charts. please sir give me your contact number also.

  4. hey i am allready using tickbarchart in MT4, so log and posttickdata.mq4, can you help me to modify these? So my real broker instruments name EURUSD. (with an extra dot behind) and the .hst file cannot create because in windows no possibility to make any kind of filename eurusd..hst. so if you can, please help me in this case…thanks a lot.best regards from Hungary.

  5. Sir,
    I want real time mcx & nse realtime charts on MT4 or MT5 with datafeed from Sharekhan Trade Tiger or Odin.
    Secondly is there any way to convert MT4 indicators into AFLs
    Thirdly ,is there any way we could connect out trading terminal such as odin to Amibroker/MT4 for Auto Trade.
    Please Help….

  6. Hi,

    Post tick Data is not able to apply on the chart there is some error. It will show Error on the file open:Tick Data\EURUSD,CSV,#4103!.

  7. Can MT4 Customer Indicators work on ODIN DIET Platform…

    Please help me on this….

    1. Vamsi,
      It wont workin in ODIN Diet Platform. MT4 custom indicators will work only in MT4 platform. And Odin Diet doesnt supports custom indicators like how MT4 does.

  8. how to open indian mcx commodity csv file from tradetiger in to metatrader 4

  9. Downloaded this yesterday and must say I am impressed. Don’t know how the impact will be on my cpu and mt4 instance, maybe you can reply on that?

    Any way, thanks for posting (creating?) this tickbar feature, it works great and is definitely one of the nicest mt4 add ons that I have seen since I started using mt4 four years ago!

    1. Adding to that is that it’s working great, however my ea won’t read these offline charts. I had that in the past with some other offline charts (and some others not). Probably something in the code, will try to find it.

  10. I don’t know why MetaQuotes doesn’t just include a tick bar option in their platforms. The most intuitive platform, in my opinion, is still Metatrader 4. I use it all the time, but the lack of tick bars is a real detriment. I’ve used the method described above before. It’s just not very practical for serious traders.

  11. Hi Rajendren,

    Do u have a good indicator to trade binery options in 1 m TF?
    U may email me

    Sri Lanka

    1. Hi Jagdish,
      Trading 1min timeframe is quite dangerous instead you can try with increasing your timeframe as the probability of winning in lower timeframe is quite lower and the risk associated is quite higher. Instead i would suggest you should try with 5min,10min or 15min max.

  12. hi rajandran

    i had installed mt4 and your tick chart indicator about a month ago and it was working fine. i reformatted my pc, and installed mt4 again and tried to compile “posttickdata” file but it gives me the following errors:
    ‘_Symbol’ – variable already defined PostTickData.mq4 31 8
    ‘_Period’ – variable already defined PostTickData.mq4 35 5
    ‘_Symbol’ – constant cannot be modified PostTickData.mq4 51 5

    any ideas?

  13. Hi Rajandran,

    I think the problem could be related to mt4 build 600 which was released early February (unknowingly to me) which would explain why there would be problems and also why locations of files are a bit different.

    Previous version was 509 I think and didn’t have these problems. But not sure why compiling would cause errors now…

    What do you think?

  14. These is because _Symbol and _Period are predefined in MT4 Build 600. Find and replace all _Symbol and _Period with something else and then try to compile and it will work.

    1. Thanks for the info
      I changed
      1. ” _Symbol” to “_symbol”
      2. “_Price” to “_Price”
      then you can compile without errors
      it works

      Thank you Niraj

  15. Niraj,

    any idea what to substitute? for _symbol and _period

    it’s also busted for me

  16. Hi all,
    i was looking for for a tick chart for the MT4 platform. Hopefully someone made this !
    But for me it’s still not working.

    First of all i use the last version of MT4, so when i tried to compile i got an error. _Symbol and _Period are already defined. I fixed it by changing the name of the variable. SO now it compile.

    But now i have a second error
    When i drag the PostTickData to the chart
    I get an error : Error on file open: TickData/EURJPY..csv, #5002

    I read all the post and tried all the PostTickData version but still have a problem to install the tick chart.

    It seems that the LogTickData is not creating the .csv file.
    I created the TickData folder myself in the indicators folder.
    But still not see any .csv file.

    I suppose the error is coming from the LogTickData that is not creating the file.

    I debug a little bit the code, but i’m not familiar with the mq4 language.
    But it appear that the file handle always return -1 (means it cannot open or create the file) at the line 51 of the LogTickData.
    handle = FileOpen(sFileName, FILE_READ|FILE_WRITE|FILE_CSV, “;”);
    I tried by creating the file manually without success. It still cannot open the file. I tried by changing the permission of the Metatrader 4 platform and the permission of the metaEditor.
    Still not working.
    Anyone already encounter this error ?

  17. I just made fix for build 600
    You might need to do two things
    1. Folder might be read only.. So you need to change it.
    file -> data folder and Right Click MQL4 folder, uncheck “read only.”(it seems no change after you checking change but it does.. Don’t worry..)
    2. Change source code of “PostTickData.mq4”
    you need to change code for _Period and _Symbol just as described above.
    find line “FileOpenHistory” and add “FILE_SHARE_READ” as following:
    HistoryHandle = FileOpenHistory( file_name, FILE_BIN | FILE_WRITE| FILE_SHARE_READ);

    1. Many thanks Kats for suggesting the inclusion of “FILE_SHARE_READ”” in the definition of HistoryHandle in PostTickData.

      Without it the .HST file remains locked and MT4 Version 4.00 Build 890 (25 Sept 2015, and presumably 600+ versions) will not allow the offline chart to be opened with File>Open Offline.

      1. Forgive my bad manners–I forgot to thank Rajandran for the original code and remarkably clear instructions

  18. Hi!

    Everything is working fine – thx…but I have a “Little” problem. My EA is not able to trade or to read the values of the BB (for example) in the offline chart ……..is it possible, to run a EA in an offline chart? ….. Test = iBands(Symbol(),Period(),20,2.0,0,PRICE_CLOSE,1,0); doesn’t work. It seems to be, that the code in start() will never be activ……

  19. hola. el problema de compilacion del indicador posttickdata se puede solucionar renombrando las variables que generan conflicto, estas variables son _Symbol y _Period.

    Simplemente hay que buscar y reemplazar en todo el codigo donde se encuentran las palabras _Symbol y _Period y reemplazarlas por paralabras como por ejemplo S_ymbol y P_eridod

    un saludo!

  20. Hello Rajendran sir,

    I am using your MCX supertrend indicator past 2 years. really nice website.

    My question is – I am trading MCX in Odin Diet and I am using indicators in Xforex MT4 build 765 (demo account) for reference,

    I want to connect Odin real time data to MT4 by DDE. Please guide me sir.

    1. Hi,

      You cannot connect odin real time to MT4. As MT4 act as DDE servers MT4 can pass data to any external DDE application which is similar to ODIN. However MT4 is not designed to receive DDE data.

  21. Hello,
    Once the Tick Charts installed on MT4, is it possible to attach an EA to place automated trades based on Tick Charts? Just like on normal MT4 charts?

  22. Hi every body
    I need to convert tick chart to 1 second chart and check the 1 second chart live
    Can any body help me and send for me the indicators ?

    Thanks a lot

  23. I think ODIN -> MT4 is possible but it is not as straightforward as clicking on a few menu options etc. I am working on it but provided I get this one working.

    How come you say experts/indicator directory? In my MQL 4 sub diretory, there is an Experts Directory and then an Indicator directory (along with others like include, scripts etc).. there is nothing like and Experts/Indicators directory (i.e an indicator directory under the expert directory).. Are you implying that we create such a subfolder and MT4 would recognize it? Or are you implying that it is something that exists in newer versions of MT4 or is it just a typo? Please clarify.


  24. hallo sir
    i want learn building auto trading software mt4 to odine
    can you give me sagetion who will teach me. give details

    thank you

Leave a Reply

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More