PointFigureKagiCharts
- Утилиты
- Stanislav Korotky
- Версия: 1.3
- Обновлено: 18 февраля 2021
- Активации: 5
This non-trading expert utilizes so called custom symbols feature (available in MQL API as well) to build custom charts based on history of real ticks of selected standard symbol.
New charts imitate one of well-known graphic structures: Point-And-Figure (PnF) or Kagi. The result is not exactly PnF's X/O columns or rectangular waves of Kagi. Instead it consists of bars, calculated from and denoting stable unidirectional price moves (as multiples of the box size), which is equivalent to XO columns or polygonal lines.
These Point-And-Figure-like and Kagi-like charts (PFK) provide time-invariant presentation of prices, a kind of "packed" Renko.
The program generates custom symbol quotes, thus you may open many charts to apply different EAs and indicators to the boxes. It also transmits real ticks to update the custom charts in real time.
The generated PFK chart uses M1 timeframe. It makes no sense to switch the chart to a timeframe other than M1. The start time of a "minute" bar corresponds to the moment it began to form. The end time of such "minute" bar is dummy (MetaTrader does not allow for bars with different duration), instead you should look at the start time of the next "minute" bar.
After its placement on a chart, PointFigureKagiCharts downloads tick history and generates PFK bars for the custom symbol. This may take a while and require additional space on the disk. EA shows a progress in the comment. When the process is finished, the comment looks like this:
PnFKagiChart(100pt): open EURUSD_PFK100.2 / 1000 bars
where 100pt is the requested box size in points, EURUSD_PFK100.2 is a customizable symbol name, 1000 is a number of generated boxes (if EA is running for the very first time, this is the total number of PFK bars, but if it continues on results of a previous terminal session, the number of new boxes can be a few, because only most recent, missing boxes are generated).
Unique feature - volume delta per box. The delta is encoded in a special way, because MetaTrader does not support negative volumes. This is why you need free CustomVolumeDelta indicator to view it.
PointFigureKagiCharts utility does not work in the tester. Use this DEMO to test it.
Parameters
- BoxSize - box size in points, by default - 100;
- ReversalFactor - number of boxes, required to start new bar in opposite direction;
- ShowWicks - enable/disable wicks, by default - true;
- EmulateOnLineChart - enable/disable ticks emulation on PFK charts, by default - true; this updates indicators and other EAs on backtests and online;
- OutputSymbolName - name of the custom symbol, by default - empty string - then the name is formed as "Symbol_PFKSuffixSize.Factor", where Symbol - current work symbol, Size - BoxSize, Factor - ReversalFactor; optional Suffix: "b" for box mode without wicks; "g" for gapless (Kagi) type;
- ResetID - a unique number to enforce complete recalculation of entire PFK chart, if the ID is changed since previous generation of the same custom symbol, by default - 0; recalculation is helpful in rare cases, when generated PFK chart contains an error for some reason; normally ID should be left untouched, because the EA continues calculation smartly from the most recent existing box;
- BoxType - selector of the box calculation algorithm: Conventional (Point-And-Figure) or Gapless (Kagi), see examples in the pictures;
- VolumeType - selector of the volumes per box calculations: Total Volume, or Delta Volume with either of 4 algorithms (Ask vs Bid, Ask + Bid, Tick Flags, Bid or Last);
- DropTicksOutsideBars - filter out incorrect ticks (outliers);
- StartFrom - time where to start the tick history processing, 0 means very beginning;
- StopAt - time where to stop, 0 means till current time;
Volume Delta Methods
For Ask vs Bid, tick volumes are considered for buy if Ask price increases, and for sell if Bid decreases (please note, that on some accounts/symbols Bid changes more frequent than Ask, which introduces a negative bias; this is the platform specificity).
Ask+Bid analyses the changes of the average price (sum of Ask and Bid): move up - buy, move down - sell.
Tick Flags is based on buy/sell tick flags and applicable for exchanges only.
Bid/Last checks price type used by chart.