The terminal reports a symbol's trade tick value next to the values that give it meaning: the point, the trade tick size and the contract size. This script prints the whole set for one symbol and then prices a stop of a given number of pips at a given volume, so a figure can be traced to the properties that produced it.
What it does
- Reads one symbol, the chart's own unless another name is typed in, and prints its specification.
- Prints digits, point, trade tick size, trade tick value, contract size, volume minimum, volume maximum, volume step and the stops level.
- Each value is read from the symbol at run time, so the same script answers for a second symbol.
- Prices a stop: the pip count becomes a price distance, the distance becomes a count of ticks, and the ticks become money at the volume entered.
- Draws no object on the chart and sends no order.
How it works
- The symbol input holds the name to probe. An empty value means the symbol of the chart the script was started on.
- Digits and the point come from the symbol; the point is the price increment those digits imply.
- The trade tick size is read as its own property: the smallest price change the instrument can make.
- The pip is ten points on a 3- or 5-digit symbol, and one point on every other symbol.
- The money uses the trade tick size, not the point, so a symbol whose tick grid is coarser than its point is priced on the grid it trades.
- The arithmetic is three steps: the pip count times the pip, that distance divided by the trade tick size, that count of ticks times the trade tick value times the volume.
Inputs
- Symbol - the instrument name to probe. Empty reads the symbol of the chart it runs on.
- Stop in pips - the distance priced in money, in the pip the script uses.
- Volume - the lot size the money line is computed at, entered in lots.
How to use it
- Put TickValueProbe.mq5 in MQL5/Scripts and compile it in MetaEditor.
- Attach it to a chart, or run it once from the Navigator.
- Set the three inputs, then read the printed block in the Experts log.
- Run it again with another name in the symbol input to put two specifications side by side.
- Redo one money figure by hand from the printed values: distance over trade tick size, times trade tick value, times volume.
Limits
- It prints and computes. It does not size a lot, place an order or choose a symbol.
- The money figure carries no commission, no swap and no slippage.
- The values are the ones the terminal holds at the moment of the run.
- The pip is a convention: this script uses ten points on a 3- or 5-digit symbol and one point on every other. A figure from a tool that uses another pip will not match this one.
- The stops level is printed for information, and no order is placed, so no distance is checked against it.
- The trade tick value is used as the terminal reports it; no currency conversion is applied.