The "XebTradeStrat" strategy is a trading strategy that uses the Bollinger Bands indicator and exponential moving averages (EMA) to generate buy signals. Here is a breakdown of what the strategy does:
It calculates the rolling mean and lower band of the Bollinger Bands indicator using the "bollinger_bands" function. It defines the parameters for the strategy, including the minimal return on investment (ROI) targets, stop-loss percentage, timeframe, and trailing stop settings.
It implements the "populate_indicators" method to calculate the EMA indicators (5-day and 10-day) and adds them to the dataframe.
It implements the "populate_buy_trend" method to identify buy signals based on the EMA crossovers.
If the 5-day EMA crosses above the 10-day EMA and the volume is greater than 0, a buy signal is generated. It implements the "populate_sell_trend" method, which currently does not generate any sell signals. Overall, this strategy aims to buy assets when the 5-day EMA crosses above the 10-day EMA and hold them until specific ROI targets are reached or the stop-loss is triggered.