pip-based timeframe

 

how would you code a chart that is based on pips and not on time, but on pips: a candle closes when you've had 10 pips up or 10 pips down. So candles(/bars) are based on price and not on time. Doesn't seem like a simple coding thing so any help would be much appreciated

 

Can be done, not particularly easy... Here is a sample of the result yo can obtain.

The first chart:

The feed is from an external source, and C++ code writes a history files with bars of 5 tick height.
Then, the history is displayed as a "real time" updated Offline Chart in MT4. Note the volume of ticks
within some of the 5 pip moves.


The typical MT4 dealer gives you a filtered feed, usually only a few ticks per minute. This source updates
many many times faster, as you can see rates up to maybe 20 ticks/second on the bottom right volume indicator, and
this was during quiet time, about 6:30pm EST.

These "offline" the charts are updated almost realtime, a fraction of a second delay from tick arrival to history
file update to chart update.

It became very disk intensive, I was collecting ticks on 29 pairs, writing to 7 history files for each pair. Eventually
I moved the History folder to RamDisk for performance reasons. For example, 29 pairs, 10 ticks per second, 7 files each, is
2030 file writes per second. I found a limit of about 4000 writes/second possible on my machine.



Here, several charts: 13 ticks per bar, 233, 1 minute along the top, and 55 tick, and one second bid-ask range on the bottom.



The clues necessary to accomplish this sort of thing can be found in the "Period Converter Optimized" on this website.

 
Hello Phy, That's excellent! mind to share your external datafeed?
 

thx phy

Looks really impressive what you've done. I guess I got some coding to do to get where you're at. How long did it take you to do this?

 

The feed is www.mbtrading.com/fx true ecn/stp style broker.

I modified one of the code samples in their SDK to capture the quotes and create hst files

It took a couple of weeks to get it going. haven't messed with it recently.

 
phy:



The feed is www.mbtrading.com/fx true ecn/stp style broker.



I modified one of the code samples in their SDK to capture the quotes and create
hst files



It took a couple of weeks to get it going. haven't messed with it recently.


Hello Phy, that is a great idea! Do you mind to share some of your code (hst files creation)?
 
Here is article Equivolume Charting Revisited also.
 

Hello Phy, that is a great idea! Do you mind to share some of your code (hst files creation)?

The hard part is done in C++, modificaton of sample files from their SDK, not in MT4.
 
phy:

Hello Phy, that is a great idea! Do you mind to share some of your code (hst files creation)?

The hard part is done in C++, modificaton of sample files from their SDK, not in MT4.

Would you be interested in selling this?
 

I put it on hold thinking the EFXGroup Remote Trader might render it moot, but I was not at all impressed with their effort as of the initial release.

So, it is back in the active project bin.

Sell, no... Rent, maybe... No one else has run it, it might not even work !

 

Hi,

just wanted to check in and show what I meant: this is a renko chart made with an MT4 script. Example is 7 pip, so every time the price has moved 7 pips in on direction, a new candle is formed, regardless of time. By the way, I also included a small indicator to calculate the 'trending' behaviour of this kind of chart: if you use the simple rule of buying when a green candle closes, and selling when a red candle closes, you have over 69 % winners, with an equal payoff/loss of 7 pips. Imagine walking into a casino where all the roulette wheels don't have double 0's, and all wheels have 25 red boxes and only 11 green ones. This is it:

Reason: