dataMgr:importer/whImporter: add support to append records

1) Add support to append records from a datafile to a datatable.
2) Rename getRecordField() to getRecordFieldSepBySpace(), which means
   it only works for the records separated by space.
3) Add getRecordFieldSepByComma() which works for the records separated
   by comma.
4) Rename getRecordTime() and getRecordData() to getDirRecordTime() and
   getDirRecordData() because they should only be used with the records
   in a directory.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
data: set default field for lowestByDate() and highestByDate()

Set default field for lowestByDate() and highestByDate() as 'Close'.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
strategy:turtle: update run() method

Ignores the first 10 days even though some of these days may match
long/short signals.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
strategy:futures/turtle: move position methods to futures

Move position management methods from Turtle to Futures, this benefits
other futures strategy to directly inherit these methods and save code
and time.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
strategy:turtle: add endRun() method.

Add endRun() method which closes all opened positions before stop test.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
display:output: Create the display subsystem

1) Make a display subsystem. This subsystem will contain the
   modules of displaying data in the CML and GUI.
2) Create a output module. Implemented the data display formated
   in CML console. Currently only support give color to bash.
3) Defined a new class COLORS, contain a templete structure and
   the method of add templete.
4) Defined a new class PrintColor, which is the children of COLORS.
   This class could display formated data in the CML console.
5) Write the test for the two classes and their methods.

Signed-off-by: GuofengLiu <lgf612@sina.com>
display:__init__: Make display subsystem a module

Add __init__.py to the display subsystem.

Signed-off-by: Guofeng Liu <lgf612@sina.com>
test:test_output: Add new test for colored output

A small demo for how to use PrintColor highlighting some
information. Currently only support Linux host.

Signed-off-by: Guofeng Liu <lgf612@sina.com>
display:output: Remove the code for test

The test for features in output has been moved to the test
subsystem. Remove the test code from output.

Signed-off-by: Guofeng Liu <lgf612@sina.com>
date: format all returned dates as string.

1) Add _formatRetDate() to format date to string.
2) Formated all returned dates to strings.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
data: Move data.py to dataMgr subsystem.

1) Move data.py to dataMgr subsystem in order to achieve better
   clearness in code structure.
2) Fix all error to import data module caused by 1).

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
date: add two methods and update code.

1) Add getDateNextDays() to return the date by next number of days.
2) Add getDatePrevDays() to return the date by previous number
   of days.
3) Rename _formatRetDate() to _dateToString().
4) Update all date comparison uising _dateToString().

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
test:test_date: add tests for new methods.

Add tests for getDateNextDays() and getDatePrevDays().

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
strategy:turtle: add run prompt in Run()

1) Add run prompt in Run() which is useful in a unit of tests.
2) Removed tradeRec because it is not used now.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
dataMgr:importer: add support to split a big future table.

Add support to split a whole future table which consists of many years
of future data into sub future tables by each year.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
strategy:turtle: fix an error.

Fix an error that could not open opposite positions in the same day
when quit a business. But it also needs both doShort() and doLong()
could return the end date correctly.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>