-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
51d2dc0
commit ba63361
Showing
5 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import pytca | ||
|
||
# Load data | ||
stock_data = pytca.load_tick_data('path/to/stock_data.csv', data_type='stock') | ||
forex_data = pytca.load_tick_data('path/to/forex_data.csv', data_type='forex') | ||
|
||
# Analyze stock data | ||
stock_analysis = pytca.analyze_stock_trade(stock_data, benchmark_data) | ||
print("Stock Analysis Results:", stock_analysis) | ||
|
||
# Analyze forex data | ||
forex_analysis = pytca.analyze_forex_trade(forex_data, benchmark_data) | ||
print("Forex Analysis Results:", forex_analysis) | ||
|
||
# Calculate slippage | ||
slippage = pytca.calculate_slippage(executed_price=100.05, benchmark_price=100.00) | ||
print("Slippage:", slippage) | ||
|
||
# Calculate VWAP | ||
vwap = pytca.calculate_vwap(prices=[100.00, 100.05, 100.10], volumes=[1000, 2000, 1500]) | ||
print("VWAP:", vwap) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import pytca | ||
|
||
# Load data | ||
tick_data = pytca.load_tick_data('path/to/tick_data.csv', data_type='stock') | ||
|
||
# Create basic plot | ||
basic_fig = pytca.plot_tick_data(tick_data, plot_type='basic') | ||
basic_fig.savefig('basic_plot.png') | ||
|
||
# Create candlestick chart | ||
candlestick_fig = pytca.plot_tick_data(tick_data, plot_type='candlestick', interval='5min') | ||
candlestick_fig.write_html('candlestick.html') | ||
|
||
# Create order book depth chart | ||
depth_fig = pytca.plot_tick_data(tick_data, plot_type='depth') | ||
depth_fig.write_html('depth_chart.html') | ||
|
||
# Create trade flow chart | ||
trade_flow_fig = pytca.plot_tick_data(tick_data, plot_type='trade_flow', window='5min') | ||
trade_flow_fig.write_html('trade_flow.html') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
__title__ = 'pytca' | ||
__version__ = '0.1.3' | ||
__version__ = '1.0.0' | ||
__author__ = 'Jialue Chen' | ||
__license__ = 'BSD 2-Clause' |