easyT.manager.Manager.allowed_to_trade
- Manager.allowed_to_trade() bool [source]
This function return the information if your algotrading is allowed to trade or not, it is controled by the manager class.
- Returns
It returns True or False, True if your algotrading is allowed to trade or False if not.
- Raises
ClassNotInvoked() – The error occur when it tries tro return the trade._trade_allowed information before the trade be invoked, call the get_trade() first.
Examples
>>> from easyT.manager import Manager >>> symbol = 'BTCUSDT' >>> manager = Manager() >>> manager.set_platform('binance-spot') 'binance-spot' >>> # The Trade class need to be invoked to test the allowed_to_trade(), if it was not done, an error will >>> # occur >>> manager.allowed_to_trade() easyT.manager.ClassNotInvoked >>> manager.get_trade(symbol=symbol, lot=0.01, stop_loss=0.00, take_profit=0.00) <binanceSpotEasyT.trade.Trade object> >>> manager.allowed_to_trade() False