Giter VIP home page Giter VIP logo

hudson-and-thames / mlfinlab Goto Github PK

View Code? Open in Web Editor NEW
3.8K 172.0 1.1K 644 KB

MlFinLab helps portfolio managers and traders who want to leverage the power of machine learning by providing reproducible, interpretable, and easy to use tools.

License: Other

Python 100.00%
machine-learning trading investing research finance python algorithmic-trading quantitative-finance financial-machine-learning portfolio-management

mlfinlab's People

Contributors

jackal08 avatar panpip avatar vlrie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mlfinlab's Issues

Update Readme

  • Add Alex to the Readme in the opening Intro.
  • Match that of the website.
  • Add links to LinkedIn Profile.

Information bars are too big

If we run get_volume_imbalance_bars with parameters:

  1. num_tick_init = 10000
  2. num_prev_bars = 100
  3. num_tick_ewma window = 1000
    The output data set is too big (bar compression is too low)

Push package to Test PyPi

Create a package and send it to the test PyPi index. Play around with it.

  • Update the notebooks to work with new package
  • Change the readme to detail install with pip
  • Change version numbers back to 0.1.0
  • Push to main PyPi index

Replace numba ewma with faster version

Numba ewma works very well for small arrays and small windows. However, in imbalance bars implementation windows are usually quite big, that is why we need to optimize ewma code performance

(Wenjie): Chapter 7 Cross-Validation Investigation

Wenjie is having a look at Chapter 7. Will hear back from him in a week.

He said he would like to start working on the HV CV implementation of purge CV. Will scheduale a meeting to discuss way of work.

unclear how to go from raw tick data to tick, volume and dollar bars

Hi,

I was looking at the file data_structures.py to see how you go from raw tick data to the desired outputs. However, it's not clear to me since it says "The csv file must have only 3 columns: date_time, price, & volume". However, in the sample E Mini file downloaded from TickData I was given two files. ES_Quotes.csv and ES_Trades.csv. Which file are you using? Do you have to make some adjustments to these files?

Best,

Ting

Is asserting column datatypes really needed?

There some data providers which publish volumes in floating point values (for example in millions).
And some assets can be priced only in integer values. Are these assertions required for any calculations of mlfinlab?

Fix CUSUM Filter

Describe the bug
The CUSUM filter takes in only 1 point estimate of the volatility and then filters the events for all time. A much better implementation would be to have a dynamic threshold such as in the triple barrier method.

Change ReadMe

Change ReadMe to include a step to install using pip.

where is fracdiff method?

where is fracdiff method?

in reseach notebook, there is fracdiff function.

but is not in package.

is it not updated yet?

Run bars issue

There might be a problem in tick run bar implementation in dev branch but I couldn't pinpoint what could be the issue.

  • I have used first 3 months of 2017 and 2018 EURUSD tick data as separate input files for this test.
  • I have used num_prev_bars=3 and ticks_init=3000 as parameters
  • I have commented out assertion of volume being an integer value in base bars
  • For the 2018 input file, the output looks OK.
  • But for 2017 file, number of ticks per bar continuously decreases starting from around 10000 ticks down to 3-4 ticks,
  • When this happens we begin to create a new bar with every 3-4 ticks and the output become very big and useless.

Here is the test code I used:

import os.path
from mlfinlab.data_structures import run_data_structures as rds

##input_path='./EURUSD_tick_20180101-20180331.csv'
input_path='./EURUSD_tick_20170101-20170331.csv'

batch_size=500000
num_prev_bars=3
ticks_init=3000


##output_path='./EURUSD_tick_run_bar_20180101-20180331.csv'
output_path='./EURUSD_tick_run_bar_20170101-20170331.csv'
rds.get_tick_run_bars(input_path, exp_num_ticks_init=ticks_init, num_prev_bars=num_prev_bars, batch_size=batch_size, 
                                verbose=True, to_csv=True, output_path=output_path)


Each of the input files are around 30MB so I can't attach them here. But it can be downloaded from these links:

Tick file for first 3 months of 2017:
https://drive.google.com/file/d/1K7AwGw2V4lGviDriw9_dIsTaA3U2h12R/view?usp=sharing

Tick file for first 3 months of 2018:
https://drive.google.com/file/d/1LLrS-ve0Fj_LdpTFMeuZMAfSZxD2L4I5/view?usp=sharing

For a quick analysis I have added one debug line in run_data_structure file after bar generation check to understand the issue.

Here is the file: 2018_log.txt
Also can be downloaded here:
https://drive.google.com/file/d/1H3cg2Bx0JaOcB1RbMHrCh-rFiMk-tscm/view?usp=sharing

Output for 2018 input file looks like this. First 3 columns are bar datetime, high and low. diff shows the difference of cum_theta_sell from cum_theta_buy.

Reading data in batches:
Batch number: 0
2018-01-02 02:22:08.369 1.20231 1.20007 cum_theta_buy 1294.0 cum_theta_sell 1641.0 diff 347.0 exp_num_ticks 3000.00 max_proportion 0.55 threshold 1640.28 cum_ticks 9554 buy_proportion 0.45
2018-01-02 07:03:26.522 1.20304 1.20078 cum_theta_buy 4804.0 cum_theta_sell 5261.0 diff 457.0 exp_num_ticks 9554.00 max_proportion 0.55 threshold 5260.00 cum_ticks 10065 buy_proportion 0.48
2018-01-02 09:23:39.318 1.20508 1.20237 cum_theta_buy 5187.0 cum_theta_sell 5264.0 diff 77.0 exp_num_ticks 9894.67 max_proportion 0.53 threshold 5263.83 cum_ticks 10451 buy_proportion 0.50
2018-01-02 11:34:59.610 1.20811 1.20485 cum_theta_buy 4916.0 cum_theta_sell 5268.0 diff 352.0 exp_num_ticks 10212.57 max_proportion 0.52 threshold 5267.78 cum_ticks 10184 buy_proportion 0.48
2018-01-02 13:56:20.217 1.20687 1.20561 cum_theta_buy 5001.0 cum_theta_sell 5267.0 diff 266.0 exp_num_ticks 10243.29 max_proportion 0.51 threshold 5266.80 cum_ticks 10268 buy_proportion 0.49
2018-01-02 15:47:04.628 1.20600 1.20262 cum_theta_buy 4838.0 cum_theta_sell 5268.0 diff 430.0 exp_num_ticks 10270.14 max_proportion 0.51 threshold 5267.20 cum_ticks 10106 buy_proportion 0.48
2018-01-02 17:57:31.264 1.20590 1.20328 cum_theta_buy 4892.0 cum_theta_sell 5268.0 diff 376.0 exp_num_ticks 10163.43 max_proportion 0.52 threshold 5267.97 cum_ticks 10160 buy_proportion 0.48
2018-01-02 21:53:05.438 1.20652 1.20418 cum_theta_buy 4815.0 cum_theta_sell 5268.0 diff 453.0 exp_num_ticks 10160.00 max_proportion 0.52 threshold 5267.99 cum_ticks 10083 buy_proportion 0.48
....
.... around 600 bars created in between ...
....
2018-03-29 14:54:11.940 1.23352 1.23055 cum_theta_buy 5168.0 cum_theta_sell 5834.0 diff 666.0 exp_num_ticks 11003.29 max_proportion 0.53 threshold 5833.58 cum_ticks 11002 buy_proportion 0.47
2018-03-29 16:37:46.332 1.23134 1.22838 cum_theta_buy 5067.0 cum_theta_sell 5834.0 diff 767.0 exp_num_ticks 11014.43 max_proportion 0.53 threshold 5833.83 cum_ticks 10901 buy_proportion 0.46
2018-03-29 19:12:05.263 1.23102 1.22856 cum_theta_buy 4892.0 cum_theta_sell 5835.0 diff 943.0 exp_num_ticks 10962.43 max_proportion 0.53 threshold 5834.18 cum_ticks 10727 buy_proportion 0.46
2018-03-30 00:02:20.043 1.23080 1.22993 cum_theta_buy 5015.0 cum_theta_sell 5836.0 diff 821.0 exp_num_ticks 10816.00 max_proportion 0.54 threshold 5835.15 cum_ticks 10851 buy_proportion 0.46
2018-03-30 03:46:41.923 1.23174 1.22898 cum_theta_buy 5716.0 cum_theta_sell 5836.0 diff 120.0 exp_num_ticks 10822.71 max_proportion 0.54 threshold 5835.63 cum_ticks 11552 buy_proportion 0.49
2018-03-30 07:52:02.060 1.23214 1.23058 cum_theta_buy 5481.0 cum_theta_sell 5843.0 diff 362.0 exp_num_ticks 11233.86 max_proportion 0.52 threshold 5842.23 cum_ticks 11324 buy_proportion 0.48
2018-03-30 15:59:47.250 1.23305 1.23114 cum_theta_buy 5394.0 cum_theta_sell 5843.0 diff 449.0 exp_num_ticks 11321.57 max_proportion 0.52 threshold 5842.18 cum_ticks 11237 buy_proportion 0.48
Returning bars 

Everything looks perfectly normal with 2018 data.

Now when we run the same code with 2017 data, unfortunately it doesn't look good.

Here is the 2017 debug output file:
2017_log.txt
Also can be downloaded here:
https://drive.google.com/file/d/1e327T0RF_p4mV_S02e2gSvyXhrC5u0V2/view?usp=sharing

Here are some lines from it:

Reading data in batches:
Batch number: 0
2017-01-02 08:44:32.409 1.05288 1.05092 cum_theta_buy 1572.0 cum_theta_sell 1604.0 diff 32.0 exp_num_ticks 3000.00 max_proportion 0.53 threshold 1603.75 cum_ticks 9624 buy_proportion 0.52
2017-01-02 10:52:52.324 1.05120 1.04774 cum_theta_buy 4868.0 cum_theta_sell 5019.0 diff 151.0 exp_num_ticks 9624.00 max_proportion 0.52 threshold 5019.00 cum_ticks 9887 buy_proportion 0.49
2017-01-02 14:29:07.466 1.04843 1.04611 cum_theta_buy 4800.0 cum_theta_sell 4921.0 diff 121.0 exp_num_ticks 9799.33 max_proportion 0.50 threshold 4920.04 cum_ticks 9721 buy_proportion 0.49
2017-01-02 16:14:51.547 1.04776 1.04637 cum_theta_buy 4904.0 cum_theta_sell 4056.0 diff -848.0 exp_num_ticks 9754.57 max_proportion 0.50 threshold 4903.29 cum_ticks 8960 buy_proportion 0.55
2017-01-02 20:20:53.576 1.04729 1.04567 cum_theta_buy 4366.0 cum_theta_sell 4880.0 diff 514.0 exp_num_ticks 9309.86 max_proportion 0.52 threshold 4879.96 cum_ticks 9246 buy_proportion 0.47
2017-01-02 22:18:34.976 1.04624 1.04501 cum_theta_buy 4089.0 cum_theta_sell 4647.0 diff 558.0 exp_num_ticks 9232.14 max_proportion 0.50 threshold 4646.09 cum_ticks 8736 buy_proportion 0.47
2017-01-03 01:20:53.665 1.04760 1.04559 cum_theta_buy 4623.0 cum_theta_sell 4631.0 diff 8.0 exp_num_ticks 8913.71 max_proportion 0.52 threshold 4630.06 cum_ticks 9254 buy_proportion 0.50
2017-01-03 07:04:27.412 1.04901 1.04706 cum_theta_buy 4660.0 cum_theta_sell 4674.0 diff 14.0 exp_num_ticks 9104.86 max_proportion 0.51 threshold 4673.91 cum_ticks 9334 buy_proportion 0.50
2017-01-03 08:46:20.313 1.04787 1.04205 cum_theta_buy 4426.0 cum_theta_sell 4661.0 diff 235.0 exp_num_ticks 9225.71 max_proportion 0.51 threshold 4660.04 cum_ticks 9087 buy_proportion 0.49
2017-01-03 10:21:39.537 1.04440 1.03963 cum_theta_buy 4557.0 cum_theta_sell 4662.0 diff 105.0 exp_num_ticks 9181.43 max_proportion 0.51 threshold 4661.09 cum_ticks 9219 buy_proportion 0.49
2017-01-03 12:17:15.838 1.04153 1.03811 cum_theta_buy 4537.0 cum_theta_sell 4664.0 diff 127.0 exp_num_ticks 9197.71 max_proportion 0.51 threshold 4663.75 cum_ticks 9201 buy_proportion 0.49
.....
Batch number: 1
2017-01-09 13:46:07.013 1.05418 1.05125 cum_theta_buy 4277.0 cum_theta_sell 4328.0 diff 51.0 exp_num_ticks 8609.86 max_proportion 0.50 threshold 4327.96 cum_ticks 8605 buy_proportion 0.50
2017-01-09 15:04:11.111 1.05487 1.05246 cum_theta_buy 4189.0 cum_theta_sell 4331.0 diff 142.0 exp_num_ticks 8602.29 max_proportion 0.50 threshold 4330.93 cum_ticks 8520 buy_proportion 0.49
2017-01-09 16:26:23.526 1.05738 1.05357 cum_theta_buy 4331.0 cum_theta_sell 4274.0 diff -57.0 exp_num_ticks 8564.71 max_proportion 0.51 threshold 4330.60 cum_ticks 8605 buy_proportion 0.50
2017-01-09 18:25:03.270 1.05828 1.05615 cum_theta_buy 4074.0 cum_theta_sell 4299.0 diff 225.0 exp_num_ticks 8580.71 max_proportion 0.50 threshold 4298.18 cum_ticks 8373 buy_proportion 0.49
2017-01-09 21:57:06.553 1.05782 1.05577 cum_theta_buy 4251.0 cum_theta_sell 4298.0 diff 47.0 exp_num_ticks 8460.29 max_proportion 0.51 threshold 4297.16 cum_ticks 8549 buy_proportion 0.50
2017-01-10 01:07:17.248 1.05993 1.05705 cum_theta_buy 4142.0 cum_theta_sell 4296.0 diff 154.0 exp_num_ticks 8506.71 max_proportion 0.50 threshold 4295.35 cum_ticks 8438 buy_proportion 0.49
2017-01-10 02:51:25.719 1.06118 1.05756 cum_theta_buy 4125.0 cum_theta_sell 4298.0 diff 173.0 exp_num_ticks 8460.43 max_proportion 0.51 threshold 4297.22 cum_ticks 8423 buy_proportion 0.49
2017-01-10 04:27:24.277 1.06272 1.06022 cum_theta_buy 3933.0 cum_theta_sell 4298.0 diff 365.0 exp_num_ticks 8445.29 max_proportion 0.51 threshold 4297.54 cum_ticks 8231 buy_proportion 0.48
.....
Batch number: 2
2017-01-16 01:46:43.031 1.06358 1.06176 cum_theta_buy 3534.0 cum_theta_sell 4082.0 diff 548.0 exp_num_ticks 7849.71 max_proportion 0.52 threshold 4081.33 cum_ticks 7616 buy_proportion 0.46
2017-01-16 04:32:43.810 1.06272 1.06050 cum_theta_buy 3863.0 cum_theta_sell 4083.0 diff 220.0 exp_num_ticks 7710.29 max_proportion 0.53 threshold 4082.30 cum_ticks 7946 buy_proportion 0.49
2017-01-16 06:46:14.887 1.06296 1.06056 cum_theta_buy 3781.0 cum_theta_sell 4084.0 diff 303.0 exp_num_ticks 7840.43 max_proportion 0.52 threshold 4083.69 cum_ticks 7865 buy_proportion 0.48
2017-01-16 08:24:25.664 1.06261 1.05893 cum_theta_buy 3939.0 cum_theta_sell 4085.0 diff 146.0 exp_num_ticks 7852.57 max_proportion 0.52 threshold 4084.14 cum_ticks 8024 buy_proportion 0.49
2017-01-16 09:50:48.860 1.06051 1.05795 cum_theta_buy 3964.0 cum_theta_sell 4085.0 diff 121.0 exp_num_ticks 7967.43 max_proportion 0.51 threshold 4084.74 cum_ticks 8049 buy_proportion 0.49
2017-01-16 11:53:58.895 1.05982 1.05793 cum_theta_buy 3836.0 cum_theta_sell 4086.0 diff 250.0 exp_num_ticks 8015.57 max_proportion 0.51 threshold 4085.11 cum_ticks 7922 buy_proportion 0.48
2017-01-16 14:10:56.662 1.06010 1.05854 cum_theta_buy 3744.0 cum_theta_sell 4086.0 diff 342.0 exp_num_ticks 7972.86 max_proportion 0.51 threshold 4085.80 cum_ticks 7830 buy_proportion 0.48
2017-01-16 16:17:45.470 1.06086 1.05907 cum_theta_buy 4036.0 cum_theta_sell 4087.0 diff 51.0 exp_num_ticks 7887.57 max_proportion 0.52 threshold 4086.25 cum_ticks 8123 buy_proportion 0.50
.....
Batch number: 3
2017-01-20 19:37:08.711 1.07006 1.06659 cum_theta_buy 3867.0 cum_theta_sell 3534.0 diff -333.0 exp_num_ticks 7578.29 max_proportion 0.51 threshold 3866.02 cum_ticks 7401 buy_proportion 0.52
2017-01-20 21:10:25.580 1.07094 1.06895 cum_theta_buy 3864.0 cum_theta_sell 3767.0 diff -97.0 exp_num_ticks 7464.71 max_proportion 0.52 threshold 3863.50 cum_ticks 7631 buy_proportion 0.51
2017-01-23 00:28:05.651 1.07204 1.06922 cum_theta_buy 3486.0 cum_theta_sell 3864.0 diff 378.0 exp_num_ticks 7543.86 max_proportion 0.51 threshold 3863.73 cum_ticks 7350 buy_proportion 0.47
2017-01-23 02:31:07.494 1.07459 1.07117 cum_theta_buy 3576.0 cum_theta_sell 3791.0 diff 215.0 exp_num_ticks 7437.57 max_proportion 0.51 threshold 3790.66 cum_ticks 7367 buy_proportion 0.49
2017-01-23 05:10:25.771 1.07499 1.07350 cum_theta_buy 3250.0 cum_theta_sell 3810.0 diff 560.0 exp_num_ticks 7399.86 max_proportion 0.51 threshold 3809.28 cum_ticks 7060 buy_proportion 0.46
2017-01-23 07:07:42.846 1.07548 1.07350 cum_theta_buy 3554.0 cum_theta_sell 3814.0 diff 260.0 exp_num_ticks 7189.14 max_proportion 0.53 threshold 3813.88 cum_ticks 7368 buy_proportion 0.48
2017-01-23 08:29:44.811 1.07540 1.07349 cum_theta_buy 3729.0 cum_theta_sell 3811.0 diff 82.0 exp_num_ticks 7279.86 max_proportion 0.52 threshold 3810.99 cum_ticks 7540 buy_proportion 0.49
2017-01-23 10:19:20.364 1.07432 1.07228 cum_theta_buy 3497.0 cum_theta_sell 3814.0 diff 317.0 exp_num_ticks 7422.29 max_proportion 0.51 threshold 3813.67 cum_ticks 7311 buy_proportion 0.48
2017-01-23 12:12:06.829 1.07450 1.07263 cum_theta_buy 3486.0 cum_theta_sell 3814.0 diff 328.0 exp_num_ticks 7384.57 max_proportion 0.52 threshold 3813.85 cum_ticks 7300 buy_proportion 0.48
.....
Batch number: 4
2017-01-30 07:58:38.904 1.07318 1.06984 cum_theta_buy 3231.0 cum_theta_sell 3669.0 diff 438.0 exp_num_ticks 6973.71 max_proportion 0.53 threshold 3668.37 cum_ticks 6900 buy_proportion 0.47
2017-01-30 09:27:00.843 1.07019 1.06872 cum_theta_buy 3646.0 cum_theta_sell 3670.0 diff 24.0 exp_num_ticks 6945.14 max_proportion 0.53 threshold 3669.46 cum_ticks 7316 buy_proportion 0.50
2017-01-30 11:31:46.816 1.06997 1.06822 cum_theta_buy 3561.0 cum_theta_sell 3673.0 diff 112.0 exp_num_ticks 7139.71 max_proportion 0.51 threshold 3672.72 cum_ticks 7234 buy_proportion 0.49
2017-01-30 12:38:39.673 1.06830 1.06290 cum_theta_buy 3665.0 cum_theta_sell 3673.0 diff 8.0 exp_num_ticks 7209.71 max_proportion 0.51 threshold 3672.82 cum_ticks 7338 buy_proportion 0.50
2017-01-30 13:42:43.443 1.06433 1.06203 cum_theta_buy 3604.0 cum_theta_sell 3673.0 diff 69.0 exp_num_ticks 7305.14 max_proportion 0.50 threshold 3672.72 cum_ticks 7277 buy_proportion 0.50
2017-01-30 14:53:17.856 1.06589 1.06327 cum_theta_buy 3674.0 cum_theta_sell 3600.0 diff -74.0 exp_num_ticks 7288.29 max_proportion 0.50 threshold 3673.08 cum_ticks 7274 buy_proportion 0.51
2017-01-30 15:53:35.371 1.06912 1.06532 cum_theta_buy 3653.0 cum_theta_sell 3620.0 diff -33.0 exp_num_ticks 7284.00 max_proportion 0.50 threshold 3652.74 cum_ticks 7273 buy_proportion 0.50
2017-01-30 17:06:42.377 1.06989 1.06790 cum_theta_buy 3505.0 cum_theta_sell 3653.0 diff 148.0 exp_num_ticks 7273.86 max_proportion 0.50 threshold 3652.00 cum_ticks 7158 buy_proportion 0.49
.....
.....
.....
Batch number: 11
2017-03-27 05:25:09.638 1.08461 1.08423 cum_theta_buy 838.0 cum_theta_sell 842.0 diff 4.0 exp_num_ticks 1603.43 max_proportion 0.52 threshold 841.35 cum_ticks 1680 buy_proportion 0.50
2017-03-27 06:03:58.954 1.08500 1.08436 cum_theta_buy 724.0 cum_theta_sell 843.0 diff 119.0 exp_num_ticks 1648.29 max_proportion 0.51 threshold 842.23 cum_ticks 1567 buy_proportion 0.46
2017-03-27 06:24:27.923 1.08527 1.08452 cum_theta_buy 727.0 cum_theta_sell 844.0 diff 117.0 exp_num_ticks 1610.14 max_proportion 0.52 threshold 843.29 cum_ticks 1571 buy_proportion 0.46
2017-03-27 06:44:29.464 1.08646 1.08518 cum_theta_buy 812.0 cum_theta_sell 844.0 diff 32.0 exp_num_ticks 1585.43 max_proportion 0.53 threshold 843.92 cum_ticks 1656 buy_proportion 0.49
2017-03-27 07:02:10.355 1.08693 1.08579 cum_theta_buy 824.0 cum_theta_sell 845.0 diff 21.0 exp_num_ticks 1619.00 max_proportion 0.52 threshold 844.45 cum_ticks 1669 buy_proportion 0.49
2017-03-27 07:18:43.287 1.08699 1.08600 cum_theta_buy 765.0 cum_theta_sell 845.0 diff 80.0 exp_num_ticks 1651.29 max_proportion 0.51 threshold 844.92 cum_ticks 1610 buy_proportion 0.48
2017-03-27 07:35:07.195 1.08733 1.08645 cum_theta_buy 777.0 cum_theta_sell 846.0 diff 69.0 exp_num_ticks 1633.43 max_proportion 0.52 threshold 845.09 cum_ticks 1623 buy_proportion 0.48
2017-03-27 07:54:31.052 1.08710 1.08640 cum_theta_buy 719.0 cum_theta_sell 846.0 diff 127.0 exp_num_ticks 1625.86 max_proportion 0.52 threshold 845.68 cum_ticks 1565 buy_proportion 0.46
2017-03-27 08:15:32.377 1.08721 1.08628 cum_theta_buy 760.0 cum_theta_sell 847.0 diff 87.0 exp_num_ticks 1588.00 max_proportion 0.53 threshold 846.10 cum_ticks 1607 buy_proportion 0.47
2017-03-27 08:41:17.585 1.08708 1.08629 cum_theta_buy 706.0 cum_theta_sell 847.0 diff 141.0 exp_num_ticks 1597.29 max_proportion 0.53 threshold 846.72 cum_ticks 1553 buy_proportion 0.45
2017-03-27 09:04:35.129 1.08672 1.08564 cum_theta_buy 712.0 cum_theta_sell 848.0 diff 136.0 exp_num_ticks 1570.14 max_proportion 0.54 threshold 847.05 cum_ticks 1560 buy_proportion 0.46
.....
.....
.....
.....
2017-03-31 12:24:59.503 1.06891 1.06884 cum_theta_buy 4.0 cum_theta_sell 10.0 diff 6.0 exp_num_ticks 17.29 max_proportion 0.53 threshold 9.17 cum_ticks 14 buy_proportion 0.29
2017-03-31 12:25:16.553 1.06891 1.06887 cum_theta_buy 8.0 cum_theta_sell 10.0 diff 2.0 exp_num_ticks 15.71 max_proportion 0.62 threshold 9.80 cum_ticks 18 buy_proportion 0.44
2017-03-31 12:25:37.857 1.06886 1.06883 cum_theta_buy 2.0 cum_theta_sell 11.0 diff 9.0 exp_num_ticks 17.00 max_proportion 0.59 threshold 10.02 cum_ticks 13 buy_proportion 0.15
2017-03-31 12:25:51.027 1.06886 1.06881 cum_theta_buy 11.0 cum_theta_sell 5.0 diff -6.0 exp_num_ticks 14.57 max_proportion 0.74 threshold 10.85 cum_ticks 16 buy_proportion 0.69
2017-03-31 12:25:57.916 1.06890 1.06884 cum_theta_buy 8.0 cum_theta_sell 4.0 diff -4.0 exp_num_ticks 15.43 max_proportion 0.50 threshold 7.72 cum_ticks 12 buy_proportion 0.67
2017-03-31 12:26:30.830 1.06890 1.06884 cum_theta_buy 6.0 cum_theta_sell 8.0 diff 2.0 exp_num_ticks 13.29 max_proportion 0.60 threshold 7.96 cum_ticks 14 buy_proportion 0.43
2017-03-31 12:26:35.727 1.06887 1.06884 cum_theta_buy 8.0 cum_theta_sell 1.0 diff -7.0 exp_num_ticks 13.71 max_proportion 0.53 threshold 7.32 cum_ticks 9 buy_proportion 0.89
2017-03-31 12:26:48.332 1.06889 1.06881 cum_theta_buy 7.0 cum_theta_sell 8.0 diff 1.0 exp_num_ticks 10.86 max_proportion 0.73 threshold 7.88 cum_ticks 15 buy_proportion 0.47
2017-03-31 12:26:58.913 1.06884 1.06882 cum_theta_buy 8.0 cum_theta_sell 4.0 diff -4.0 exp_num_ticks 13.14 max_proportion 0.58 threshold 7.65 cum_ticks 12 buy_proportion 0.67
2017-03-31 12:27:12.682 1.06886 1.06881 cum_theta_buy 7.0 cum_theta_sell 8.0 diff 1.0 exp_num_ticks 12.43 max_proportion 0.64 threshold 7.97 cum_ticks 15 buy_proportion 0.47
2017-03-31 12:27:24.498 1.06882 1.06875 cum_theta_buy 2.0 cum_theta_sell 8.0 diff 6.0 exp_num_ticks 14.14 max_proportion 0.52 threshold 7.41 cum_ticks 10 buy_proportion 0.20
.....
.....
.....
.....
2017-03-31 20:58:22.971 1.06564 1.06564 cum_theta_buy 0 cum_theta_sell 4.0 diff 4.0 exp_num_ticks 4.86 max_proportion 0.73 threshold 3.57 cum_ticks 4 buy_proportion 0.00
2017-03-31 20:58:25.007 1.06564 1.06557 cum_theta_buy 5.0 cum_theta_sell 3.0 diff -2.0 exp_num_ticks 4.43 max_proportion 0.94 threshold 4.16 cum_ticks 8 buy_proportion 0.62
2017-03-31 20:58:27.927 1.06561 1.06560 cum_theta_buy 5.0 cum_theta_sell 0 diff -5.0 exp_num_ticks 6.29 max_proportion 0.64 threshold 4.04 cum_ticks 5 buy_proportion 1.00
2017-03-31 20:58:30.553 1.06558 1.06558 cum_theta_buy 0 cum_theta_sell 5.0 diff 5.0 exp_num_ticks 5.71 max_proportion 0.75 threshold 4.29 cum_ticks 5 buy_proportion 0.00
2017-03-31 20:58:34.189 1.06562 1.06552 cum_theta_buy 4.0 cum_theta_sell 3.0 diff -1.0 exp_num_ticks 5.43 max_proportion 0.63 threshold 3.39 cum_ticks 7 buy_proportion 0.57
2017-03-31 20:58:38.654 1.06562 1.06552 cum_theta_buy 4.0 cum_theta_sell 1.0 diff -3.0 exp_num_ticks 6.14 max_proportion 0.53 threshold 3.26 cum_ticks 5 buy_proportion 0.80
2017-03-31 20:58:40.580 1.06559 1.06558 cum_theta_buy 4.0 cum_theta_sell 0 diff -4.0 exp_num_ticks 5.57 max_proportion 0.62 threshold 3.46 cum_ticks 4 buy_proportion 1.00
2017-03-31 20:58:42.611 1.06563 1.06515 cum_theta_buy 5.0 cum_theta_sell 4.0 diff -1.0 exp_num_ticks 4.71 max_proportion 0.88 threshold 4.16 cum_ticks 9 buy_proportion 0.56
2017-03-31 20:58:44.014 1.06536 1.06514 cum_theta_buy 3.0 cum_theta_sell 6.0 diff 3.0 exp_num_ticks 7.00 max_proportion 0.72 threshold 5.02 cum_ticks 9 buy_proportion 0.33
2017-03-31 20:58:46.946 1.06521 1.06508 cum_theta_buy 5.0 cum_theta_sell 3.0 diff -2.0 exp_num_ticks 8.29 max_proportion 0.51 threshold 4.21 cum_ticks 8 buy_proportion 0.62
2017-03-31 20:58:50.960 1.06522 1.06508 cum_theta_buy 1.0 cum_theta_sell 5.0 diff 4.0 exp_num_ticks 8.43 max_proportion 0.53 threshold 4.48 cum_ticks 6 buy_proportion 0.17
2017-03-31 20:58:59.380 1.06535 1.06508 cum_theta_buy 5.0 cum_theta_sell 4.0 diff -1.0 exp_num_ticks 7.00 max_proportion 0.68 threshold 4.75 cum_ticks 9 buy_proportion 0.56
2017-03-31 20:59:06.880 1.06536 1.06533 cum_theta_buy 4.0 cum_theta_sell 5.0 diff 1.0 exp_num_ticks 8.00 max_proportion 0.55 threshold 4.37 cum_ticks 9 buy_proportion 0.44
2017-03-31 20:59:20.667 1.06545 1.06531 cum_theta_buy 5.0 cum_theta_sell 4.0 diff -1.0 exp_num_ticks 8.57 max_proportion 0.56 threshold 4.83 cum_ticks 9 buy_proportion 0.56
2017-03-31 20:59:25.313 1.06537 1.06528 cum_theta_buy 1.0 cum_theta_sell 5.0 diff 4.0 exp_num_ticks 9.00 max_proportion 0.52 threshold 4.71 cum_ticks 6 buy_proportion 0.17
2017-03-31 20:59:36.058 1.06528 1.06528 cum_theta_buy 0 cum_theta_sell 5.0 diff 5.0 exp_num_ticks 7.29 max_proportion 0.68 threshold 4.97 cum_ticks 5 buy_proportion 0.00
2017-03-31 20:59:43.172 1.06552 1.06528 cum_theta_buy 6.0 cum_theta_sell 4.0 diff -2.0 exp_num_ticks 5.86 max_proportion 0.87 threshold 5.11 cum_ticks 10 buy_proportion 0.60
2017-03-31 20:59:47.314 1.06552 1.06528 cum_theta_buy 2.0 cum_theta_sell 6.0 diff 4.0 exp_num_ticks 8.00 max_proportion 0.63 threshold 5.07 cum_ticks 8 buy_proportion 0.25
2017-03-31 20:59:52.682 1.06550 1.06528 cum_theta_buy 2.0 cum_theta_sell 6.0 diff 4.0 exp_num_ticks 8.14 max_proportion 0.69 threshold 5.58 cum_ticks 8 buy_proportion 0.25
2017-03-31 20:59:56.707 1.06552 1.06528 cum_theta_buy 3.0 cum_theta_sell 6.0 diff 3.0 exp_num_ticks 8.29 max_proportion 0.70 threshold 5.80 cum_ticks 9 buy_proportion 0.33
Returning bars 

As you can see cum_ticks goes down from 10000 to 4 !!!
Nothing in the code strikes back immediately so I couldn't resolve what might be the problem is.

Akif,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.