This script matches a Trigram for the current candle from its pattern Bullish/Bearish: Marubozu, Hammer, Inverted Hammer, Spinning Top.
The source for Trigram to candlestick pattern can be found online. I'm missing the reputation to add the link here.
Heaven = Bearish Marubozu
Earth = Bullish Marubozu
Thunder = Bearish Spinning Top
Water = Bullish Inverted Hammer
Mountain = Bullish Hammer
Wind = Bullish Spinning Top
Flame = Bearish Hammer
Lake = Bearish Inverted Hammer
The idea is simple. It takes the current candles pattern to match the Trigram.
Inspired by the Trigram Script from ByzantineSC
Anyways, not sure what use it is yet, but if there is anyone else out there interested in I Ching, Yin/Yang theory and trading, this is for you.