Skip to content

Commit b7b08d6

Browse files
liaogxliaogx
liaogx
authored andcommitted
initial commit
0 parents  commit b7b08d6

File tree

777 files changed

+226643
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

777 files changed

+226643
-0
lines changed

__init__.py

Whitespace-only changes.

apps/__init__.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/python3
2+
# -*- coding:utf-8 -*-
3+
# __author__ = 'liaogx'
4+
5+
6+
7+
8+
9+
10+
11+
12+
13+
14+

apps/backtest/__init__.py

Whitespace-only changes.

apps/backtest/adminx.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.

apps/backtest/apps.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class BacktestConfig(AppConfig):
5+
name = 'backtest'
6+
verbose_name = '回测'

apps/backtest/migrations/__init__.py

Whitespace-only changes.

apps/backtest/models.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.db import models
2+
3+
# Create your models here.

apps/backtest/tests.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.test import TestCase
2+
3+
# Create your tests here.

apps/backtest/views.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.shortcuts import render
2+
3+
# Create your views here.

apps/community/__init__.py

Whitespace-only changes.

apps/community/adminx.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.

apps/community/apps.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class CommunityConfig(AppConfig):
5+
name = 'community'
6+
verbose_name = '社区'

apps/community/migrations/__init__.py

Whitespace-only changes.

apps/community/models.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.db import models
2+
3+
# Create your models here.

apps/community/tests.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.test import TestCase
2+
3+
# Create your tests here.

apps/community/views.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.shortcuts import render
2+
3+
# Create your views here.

apps/message/__init__.py

Whitespace-only changes.

apps/message/adminx.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.

apps/message/apps.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class MessageConfig(AppConfig):
5+
name = 'message'
6+
verbose_name = '消息通知'

apps/message/migrations/__init__.py

Whitespace-only changes.

apps/message/models.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.db import models
2+
3+
# Create your models here.

apps/message/tests.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.test import TestCase
2+
3+
# Create your tests here.

apps/message/views.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.shortcuts import render
2+
3+
# Create your views here.

apps/news/__init__.py

Whitespace-only changes.

apps/news/adminx.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.

apps/news/apps.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class NewsConfig(AppConfig):
5+
name = 'news'
6+
verbose_name = '新闻'

apps/news/migrations/__init__.py

Whitespace-only changes.

apps/news/models.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.db import models
2+
3+
# Create your models here.

apps/news/tests.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.test import TestCase
2+
3+
# Create your tests here.

apps/news/views.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.shortcuts import render
2+
3+
# Create your views here.

apps/risk/__init__.py

Whitespace-only changes.

apps/risk/adminx.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.

apps/risk/apps.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class RiskConfig(AppConfig):
5+
name = 'risk'
6+
verbose_name = '风控'

apps/risk/migrations/__init__.py

Whitespace-only changes.

apps/risk/models.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.db import models
2+
3+
# Create your models here.

apps/risk/tests.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.test import TestCase
2+
3+
# Create your tests here.

apps/risk/views.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.shortcuts import render
2+
3+
# Create your views here.

apps/stock/__init__.py

Whitespace-only changes.

apps/stock/adminx.py

+144
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
#!/usr/bin/python3
2+
# -*- coding:utf-8 -*-
3+
# __author__ = 'liao gao xiang'
4+
5+
import xadmin
6+
from stock.models import StockInfo, HolderInfo, LiquidHolderInfo, MarketDay, MarketWeek, MarketMonth, MarketYear, \
7+
Margin, MorphologicFactor, TechnicalFactor, FinancialFactor
8+
9+
10+
class StockInfoAdmin(object):
11+
list_display = ['code', 'name', 'is_st', 'industry', 'is_margin', 'is_hs300', 'is_sh', 'is_sz', 'is_sh50', 'is_500',
12+
'is_sme', 'is_second', 'share_total', 'share_liqa', 'share_restrict', 'holder_num', 'holder_average_num',
13+
'holder_average_change', 'updated_at']
14+
search_fields = ['code', 'name', 'is_st', 'industry', 'is_margin', 'is_hs300', 'is_sh', 'is_sz', 'is_sh50', 'is_500',
15+
'is_sme', 'is_second', 'share_total', 'share_liqa', 'share_restrict', 'holder_num', 'holder_average_num',
16+
'holder_average_change', 'updated_at']
17+
list_filter = ['code', 'name', 'is_st', 'industry', 'is_margin', 'is_hs300', 'is_sh', 'is_sz', 'is_sh50', 'is_500',
18+
'is_sme', 'is_second', 'share_total', 'share_liqa', 'share_restrict', 'holder_num', 'holder_average_num',
19+
'holder_average_change', 'updated_at']
20+
import_excel = True
21+
22+
23+
class HolderInfoAdmin(object):
24+
list_display = ['code', 'name', 'quantity', 'pct', 'updated_at']
25+
search_fields = ['code', 'name', 'quantity', 'pct', 'updated_at']
26+
list_filter = ['code', 'name', 'quantity', 'pct', 'updated_at']
27+
28+
29+
class LiquidHolderInfoAdmin(object):
30+
list_display = ['code', 'name', 'quantity', 'pct', 'updated_at']
31+
search_fields = ['code', 'name', 'quantity', 'pct', 'updated_at']
32+
list_filter = ['code', 'name', 'quantity', 'pct', 'updated_at']
33+
34+
35+
class MarketDayAdmin(object):
36+
list_display = ['code', 'date', 'close', 'open', 'high', 'low', 'volume', 'pct_change', 'swing', 'avg_price', 'turn', 'amount', 'buy_amount',
37+
'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'active_buy_volume', 'active_sell_volume',
38+
'buy_amount_active', 'sell_amount_active', 'updated_at']
39+
search_fields = ['code', 'date', 'close', 'open', 'high', 'low', 'volume', 'pct_change', 'swing', 'avg_price', 'turn', 'amount', 'buy_amount',
40+
'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'active_buy_volume', 'active_sell_volume',
41+
'buy_amount_active', 'sell_amount_active', 'updated_at']
42+
list_filter = ['code', 'date', 'close', 'open', 'high', 'low', 'volume', 'pct_change', 'swing', 'avg_price', 'turn', 'amount', 'buy_amount',
43+
'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'active_buy_volume', 'active_sell_volume',
44+
'buy_amount_active', 'sell_amount_active', 'updated_at']
45+
46+
47+
class MarketWeekAdmin(object):
48+
list_display = ['code', 'week', 'close', 'open', 'high', 'low', 'pct_change', 'swing', 'avg_price', 'turn', 'volume', 'amount', 'buy_amount',
49+
'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'net_sell_amount', 'net_sell_volume',
50+
'buy_amount_active', 'sell_amount_active', 'updated_at']
51+
search_fields = ['code', 'week', 'close', 'open', 'high', 'low', 'pct_change', 'swing', 'avg_price', 'turn', 'volume', 'amount', 'buy_amount',
52+
'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'net_sell_amount', 'net_sell_volume',
53+
'buy_amount_active', 'sell_amount_active', 'updated_at']
54+
list_filter = ['code', 'week', 'close', 'open', 'high', 'low', 'pct_change', 'swing', 'avg_price', 'turn', 'volume', 'amount', 'buy_amount',
55+
'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'net_sell_amount', 'net_sell_volume',
56+
'buy_amount_active', 'sell_amount_active', 'updated_at']
57+
58+
59+
class MarketMonthAdmin(object):
60+
list_display = ['code', 'month', 'close', 'open', 'high', 'low', 'pct_change', 'swing', 'avg_price', 'turn', 'volume', 'amount', 'buy_amount',
61+
'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'net_sell_amount', 'net_sell_volume',
62+
'buy_amount_active', 'sell_amount_active', 'updated_at']
63+
search_fields = ['code', 'month', 'close', 'open', 'high', 'low', 'pct_change', 'swing', 'avg_price', 'turn', 'volume', 'amount', 'buy_amount',
64+
'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'net_sell_amount', 'net_sell_volume',
65+
'buy_amount_active', 'sell_amount_active', 'updated_at']
66+
list_filter = ['code', 'month', 'close', 'open', 'high', 'low', 'pct_change', 'swing', 'avg_price', 'turn', 'volume', 'amount', 'buy_amount',
67+
'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'net_sell_amount', 'net_sell_volume',
68+
'buy_amount_active', 'sell_amount_active', 'updated_at']
69+
70+
71+
class MarketYearAdmin(object):
72+
list_display = ['code', 'year', 'close', 'open', 'high', 'low', 'pct_change', 'swing', 'avg_price', 'turn', 'volume', 'amount', 'buy_amount',
73+
'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'net_sell_amount', 'net_sell_volume',
74+
'buy_amount_active', 'sell_amount_active', 'updated_at']
75+
search_fields = ['code', 'year', 'close', 'open', 'high', 'low', 'pct_change', 'swing', 'avg_price', 'turn', 'volume', 'amount', 'buy_amount',
76+
'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'net_sell_amount', 'net_sell_volume',
77+
'buy_amount_active', 'sell_amount_active', 'updated_at']
78+
list_filter = ['code', 'year', 'close', 'open', 'high', 'low', 'pct_change', 'swing', 'avg_price', 'turn', 'volume', 'amount', 'buy_amount',
79+
'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'net_sell_amount', 'net_sell_volume',
80+
'buy_amount_active', 'sell_amount_active', 'updated_at']
81+
82+
83+
class MarginAdmin(object):
84+
list_display = ['code', 'date', 'purchase_with_borrowed_money', 'repayment_to_broker', 'trading_balance', 'sales_of_borrowed_sec',
85+
'repayment_of_borrowed_sec', 'sale_trading_amount', 'sec_lending_balance_volume', 'sec_lending_balance',
86+
'trading_and_sec_lending_balance', 'updated_at']
87+
search_fields = ['code', 'date', 'purchase_with_borrowed_money', 'repayment_to_broker', 'trading_balance', 'sales_of_borrowed_sec',
88+
'repayment_of_borrowed_sec', 'sale_trading_amount', 'sec_lending_balance_volume', 'sec_lending_balance',
89+
'trading_and_sec_lending_balance', 'updated_at']
90+
list_filter = ['code', 'date', 'purchase_with_borrowed_money', 'repayment_to_broker', 'trading_balance', 'sales_of_borrowed_sec',
91+
'repayment_of_borrowed_sec', 'sale_trading_amount', 'sec_lending_balance_volume', 'sec_lending_balance',
92+
'trading_and_sec_lending_balance', 'updated_at']
93+
94+
95+
class MorphologicFactorAdmin(object):
96+
list_display = ['code', 'date', 'red_three_soldiers', 'hammer', 'hammer_down', 'two_ravens', 'three_ravens', 'morning_star', 'evening_star',
97+
'dark_cloud_cover', 'meteor_line', 'three_line_strike', 'southern_samsung', 'be_confronted_with_a_formidable_enemy',
98+
'abandoned_infant', 'belt_line', 'cross_pregnancy_line', 'rickshaw_man', 'updated_at']
99+
search_fields = ['code', 'date', 'red_three_soldiers', 'hammer', 'hammer_down', 'two_ravens', 'three_ravens', 'morning_star', 'evening_star',
100+
'dark_cloud_cover', 'meteor_line', 'three_line_strike', 'southern_samsung', 'be_confronted_with_a_formidable_enemy',
101+
'abandoned_infant', 'belt_line', 'cross_pregnancy_line', 'rickshaw_man', 'updated_at']
102+
list_filter = ['code', 'date', 'red_three_soldiers', 'hammer', 'hammer_down', 'two_ravens', 'three_ravens', 'morning_star', 'evening_star',
103+
'dark_cloud_cover', 'meteor_line', 'three_line_strike', 'southern_samsung', 'be_confronted_with_a_formidable_enemy',
104+
'abandoned_infant', 'belt_line', 'cross_pregnancy_line', 'rickshaw_man', 'updated_at']
105+
106+
107+
class TechnicalFactorAdmin(object):
108+
list_display = ['code', 'date', 'ma', 'macd', 'kdj', 'rsi', 'bias', 'bbi', 'cci', 'atr', 'trix', 'ema', 'dma', 'boll_up', 'boll_down', 'sar',
109+
'si', 'wr', 'cr', 'std', 'vol_ratio', 'updated_at']
110+
search_fields = ['code', 'date', 'ma', 'macd', 'kdj', 'rsi', 'bias', 'bbi', 'cci', 'atr', 'trix', 'ema', 'dma', 'boll_up', 'boll_down', 'sar',
111+
'si', 'wr', 'cr', 'std', 'vol_ratio', 'updated_at']
112+
list_filter = ['code', 'date', 'ma', 'macd', 'kdj', 'rsi', 'bias', 'bbi', 'cci', 'atr', 'trix', 'ema', 'dma', 'boll_up', 'boll_down', 'sar',
113+
'si', 'wr', 'cr', 'std', 'vol_ratio', 'updated_at']
114+
115+
116+
class FinancialFactorAdmin(object):
117+
list_display = ['code', 'year', 'time', 'eps', 'bps', 'gross_earnings_per_share', 'capital_stock_per_share', 'earnings_per_share',
118+
'undistributed_profit_per_share', 'pre_tax_earnings_per_share', 'ebitda', 'pe', 'roe', 'roa', 'roic', 'gross_profit_margin',
119+
'net_profit_margin', 'opt_oebt', 'debt_to_assets', 'long_debt_to_long_captial', 'short_debt_to_long_captial',
120+
'assets_to_equity', 'fa_current', 'fa_quick', 'fa_cash_to_current_debt', 'fa_debt_to_equity', 'fa_invturn', 'fa_arturn',
121+
'fa_assets_turn', 'updated_at']
122+
search_fields = ['code', 'year', 'time', 'eps', 'bps', 'gross_earnings_per_share', 'capital_stock_per_share', 'earnings_per_share',
123+
'undistributed_profit_per_share', 'pre_tax_earnings_per_share', 'ebitda', 'pe', 'roe', 'roa', 'roic', 'gross_profit_margin',
124+
'net_profit_margin', 'opt_oebt', 'debt_to_assets', 'long_debt_to_long_captial', 'short_debt_to_long_captial',
125+
'assets_to_equity', 'fa_current', 'fa_quick', 'fa_cash_to_current_debt', 'fa_debt_to_equity', 'fa_invturn', 'fa_arturn',
126+
'fa_assets_turn', 'updated_at']
127+
list_filter = ['code', 'year', 'time', 'eps', 'bps', 'gross_earnings_per_share', 'capital_stock_per_share', 'earnings_per_share',
128+
'undistributed_profit_per_share', 'pre_tax_earnings_per_share', 'ebitda', 'pe', 'roe', 'roa', 'roic', 'gross_profit_margin',
129+
'net_profit_margin', 'opt_oebt', 'debt_to_assets', 'long_debt_to_long_captial', 'short_debt_to_long_captial',
130+
'assets_to_equity', 'fa_current', 'fa_quick', 'fa_cash_to_current_debt', 'fa_debt_to_equity', 'fa_invturn', 'fa_arturn',
131+
'fa_assets_turn', 'updated_at']
132+
133+
134+
xadmin.site.register(StockInfo, StockInfoAdmin)
135+
xadmin.site.register(HolderInfo, HolderInfoAdmin)
136+
xadmin.site.register(LiquidHolderInfo, LiquidHolderInfoAdmin)
137+
xadmin.site.register(MarketDay, MarketDayAdmin)
138+
xadmin.site.register(MarketWeek, MarketWeekAdmin)
139+
xadmin.site.register(MarketMonth, MarketMonthAdmin)
140+
xadmin.site.register(MarketYear, MarketYearAdmin)
141+
xadmin.site.register(Margin, MarginAdmin)
142+
xadmin.site.register(MorphologicFactor, MorphologicFactorAdmin)
143+
xadmin.site.register(TechnicalFactor, TechnicalFactorAdmin)
144+
xadmin.site.register(FinancialFactor, FinancialFactorAdmin)

apps/stock/apps.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class StockConfig(AppConfig):
5+
name = 'stock'
6+
verbose_name = '选股'

0 commit comments

Comments
 (0)