Entropy, Liquidity, and Momentum - ELMoELMo is a momentum trading strategy based on two concepts: entropy and liquidity
The core concept behind the strategy is twofold: trade based on reversals in momentum based on the strength of a trend, and trade when market liquidity is beneficial to the position.
Entries and exits are determined by first calculating Shannon entropy for the time series and applying various moving averages. Separately, the Hui-Heubel Liquidity Ratio (lhh) is calculated and applied as a filter. Finally, additional conditionals such as RSI are applied to reduce false entries.
Entropy is defined as the amount of 'randomness' in a system and in this application can be thought of as a measure of the strength or weakness of a trend. The main moving averages and visible components in ELMo represent the normalized entropy score of the 'close' value (0 is series minimum, 1 is maximum). lhh will measure illiquid/fragile markets with low values and liquid/resilient markets with a high value. In general, the strategy will prefer to enter long when liquidity is high and short when liquidity is low, based off of cross events in the displayed entropy moving averages. I have published lhh as a separate indicator but it is not required for this strategy to function.
Several settings can be configured inside the strategy, including long/short bias, lookback window, MA band lengths, RSI boundaries, and more, but I have tried to choose sensible defaults that work for a large variety of situations and equities. My preferred time scales are 1m 1h 4h 1d 1w 1mo but others may work fine. Trailing stops are implemented using configurable ATR values. Additional settings are available to limit entry times (default is set to US options market open/close), and backtesting start date.
The long strategy is generally more accurate than short. Since Pinescript does not have a way to manage long/short exposure in a hedged fashion, I prefer to run two separate instances of ELMo in long-only and short-only modes for signaling. I prefer to trade this strategy with a long bias using the short signals as indications of windows of weakness where hedging could be prudent.