[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Trade Series Matrix Using C++



PureBytes Links

Trading Reference Links

There was some recent discussion about the need to learn more than one 
language to use AB.

Just wondering if C++ Matrices could be used to store and reference 
trades, instead of Object Orientated Progamming, to make things easier.

C++ includes containers that can be considered matrices (such as arrays 
and, in the Standard Library, vectors, lists, and maps) OR open source 
C++ Matrix libraries are available.


Would it be possible to:

- nominate buy/sell/buyprice etc in the first phase of backtesting
- run backtest over the sample space (limit space as defined in setting)
- store trades P & L as % in binary files
- store time in trade (binary)
- store entry bar OR time (binary- only needed to display arrows on 
chart)

Storing trades in binary form would be very fast (stored as a trade 
matrix).
All metrics can be calculated from % P & L plus time in trade as 
required so Money Management only needs to be applied in the second 
phase, if required.
Only the trade matrices need to be saved, with the backtest settings 
(also binary), for future reference, instead of the BT reports.

In the second phase performance metrics could be calculated as required 
by referencing the matrix entries, either in total or as sub matrices.

Matrix functions could be included in AFL and the advanced backtester 
would use them to reference the trades to create equity curves and 
custom or default reports on demand (no need to re-run backtests for 
custom reports OR when adding/deleting columns from a report).

It might also be possible that trade P & L, and time in trade, could be 
stored in one 32 bit byte thereby save processing time (the separate 
pieces of info could be unpacked into the trade matrix and the time in 
trade matrix when required).

Happily, the trade matrices could be rendered as tables, with rows and 
columns for visual reference/charting etc, which is much more intuitive 
than referencing the Trade Object as we do at the moment.

The matrices could use a full range of Matrix operations or just some 
of the basics for the AFL version e.g. referencing individual trades by 
matrix M * N notataion (I don't know much about matrix maths so it is 
up to the maths people to comment on possible uses for advanced matrix 
maths functions).


When data is added to the DB, or the sample range extended, backtesting 
could commence from the time of the last closed trade and then add new 
trades to the matrix (this would save time by avoiding the need to 
repeat backtests).

It is also a very nice format for exporting to Excel or advanced stats 
packages like R or Matlab :-)

Does anyone esle have any thoughts on the subject?




------------------------------------

**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

*********************
TO GET TECHNICAL SUPPORT from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com
*********************

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html

*********************************
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/