smzerehpoush / binance-spot-trading-bot

Easy-to-use multi-strategic automatic trading for Binance Spot with Telegram integration
45 stars 15 forks source link

time_to_sell & time_to_by #3

Closed 000KeyserSoze000 closed 1 year ago

000KeyserSoze000 commented 1 year ago

Hello, congratulations. Have you an example for write time_to_sell & time_to_by ? Thanks

smzerehpoush commented 1 year ago

DISCLAIMER

I have no responsibility for any loss or hardship incurred directly or indirectly by using this code.

USE IT AT YOUR OWN RISK!

def is_it_time_to_sell(symbol: str):
    logging.info('checking to is it time to sell symbol ' + symbol)
    suitable: bool = (rsi_fourteen_days_close(symbol) < 70 < rsi_fifteen_days_close(symbol))
    if suitable:
        logging.info('it is time to sell symbol ' + symbol)
    else:
        logging.info('it is not time to sell symbol ' + symbol)
    return suitable

def is_it_time_to_to_buy(symbol: str):
    logging.info('checking to is it time to buy symbol ' + symbol)
    suitable: bool = heikin_tow_days_before_yesterday(symbol) > 0 and heikin_yesterday(
        symbol) > 0 
    if suitable:
        logging.info('it is time to buy symbol ' + symbol)
    else:
        logging.info('it is not time to buy symbol ' + symbol)
    return suitable