====== Token Reference for Custom File Formats ====== Special "tokens" are simply text within parenthesis that is translated by the system before being output. For example, the **{Symbol}** token automatically gets translated into the instrument symbol that is currently being exported (eg. "EURUSD"). Below is a list of special tokens that are recognised by the system and you can use to design your own custom export file formats. ===== Bar ===== **(These fields are only applicable when generating bar data i.e. all except for 'Tick' time frame)** * **{BarBeginTime}** - The time the bar begins. Time is in the time-zone specified. (See section on 'Date/time specifiers' to see further options to adjust the format of the time.) * **{Open}**, **{High}**, **{Low}**, **{Close}** - The OHLC prices of the bar. Prices are based off the bid price of the tick data. * **{Volume}** - The traded volume for that bar. * **{BarTickCount}** - The number of tick/price movements that occurred within a bar. * **{BarMaxSpread}** - The maximum spread that occurred in the bar, expressed in decimal (eg. 0.00021 for a 2.1 pip spread). * **{BarMaxSpreadInt}** - The maximum spread that occurred within a bar, expressed as an integer. For a 4-digit symbol, this will appear as "2" for a 2.1 pip spread and for a 5-digit symbol, it would appear as "21". * **{BarMinSpread}** - The maximum spread that occurred in the bar, expressed in decimal (eg. 0.00021 for a 2.1 pip spread). * **{BarMinSpreadInt}** - The minimum spread that occurred within a bar, expressed as an integer. For a 4-digit symbol, this will appear as "2" for a 2.1 pip spread and for a 5-digit symbol, it would appear as "21". ===== Tick ===== **(These fields only applicable when using 'Tick' time frame)** * **{Timestamp}** (various formats) - The time of the current tick. Time is in the time-zone specified. (See section below on 'Date/time specifiers' to see further options to adjust the format of the time.) * **{BidPrice}** - The bid price for current tick. * **{BidVolume}** - The bid volume for the current tick. * **{AskPrice}** - The ask price for the current tick. * **{AskVolume}** - The ask volume for the current tick. * **{BidAskSpread}** - The bid-ask spread of the tick expressed in decimal (eg. 0.00021 for a 2.1 pip spread). * **{BidAskSpreadInt}** - The bid-ask spread of the tick, expressed as an integer. For a 4-digit symbol, a spread of 2.1 pips would appear as "2" and for a 5-digit symbol, it would appear as "21". ===== Special ===== * **{Comma}** - Inserts a comma into the output (or you can just use the **,** character). * **{Tab}** - Inserts a tab into the output * **{Random:x,y}** - A random number between x and y (inclusive). For example, **{Random:1,20}** will pick a random number between 1 and 20. These values can be used to generate random spreads, for example. ===== Instrument ===== * **{Symbol}** - The current instrument symbol (eg. EURUSD). ====== Altering Token Output ====== Some numeric tokens provide the ability to modify their values. If, for example, you wish to add an additional spread to the BidPrice of a token, you can specify: {BidPrice+0.0001} This will add an amount of 0.0001 to the original output value. Similarly, most mathematical calculations can be applied including subtraction (-), division (/) and multiplication (*). It is also possible to round numbers to the nearest digit using the "F" specifier like so: {Close:F0} The "0" indicates the number of digits to round to. "0" being whole numbers, "1" being 1 decimal place and so forth. ===== Date/Time ===== * **{CurrentDate}** - The current date and time in various formats //(Do not confuse with bar time stamp!//) ====== Data/time format specifiers & descriptions ====== The specifiers below allow you to fine-tune the format of any date/time fields. * "d" The day of the month, from 1 through 31. * "dd" The day of the month, from 01 through 31. * "ddd" The abbreviated name of the day of the week. * "dddd" The full name of the day of the week. * "f" The tenths of a second in a date and time value. * "ff" The hundredths of a second in a date and time value. * "fff" The milliseconds in a date and time value. * "ffff" The ten thousandths of a second in a date and time value. * "fffff" The hundred thousandths of a second in a date and time value. * "ffffff" The millionths of a second in a date and time value. * "fffffff" The ten millionths of a second in a date and time value. * "F" If non-zero, the tenths of a second in a date and time value. * "FF" If non-zero, the hundredths of a second in a date and time value. * "FFF" If non-zero, the milliseconds in a date and time value. * "FFFF" If non-zero, the ten thousandths of a second in a date and time value. * "FFFFF" If non-zero, the hundred thousandths of a second in a date and time value. * "FFFFFF" If non-zero, the millionths of a second in a date and time value. * "FFFFFFF" If non-zero, the ten millionths of a second in a date and time value. * "g", "gg" The period or era. * "h" The hour, using a 12-hour clock from 1 to 12. * "hh" The hour, using a 12-hour clock from 01 to 12. * "H" The hour, using a 24-hour clock from 0 to 23. * "HH" The hour, using a 24-hour clock from 00 to 23. * "K" Time zone information. * "m" The minute, from 0 through 59. * "mm" The minute, from 00 through 59. * "M" The month, from 1 through 12. * "MM" The month, from 01 through 12. * "MMM" The abbreviated name of the month. * "MMMM" The full name of the month. * "s" The second, from 0 through 59. * "ss" The second, from 00 through 59. * "t" The first character of the AM/PM designator. * "tt" The AM/PM designator. * "y" The year, from 0 to 99. * "yy" The year, from 00 to 99. * "yyy" The year, with a minimum of three digits. * "yyyy" The year as a four-digit number. * "yyyyy" The year as a five-digit number. * "z" Hours offset from UTC, with no leading zeros. * "zz" Hours offset from UTC, with a leading zero for a single-digit value. * "zzz" Hours and minutes offset from UTC. * ":" The time separator. * "/" The date separator. ==== Date/Time Examples ==== **Outputting the Tick Time-stamp** * {Timestamp:yyyyMMdd HHmmss} yields 20120112 010210 (Note: You **must** be using the 'Tick' timeframe to output the **Timestamp** token). **Outputting the Bar Time-stamp** * {BarBeginTime:yyyy-MM-dd},{BarBeginTime:HH:mm} yields 2016-12-11,09:10 (Note: You **must** be using a bar time-frame (such as '5 minutes)' to output the **BarBeginTime** token).