Skip to content

Commit

Permalink
v2.14 - Cosmetic changes to Config tab
Browse files Browse the repository at this point in the history
  • Loading branch information
pranjal-joshi committed Nov 21, 2023
1 parent 74aef72 commit 425b1b3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/classes/Changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from classes.ColorText import colorText

VERSION = "2.13"
VERSION = "2.14"

changelog = colorText.BOLD + '[ChangeLog]\n' + colorText.END + colorText.BLUE + '''
[1.00 - Beta]
Expand Down Expand Up @@ -265,4 +265,7 @@
2. Inside bar detection broken - bug fixed
3. Auto enhanced debug on console in dev release
[2.14]
1. Dropdowns added for duration and period in configration tab
''' + colorText.END
15 changes: 10 additions & 5 deletions src/streamlit_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def on_config_change():
configManager = ConfigManager.tools()
configManager.period = period
configManager.daysToLookback = daystolookback
configManager.duration = duartion
configManager.duration = duration
configManager.minLTP, configManager.maxLTP = minprice, maxprice
configManager.volumeRatio, configManager.consolidationPercentage = volumeratio, consolidationpercentage
configManager.shuffle = shuffle
Expand Down Expand Up @@ -340,7 +340,6 @@ def get_extra_inputs(tickerOption, executeOption, c_index=None, c_criteria=None,
with st.container():
show_df_as_result_table()


with tab_config:
configManager = ConfigManager.tools()
configManager.getConfig(parser=ConfigManager.parser)
Expand All @@ -358,9 +357,16 @@ def get_extra_inputs(tickerOption, executeOption, c_index=None, c_criteria=None,

ac, bc, cc = st.columns([1,1,1])

period = ac.text_input('Period', value=f'{configManager.period}', placeholder='300d / 52wk ')
period_options = ['15d','60d','300d','52wk','3y','5y','max']
duration_options = ['5m','15m','1h','4h','1d','1wk']

# period = ac.text_input('Period', value=f'{configManager.period}', placeholder='300d / 52wk ')
period = ac.selectbox('Period', options=period_options, index=period_options.index(configManager.period), placeholder='300d / 52wk')
daystolookback = bc.number_input('Lookback Period (Number of Candles)', value=configManager.daysToLookback, step=1)
duartion = cc.text_input('Candle Duration', value=f'{configManager.duration}', placeholder='15m / 1d / 1wk')
# duration = cc.text_input('Candle Duration', value=f'{configManager.duration}', placeholder='15m / 1d / 1wk')
duration = cc.selectbox('Candle Duration', options=duration_options, index=duration_options.index(configManager.duration), placeholder='15m / 1d / 1wk')
if 'm' in duration or 'h' in duration:
cc.write('For Intraday duartion, Max :red[value of period <= 60d]')

ac, bc = st.columns([1,1])
minprice = ac.number_input('Minimum Price (Stocks below this will be ignored)', value=float(configManager.minLTP), step=0.1)
Expand Down Expand Up @@ -475,7 +481,6 @@ def get_extra_inputs(tickerOption, executeOption, c_index=None, c_criteria=None,
qty = floor(risk_rs / actual_sl)
oc.metric(label='Quantity', value=qty, delta=f'Max Loss: {(-1 * qty * actual_sl)}', delta_color='inverse', help='Trade this Quantity to prevent excessive unplanned losses')


marquee_html = '''
<!DOCTYPE html>
<html>
Expand Down

0 comments on commit 425b1b3

Please sign in to comment.