The Kamaflage strategy is a trading strategy that uses various technical indicators to make buy and sell decisions in the market. Here's a breakdown of how it works:
Indicators Calculation:
'ohlc4': Average price calculated from open, high, low, and close prices. 'hlc3': Average price calculated from high, low, and close prices.
'hl2': Average price calculated from high and low prices.
'kama-short': Kaufman Adaptive Moving Average with a time period of 5.
'kama-long': Kaufman Adaptive Moving Average with a time period of 200. 'cci': Commodity Channel Index with a time period of 5. 'rsi': Relative Strength Index with a time period of 2. 'sar': Parabolic SAR. Populate Buy Trend:
Check the trading parameters for the buy method. If the trading mode is 'live' or 'dry_run', retrieve the open trades. Define conditions based on the selected buy method:
For 'rsi2' or 'both', the conditions include the buy price being greater than the long-term KAMA, close price being less than the short-term KAMA, RSI being lower than the buy trigger, and CCI being lower than the CCI buy trigger. For 'trend' or 'both', the condition is the buy price being greater than the SAR. For other cases, the condition is the average price being greater than the SAR. Additionally, the volume should be greater than 0. If the conditions are met, set the 'buy' column to 1. Populate Sell Trend:
Check the trading parameters for the sell method. Define conditions based on the selected sell method:
For 'rsi2' or 'both', the conditions include the close price being greater than the short-term KAMA, RSI being higher than the sell trigger, and CCI being higher than the CCI sell trigger. For 'trend' or 'both', the condition is the sell price being less than the SAR. Additionally, the volume should be greater than 0. If the conditions are met, set the 'sell' column to 1. Additional Buy/Sell Timeout Override:
Check the orderbook to get the current market price. If the current price exceeds 1.01 times the order price for a buy order, return True to override the buy timeout. If the current price falls below 0.99 times the order price for a sell order, return True to override the sell timeout. Overall, the Kamaflage strategy utilizes indicators like KAMA, CCI, RSI, and SAR to generate buy and sell signals based on specific conditions.