mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-06 05:14:38 +08:00
ef4f642e62
This patch lays the groundwork for a compute engine designed to facilitate construction of factor-based universe screening and portfolio allocation. It contains: A new module, `zipline.modelling`, containing entities that can be used to express computations as dependency graphs. Each node in such a graph is an instance of the base `Term` class, defined in `zipline.modelling.term`. Dependency graphs are executed by instances of `FFCEngine`, defined in `zipline.modelling.engine`. A new module, `zipline.data.ffc`, containing loaders and dataset definitions for inputs to the modelling API. New `TradingAlgorithm` api methods: `add_factor`, and `add_filter`. These methods can only be called from `initialize`, and are used to inform the algorithm that each day it should compute the given terms. Computed factor results are made available through a new attribute of the `data` object in `before_trading_start` and `handle_data`. Computed filter results control which assets are available in the factor matrix on each day.
129 lines
6.4 KiB
CSV
129 lines
6.4 KiB
CSV
day,open,high,low,close,volume
|
|
2014-03-03,174100.0,174997.0,172759.0,174500.0,800
|
|
2014-03-04,175651.0,177989.0,175651.0,177989.0,700
|
|
2014-03-05,177489.0,178750.0,177389.0,178655.0,400
|
|
2014-03-06,179449.0,182214.0,179000.0,182175.0,600
|
|
2014-03-07,183199.0,184355.0,182345.0,183772.0,400
|
|
2014-03-10,183999.0,186400.0,183601.0,186400.0,400
|
|
2014-03-11,186925.0,187490.0,185910.0,187101.0,600
|
|
2014-03-12,186498.0,187832.0,186005.0,187750.0,300
|
|
2014-03-13,188150.0,188852.0,185254.0,185750.0,700
|
|
2014-03-14,185825.0,186507.0,183418.0,183860.0,600
|
|
2014-03-17,184350.0,185790.0,184350.0,185050.0,400
|
|
2014-03-18,185400.0,185400.0,183860.0,184860.0,200
|
|
2014-03-19,184860.0,185489.0,182764.0,183860.0,200
|
|
2014-03-20,183999.0,186742.0,183630.0,186540.0,300
|
|
2014-03-21,187925.0,188598.0,187213.0,187850.0,400
|
|
2014-03-24,188014.0,188380.0,186000.0,186520.0,200
|
|
2014-03-25,187647.0,187647.0,185831.0,186587.0,200
|
|
2014-03-26,187190.0,187472.0,184512.0,184540.0,300
|
|
2014-03-27,184950.0,185735.0,184090.0,185200.0,300
|
|
2014-03-28,185800.0,186433.0,183000.0,185149.0,200
|
|
2014-03-31,186005.0,187400.0,186005.0,187350.0,600
|
|
2014-04-01,187500.0,188000.0,186609.0,187213.0,300
|
|
2014-04-02,186700.0,187280.0,186289.0,186759.0,700
|
|
2014-04-03,186608.0,187024.0,185915.0,186287.0,300
|
|
2014-04-04,186715.0,187925.0,185740.0,185753.0,200
|
|
2014-04-07,185351.0,186133.0,184613.0,184700.0,300
|
|
2014-04-08,184700.0,185735.0,183845.0,184640.0,900
|
|
2014-04-09,185400.0,186121.0,184800.0,185897.0,300
|
|
2014-04-10,186300.0,186984.0,183401.0,183402.0,400
|
|
2014-04-11,183000.0,183735.0,182245.0,182759.0,300
|
|
2014-04-14,183500.0,183700.0,181785.0,183212.0,400
|
|
2014-04-15,183900.0,185870.0,183215.0,185640.0,400
|
|
2014-04-16,186201.0,188984.0,186201.0,188900.0,400
|
|
2014-04-17,188880.0,191506.0,188527.0,190639.0,400
|
|
2014-04-21,191475.0,191475.0,189400.0,189482.0,300
|
|
2014-04-22,189499.0,191031.0,188887.0,190720.0,600
|
|
2014-04-23,191475.0,191880.0,190100.0,190800.0,100
|
|
2014-04-24,191500.0,191833.0,189965.0,190500.0,200
|
|
2014-04-25,190480.0,191315.0,189918.0,190686.0,200
|
|
2014-04-28,192399.0,192399.0,189400.0,191400.0,200
|
|
2014-04-29,191530.0,193098.0,191530.0,192545.0,300
|
|
2014-04-30,192799.0,193789.0,192500.0,193275.0,200
|
|
2014-05-01,193295.0,193800.0,192220.0,193482.0,200
|
|
2014-05-02,194020.0,194530.0,191798.0,192255.0,200
|
|
2014-05-05,189800.0,190979.0,189198.0,189790.0,400
|
|
2014-05-06,189102.0,189346.0,186250.0,187375.0,400
|
|
2014-05-07,188724.0,194670.0,188602.0,191550.0,500
|
|
2014-05-08,191375.0,191375.0,189555.0,190100.0,100
|
|
2014-05-09,189500.0,191035.0,188954.0,190883.0,100
|
|
2014-05-12,192300.0,192320.0,190432.0,191115.0,200
|
|
2014-05-13,191500.0,191826.0,190716.0,191826.0,100
|
|
2014-05-14,191200.0,191900.0,191200.0,191420.0,200
|
|
2014-05-15,190860.0,190860.0,189028.0,189371.0,200
|
|
2014-05-16,190400.0,190400.0,188660.0,190210.0,200
|
|
2014-05-19,190000.0,190746.0,189283.0,190400.0,200
|
|
2014-05-20,190550.0,190550.0,188665.0,189201.0,200
|
|
2014-05-21,189499.0,190366.0,189452.0,189975.0,200
|
|
2014-05-22,189668.0,190737.0,189668.0,190535.0,200
|
|
2014-05-23,190751.0,191000.0,189686.0,190205.0,100
|
|
2014-05-27,191140.0,191649.0,190949.0,191300.0,200
|
|
2014-05-28,191280.0,191800.0,191000.0,191356.0,200
|
|
2014-05-29,191065.0,192300.0,190640.0,192300.0,200
|
|
2014-05-30,191650.0,193000.0,191650.0,192000.0,300
|
|
2014-06-02,192300.0,192522.0,191145.0,191748.0,100
|
|
2014-06-03,191000.0,191632.0,190000.0,190417.0,200
|
|
2014-06-04,190725.0,191357.0,190323.0,190766.0,200
|
|
2014-06-05,190620.0,192309.0,190620.0,192100.0,300
|
|
2014-06-06,192380.0,192908.0,192140.0,192895.0,300
|
|
2014-06-09,192800.0,192878.0,191442.0,191917.0,300
|
|
2014-06-10,191575.0,192420.0,191400.0,192306.0,200
|
|
2014-06-11,191938.0,192658.0,191796.0,192357.0,100
|
|
2014-06-12,192623.0,192720.0,190425.0,190950.0,200
|
|
2014-06-13,190950.0,191266.0,188575.0,189520.0,1200
|
|
2014-06-16,189000.0,189490.0,188721.0,189250.0,300
|
|
2014-06-17,189110.0,189545.0,188493.0,188990.0,300
|
|
2014-06-18,188990.0,190960.0,188220.0,190675.0,500
|
|
2014-06-19,191000.0,191042.0,189899.0,190491.0,300
|
|
2014-06-20,191721.0,191860.0,189789.0,190500.0,400
|
|
2014-06-23,190215.0,190461.0,189477.0,189900.0,300
|
|
2014-06-24,189889.0,191000.0,189624.0,190171.0,300
|
|
2014-06-25,190000.0,190983.0,189733.0,190660.0,200
|
|
2014-06-26,190849.0,190849.0,189232.0,190576.0,300
|
|
2014-06-27,190400.0,191059.0,190050.0,190559.0,100
|
|
2014-06-30,190200.0,190604.0,189799.0,189900.0,100
|
|
2014-07-01,190100.0,191405.0,190100.0,190500.0,200
|
|
2014-07-02,190800.0,191508.0,190333.0,191499.0,200
|
|
2014-07-03,191940.0,193649.0,190900.0,193600.0,200
|
|
2014-07-07,193333.0,193597.0,192333.0,193000.0,200
|
|
2014-07-08,192560.0,193555.0,192295.0,192400.0,300
|
|
2014-07-09,192617.0,193249.0,192502.0,193040.0,200
|
|
2014-07-10,191911.0,193015.0,191799.0,192500.0,200
|
|
2014-07-11,192220.0,193006.0,191945.0,192900.0,100
|
|
2014-07-14,193503.0,193860.0,193030.0,193380.0,200
|
|
2014-07-15,193480.0,193750.0,192000.0,192776.0,200
|
|
2014-07-16,193145.0,193145.0,191849.0,192072.0,100
|
|
2014-07-17,191920.0,192101.0,189696.0,189811.0,200
|
|
2014-07-18,190860.0,192631.0,190555.0,192487.0,200
|
|
2014-07-21,191860.0,193058.0,191554.0,193030.0,100
|
|
2014-07-22,193296.0,193450.0,192339.0,192640.0,200
|
|
2014-07-23,192577.0,192827.0,192140.0,192205.0,100
|
|
2014-07-24,192200.0,192985.0,192107.0,192441.0,100
|
|
2014-07-25,192436.0,192436.0,191190.0,191224.0,200
|
|
2014-07-28,191120.0,192682.0,190000.0,192580.0,200
|
|
2014-07-29,192310.0,192948.0,191083.0,191158.0,200
|
|
2014-07-30,191200.0,192549.0,190483.0,191716.0,200
|
|
2014-07-31,190807.0,191553.0,188124.0,188124.0,400
|
|
2014-08-01,187152.0,190368.0,185005.0,189279.0,400
|
|
2014-08-04,192126.0,195005.0,190942.0,194305.0,800
|
|
2014-08-05,194500.0,194500.0,191358.0,192499.0,700
|
|
2014-08-06,192189.0,194460.0,191890.0,193700.0,200
|
|
2014-08-07,194670.0,194800.0,193079.0,194001.0,600
|
|
2014-08-08,193850.0,196391.0,193570.0,196253.0,400
|
|
2014-08-11,197699.0,199072.0,196500.0,198000.0,200
|
|
2014-08-12,197895.0,199799.0,197895.0,199562.0,200
|
|
2014-08-13,199960.0,199999.0,198800.0,199609.0,400
|
|
2014-08-14,199600.0,203081.0,199600.0,202850.0,600
|
|
2014-08-15,203350.0,203355.0,199721.0,201227.0,300
|
|
2014-08-18,202400.0,203000.0,202100.0,202419.0,300
|
|
2014-08-19,202805.0,202986.0,201941.0,202600.0,300
|
|
2014-08-20,202364.0,202600.0,201891.0,202388.0,400
|
|
2014-08-21,202799.0,205169.0,202679.0,205159.0,400
|
|
2014-08-22,204600.0,204800.0,203455.0,203532.0,300
|
|
2014-08-25,204600.0,204999.0,204233.0,204579.0,300
|
|
2014-08-26,204880.0,205097.0,204358.0,204577.0,200
|
|
2014-08-27,204577.0,205445.0,204000.0,204741.0,400
|
|
2014-08-28,204300.0,204640.0,203895.0,204040.0,200
|
|
2014-08-29,204050.0,205880.0,204050.0,205880.0,400
|