-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main_page.py
35 lines (32 loc) · 1.64 KB
/
Main_page.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import streamlit as st
import pandas as pd
from add_features.generate import Features, PositionSide
df = pd.read_csv('data/btc_1min.csv')
features_dict = {
'crossover': {
'rsi': [
{'upper_thold': 70, 'upper_side': PositionSide.SHORT, 'down_thold': 30, 'down_side': PositionSide.LONG, 'config': {'length': 14}},
{'upper_thold': 65, 'upper_side': PositionSide.SHORT, 'down_thold': 35, 'down_side': PositionSide.LONG, 'config': {'length': 21}},
{'upper_thold': 60, 'upper_side': PositionSide.SHORT, 'down_thold': 40, 'down_side': PositionSide.LONG, 'config': {'length': 28}},
],
'bbands': [
{'upper_side': PositionSide.SHORT, 'down_side': PositionSide.LONG, 'config': {'length': 20}},
{'upper_side': PositionSide.SHORT, 'down_side': PositionSide.LONG, 'config': {'length': 30, 'mamode':'t3'}},
]
},
'intersection': {
'macd': [
{'series1_breakup_side': PositionSide.LONG, 'series2_breakup_side': PositionSide.SHORT, 'config': {"fast": 12, "slow": 26, "signal": 9}},
{'series1_breakup_side': PositionSide.LONG, 'series2_breakup_side': PositionSide.SHORT, 'config': {"fast": 15, "slow": 30, "signal": 12}},
{'series1_breakup_side': PositionSide.LONG, 'series2_breakup_side': PositionSide.SHORT, 'config': {"fast": 18, "slow": 34, "signal": 15}},
]
}
}
st.set_page_config(layout='wide')
st.json(features_dict)
start = st.button("Hit me!")
if start:
ft = Features()
features_df = ft.add_features(df, features_dict)
features_df.to_csv('test_features.csv')
st.text('Now go and check indicators in the other pages!')