The "plasma_cutter" strategy is a trading strategy implemented in a backtesting website. It uses a combination of moving averages and divergence criteria to generate buy and sell signals for trading. Here are the important parts of the strategy:
The strategy calculates two sets of moving averages: "buy-fastMA" and "buy-slowMA" for buying, and "sell-fastMA" and "sell-slowMA" for selling.
These moving averages are calculated using different time periods.
The strategy defines specific ranges for the divergence between the fast and slow moving averages for both buying and selling.
These ranges are specified as "buy-div-max", "buy-div-min", "sell-div-max", and "sell-div-min" parameters. In the "populate_buy_trend" function, the strategy checks if the ratio of the "buy-fastMA" to "buy-slowMA" falls within the specified divergence range for buying. If the condition is met, a buy signal is generated. In the "populate_sell_trend" function, a similar check is performed for the ratio of "sell-slowMA" to "sell-fastMA" to determine the divergence range for selling. If the condition is met, a sell signal is generated. The strategy also defines a minimal return on investment (ROI) table, which specifies different levels of returns at different stages of the trade. This table helps determine when to exit a trade based on the achieved returns. Additionally, the strategy incorporates a stop-loss mechanism to limit losses. If the trade goes against the expected direction beyond a certain threshold (specified as "stoploss"), the strategy will exit the trade. The strategy includes a trailing stop feature, where the stop-loss level is adjusted as the trade becomes profitable. It uses the parameters "trailing_stop_positive" and "trailing_stop_positive_offset" to determine the trailing stop levels. The trailing stop is activated only when the offset level is reached. Overall, the strategy aims to identify favorable buying and selling opportunities based on moving average divergences and generate profitable trades while managing risks through stop-loss and trailing stop mechanisms.