The ThreeCommasStrategy is a trading strategy implemented in Python. It extends the IStrategy interface provided by the freqtrade.strategy module. Here is a short description of what the strategy does:
It overrides the confirm_trade_entry method of the IStrategy interface to determine whether a trade entry should be confirmed.
The method receives parameters such as the trading pair, order type, amount, rate, and time in force.
It calls the parent confirm_trade_entry method to perform the default confirmation logic.
If the default confirmation logic returns True, the strategy proceeds with additional steps. The trading pair is split into a base coin and a quote currency. The strategy utilizes the Py3CW library to interact with the ThreeCommas trading platform. An API request is made to start a new deal (trade) on ThreeCommas using the specified bot ID and trading pair. The response from the API request is logged. A pair lock is set for the trading pair to prevent further trades on the pair for the next 5 minutes. Finally, the strategy returns True to indicate that the trade should not be stored in the freqtrade database. In summary, the ThreeCommasStrategy executes a trading strategy by confirming trade entries based on certain conditions. If a trade entry is confirmed, it initiates a trade on the ThreeCommas platform, logs the response, and applies a lock to the trading pair. The strategy ensures that the trade is not stored in the freqtrade database.