Extend RX Trend Signal to version 2. Keep every rule of version 1 and add a
higher-timeframe trend filter.

New inputs, appended after the existing ones, in this order:
  TrendTimeframe = PERIOD_H1, TrendEmaPeriod = 50

10. Higher-timeframe trend: the EMA of the close with period TrendEmaPeriod
    on TrendTimeframe, from a built-in iMA handle. The trend is up when a
    TrendTimeframe bar closes above its EMA and down when it closes below.
11. For each chart bar use the newest TrendTimeframe bar that is already
    complete when the chart bar closes. A TrendTimeframe bar counts as
    complete when its end time is not later than the end time of the chart
    bar. Never use a TrendTimeframe bar that is still forming at that moment.
12. A buy signal now also requires the higher-timeframe trend to be up, a
    sell signal requires it to be down. Rule 5 (alternation) applies to the
    signals that remain.
13. Rule 6 still holds. A closed chart bar must show the same values while
    the indicator runs live and after the chart is reloaded later.
14. If TrendTimeframe is not higher than the chart timeframe, refuse to
    start. If higher-timeframe data is not available yet, write no signals
    and try again on the next call.

Buffers, colors, alerts and the input order of version 1 stay as they are.

First restate the new rules in your own words and list everything that is
ambiguous, with the assumption you chose. Then give the complete source of
version 2 in one file. Do not claim that you compiled or tested the code.
