The Apollo11 strategy is a trading strategy that uses various indicators to make buy and sell decisions in the market. Here is a brief description of how the strategy works:
Indicator Calculation:
Exponential Moving Averages (EMAs) of different time periods are calculated for the input dataframe. Additional EMAs and other derived values are calculated based on certain offsets and parameters.
Bollinger Bands, Standard Deviation, Average True Range (ATR), and other indicators are calculated.
Buy Trend:
The strategy evaluates multiple buy signals and their respective conditions.
If the conditions for a buy signal are met, certain columns in the dataframe are updated to indicate a buy signal. Sell Trend:
The strategy does not implement specific sell conditions but sets the "sell" column to 0 for all rows. Profit Calculation:
The strategy calculates the current profit and determines the profit percentage for the trade. Based on the profit percentage, a corresponding percentage of the current profit is returned as a potential sell signal. If the profit is greater than certain thresholds (0.2, 0.1, 0.06, and 0.03), fixed percentages (0.04, 0.03, 0.02, and 0.01) of the profit are returned as sell signals. If the profit is less than or equal to -0.10, the strategy checks the open date of the trade and returns a modified percentage of the profit based on the time passed since the trade was opened. If the profit is less than or equal to -0.08, a similar check is performed, but with a different adjustment factor. If none of the above conditions are met, -1 is returned, indicating no sell signal. Overall, the Apollo11 strategy uses a combination of technical indicators and predefined buy/sell conditions to generate trading signals for backtesting purposes.