TickZOOM API
Introduction to the API
The TickZOOM API defines the "contract" between your custom trading rules and the engine.
Backwards Compatibility
By "contract", it means that this API, once locked down, is guaranteed to remain "backwards compatible" which means that you never have modify your existing code as new features or abilities get added to the TickZOOM engine. That also has the benefits of allowing the engine to get drastically improved or completely changed without modifying your strategy code.
1.0 Lock Down Plan
Version 1.0 of this API will get locked down after comment, modification, documentation, and the first version of TickZOOM completes beta testing.
Request for Comment
Your comments are requests on this API immediately.
How to Comments
The best way is to register on this website and then comment. Since this is a Wiki you can also edit the page directly.
Plan for Release of the API
Currently this page merely lists the names of all the interfaces and classes that form the API. Shortly, this weekend, the code itself will be released and browsable after it is fully documented for every method and field.
Documentation
Note this is being done in such a way that the tool will automatically popup "tips" on each of the methods or fields as you write your custom trade rules using the code editor. It will also auto-complete the names when typing.
API Interfaces and Classes
This is the API as simply a list of all the interfaces and classes for comment at this level. Shortly, the code for these classes and interfaces will get released so you can comment on the individual fields and methods.
Trade Data API
These interfaces give you access to bar and tick data produces by the engine.
- Instrument
- Settings for a financial instrument
- Data
- Collection of bar intervals for an instrument
- Bars
- One set of bars for a specific bar interval
- Prices
- An array of prices. Used by Bars for High,Low,Close,Volume,etc.
- Series<T>
- Based for making an array of anything.
- Integers
- Array of integers.
- Doubles
- Array of large decimal numbers.
- Longs
- Array of large integers.
- Tick
- Single tick reported by an exchange or data feed.
- Ticks
- Array of ticks.
- TimeUnit
- Units of time for an Intervals. Hour, Minute, Second, etc.
- TradeSide
- Side of trade for a Tick, Buy, Sell, or None.
- Times
- Array of time stamps also used by Bars for bar start and end time.
- Interval
- A period of time used to define frequency of Bar close time.
- Values
- Array of any numerical type for use in formulas so parameters can be any of Integers, Doubles, Longs, Formula, or Prices.
Trade Rules API
These interfaces are the "reverse" API for the engine to get output from your trading rules for charting or placing trades.
- Formula
- Collection of discreet calculations such as CrossesOver(), Highest(), StdDev() etc.
- Model
-
(Proposed names "Model" or "Method")
A single unit of trading rules:
- Can act as a strategy by controlling trade Signal.
- Can act as an indicator to draw itself on the chart.
- Can do both at the same time.
- Can incorporate other formulas. For example: One formula includes 2 others which draws a moving average and the MACD. The containing formula handles the rules for trading.
- Chain
- Collect of Formulas organized as a chain of filters with each have dependencies on other formulas.
- Context
- Settings for Formula passed down by the engine Starter
- Drawing
- Settings for Formula to interact with the Chart.
- Chart
- Simple interface to control or draw on the chart.
- Signal
- A trading signal expressed as a numer e.g. Long 200 shares of MSFT
Startup and Factory
- Factory
- Used to create instance of the other interfaces where possible.
- Starter
- "Ladies and Gentlemen start your engines!" This interface starts the engine for it's different modes of operation.
Enums for API
These enumerations give "names" to certain values. That makes it easier to read and use the API when setting these values.
- Audio
- Which audio alert to play by the chart.
- LineStyle
- Dashed, solid, dotted, etc.
- Orientation
- UpperLeft, LowerRight, etc.
- PaneType
- Where to draw the formula. Primary, Secondary, Hidden.
- GraphType
- Which type of graph, Histogram, !Paintbar, Curve, etc.
Optimization API
- Variable
- Specifies a formula property to optimize.
- Range
- Range and step size of a Variable.
- Operator
- Used internally.
- Chromosome
- Used for different generations of Genetic Algorithm optimizer.
Trade Rules Library
Users receive these convenience classes that already implement much of the API for you. You're welcome to use these directly or write your own classes entirely. In that case, they may serve as examples.
- FormulaSupport
- This object implements defaults for most of the API interaction with the TickZOOM engine. That way, you simply override only what you need for your custom trading rules.
- Strategy
- This object extends FormulaSupport and adds additional features like automatically inserting a Performance formula and an Exits formula after the current one. That way you can have "one line" control over stops or measure performance stats during real time.
- Indicator
- This object extends FormulaSupport and has some convenience methods for handling drawing on the chart.
- Performance
- This object extends Strategy and adds many industry standard performance measurements on your trades. You can add more yourself.
- Exits
- This object implements standard exits like stop loss, profit target, etc.
Comment by tickzoom on Sat 27 Dec 2008 12:26:04 PM CST
After you register your account you can post comments.
Comment by BearKO on Sat 27 Dec 2008 04:26:50 PM CST
Great work thus far, I look forward to working with it. I like the word Model for the second Formula I think it works. Another name that comes to mind is Method.
Comment by djasek on Sun 28 Dec 2008 12:43:00 PM CST
I second Model. I don't like method as that is what a function is called in C#.
Concerning backward compatibility: I suggest you define a version number. When user code brings up the interface it can define what version it wants to use. That way you can modify the interface however you want and maintain backward compatibility. I know you hope that if you build it right now you will never need to make major changes in the future. But you can never truly know what you will want to do tomorrow.
Comment by tickzoom on Sun 28 Dec 2008 05:01:07 PM CST
Thanks it is now converted to Model.
Also, you're right about the version of the API it will be fixed at 1.0 and I expect a 1.1 version in the very near future which will add multiple instrument models. But you're right, the 1.0 can remain a separate library to connect to TickZOOM.
