URGENT : appending boolean buttons

Hello guys ,

I would like to get an appending boolean button (it displays a STOP button and when I click on it , it becomes a START button) in the “Start/Stop of BOT”

coins_list = ['BTC','LTC','ETH'] #


@st.cache(allow_output_mutation=True)
def Input_Parameters():
	return []

coin = st.selectbox('Search COIN',coins_list)
st.write(coin)
X1 = st.number_input('Provide Value for X1', min_value = 000000.00000 , max_value = 99999.9999 , step = 1e-5)
st.write(X1)
Y1 = st.number_input('Provide Value for Y1', min_value = 000000.00000 , max_value = 99999.9999, step = 1e-5)
st.write(Y1)
Z1 = st.number_input('Quantity Z1', min_value = 000000.00000, max_value = 99999.9999, step = 1e-5)
st.write(Z1)
n_loop = st.number_input('Provide Value for N (Loop)',min_value = 1 ,max_value = 99999, step = 1)

current_price = web.DataReader(coin + "-USD","yahoo","2018-1-1",dt.now())["Close"][-1] 
TradingTime = dt.now().strftime("%m-%d-%Y at %H:%M:%S")
st.write("current price of the coin : " + str(current_price))

col1, col2, col3,col4,col5 = st.columns(5)

with col3:    
   	start = st.button("Start the Bot")	

commission = 0 #current_price*(1/100)
profit = 0 

df = pd.DataFrame(Input_Parameters())
session_state = SessionState.get(df=df)


if start : 


	status = "Running"
	session_state.df = session_state.df.append(  
		{"Trading Time" : TradingTime ,
		"coin pair" : coin,
		"Status": status,
		"Start/Stop of BOT": st.button("STOP"), 
		"Current Price of the coin pair": current_price,
		"Comission Detected": commission,
		"profit made": profit
		},ignore_index=True
	)

Thanks for your help

anyone guys ???

anyone ?

is there someone here ?

Hi @Iheb -

As a friendly piece of advice, starting your thread with URGENT is probably doing the opposite of what you hope.

As to your actual question, I don’t understand what you are asking. You want to have a button that toggles between “start” and “stop”? Can you use a radio button?

Best,
Randy

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.