[CLX] Library Motion - Examples📑 Showcase
This is ready-to-show indicator version of the example code form the `motion` library. It can be used to create string- or color-based effects.
Library:
================================================================================
📑 Setup
To use this library in your own scripts, you must first import it. To do this, add the following line to the top of your script:
import cryptolinx/Motion/1 as motion
Next, create a `keyframe` object by using the `varip` keyword.
varip myKeyframe = motion.keyframe.new(_intv = 1, _steps = 1)
Based on your needs, you can now use one of the simplified functions to create a transition effect, or you can use the `transition()` or `iteration()` function to create a custom transition effect.
📑 Simplified Functions:
(direct output)
// motion.marquee(keyframe myKeyframe, string _seq, int _ws, int _maxLoops, bool _ltr)
motion.marquee(myKeyframe, 'Hello World!', 3, 0) // 0 = infinite loops
// motion.slideInLeft(keyframe myKeyframe, string _seq, int _ws, int _maxLoops, bool _refill)
motion.slideInLeft(myKeyframe, 'Hello World!', 3, 0) // 0 = infinite loops
// motion.slideOutLeft(keyframe myKeyframe, string _seq, int _ws, int _maxLoops, bool _refill)
motion.slideOutLeft(myKeyframe, 'Hello World!', 3, 0) // 0 = infinite loops
// motion.slideInRight(keyframe myKeyframe, string _seq, int _ws, int _maxLoops, bool _refill)
motion.slideInRight(myKeyframe, 'Hello World!', 3, 0) // 0 = infinite loops
// motion.slideOutRight(keyframe myKeyframe, string _seq, int _ws, int _maxLoops, bool _refill)
motion.slideOutRight(myKeyframe, 'Hello World!', 3, 0) // 0 = infinite loops
// motion.blink(keyframe myKeyframe, string _seq, int _ws, int _maxLoops)
motion.blink(myKeyframe, 'Hello World!', 3, 0) // 0 = infinite loops
(indirect output)
// After you create a transition, you can use the `output` field of the `keyframe` object to get the result.
// motion.marquee(myKeyframe, 'Hello World!', 3, 0)
myKeyframe.output
Fade
Fading Moving AverageThis indicator uses repainting to remove historic moving average data for a cleaner chart.
The line will be fully invisible when the length of the moving average in candlesticks has occurred.
Bollinger Band Color BarsThis is a simple addition to the built in Bollinger Bands script. All it does is replaces the traditional plotting of Bollinger Bands with color bars.
CDub's BolBands SetupUses a set of Bollinger Bands (user defined deviation, user defined deviation * 2) to determine possible entry set ups.
Signals are triggered when price crosses the first band (closest to the baseline MA) in the desired direction.
baseline can be your take profit 1 target
The inside band determines entry and can be used as a take profit 2 target (Opposite side of baseline)
The outside band is a suggested stop loss target (Same side of baseline) and can be used as a take profit 3 target (Opposite side of baseline)
Suggestions are welcome!
-CDub
Keltner Channels WidthSimilar to bollinger bands width, but for keltner channels, designed to recognize when a move is exhausted and contraction is to be expected.
Would use it as a filter to stay out of any trades if the indicator peaks (red color).
PivotBoss TriggersI have collected the four PivotBoss indicators into one big indicator. Eventually I will delete the individual ones, since you can just turn off the ones you don't need in the style controller. Cheers.
Wick Reversal
When the market has been trending lower then suddenly forms a reversal wick candlestick , the likelihood of
a reversal increases since buyers have finally begun to overwhelm the sellers. Selling pressure rules the decline,
but responsive buyers entered the market due to perceived undervaluation. For the reversal wick to open near the
high of the candle, sell off sharply intra-bar, and then rally back toward the open of the candle is bullish , as it
signifies that the bears no longer have control since they were not able to extend the decline of the candle, or the
trend. Instead, the bulls were able to rally price from the lows of the candle and close the bar near the top of its
range, which is bullish - at least for one bar, which hadn't been the case during the bearish trend.
Essentially, when a reversal wick forms at the extreme of a trend, the market is telling you that the trend
either has stalled or is on the verge of a reversal. Remember, the market auctions higher in search of sellers, and
lower in search of buyers. When the market over-extends itself in search of market participants, it will find itself
out of value, which means responsive market participants will look to enter the market to push price back toward
an area of perceived value. This will help price find a value area for two-sided trade to take place. When the
market finds itself too far out of value, responsive market participants will sometimes enter the market with
force, which aggressively pushes price in the opposite direction, essentially forming reversal wick candlesticks .
This pattern is perhaps the most telling and common reversal setup, but requires steadfast confirmation in order
to capitalize on its power. Understanding the psychology behind these formations and learning to identify them
quickly will allow you to enter positions well ahead of the crowd, especially if you've spotted these patterns at
potentially overvalued or undervalued areas.
Fade (Extreme) Reversal
The extreme reversal setup is a clever pattern that capitalizes on the ongoing psychological patterns of
investors, traders, and institutions. Basically, the setup looks for an extreme pattern of selling pressure and then
looks to fade this behavior to capture a bullish move higher (reverse for shorts). In essence, this setup is visually
pointing out oversold and overbought scenarios that forces responsive buyers and sellers to come out of the dark
and put their money to work-price has been over-extended and must be pushed back toward a fair area of value
so two-sided trade can take place.
This setup works because many normal investors, or casual traders, head for the exits once their trade
begins to move sharply against them. When this happens, price becomes extremely overbought or oversold,
creating value for responsive buyers and sellers. Therefore, savvy professionals will see that price is above or
below value and will seize the opportunity. When the scared money is selling, the smart money begins to buy, and
Vice versa.
Look at it this way, when the market sells off sharply in one giant candlestick , traders that were short
during the drop begin to cover their profitable positions by buying. Likewise, the traders that were on the
sidelines during the sell-off now see value in lower prices and begin to buy, thus doubling up on the buying
pressure. This helps to spark a sharp v-bottom reversal that pushes price in the opposite direction back toward
fair value.
Engulfing (Outside) Reversal
The power behind this pattern lies in the psychology behind the traders involved in this setup. If you have
ever participated in a breakout at support or resistance only to have the market reverse sharply against you, then
you are familiar with the market dynamics of this setup. What exactly is going on at these levels? To understand
this concept is to understand the outside reversal pattern. Basically, market participants are testing the waters
above resistance or below support to make sure there is no new business to be done at these levels. When no
initiative buyers or sellers participate in range extension, responsive participants have all the information they
need to reverse price back toward a new area of perceived value.
As you look at a bullish outside reversal pattern, you will notice that the current bar's low is lower than the
prior bar's low. Essentially, the market is testing the waters below recently established lows to see if a downside
follow-through will occur. When no additional selling pressure enters the market, the result is a flood of buying
pressure that causes a springboard effect, thereby shooting price above the prior bar's highs and creating the
beginning of a bullish advance.
If you recall the child on the trampoline for a moment, you'll realize that the child had to force the bounce
mat down before he could spring into the air. Also, remember Jennifer the cake baker? She initially pushed price
to $20 per cake, which sent a flood of orders into her shop. The flood of buying pressure eventually sent the price
of her cakes to $35 apiece. Basically, price had to test the $20 level before it could rise to $35.
Let's analyze the outside reversal setup in a different light for a moment. One of the reasons I like this setup
is because the two-bar pattern reduces into the wick reversal setup, which we covered earlier in the chapter. If
you are not familiar with candlestick reduction, the idea is simple. You are taking the price data over two or more
candlesticks and combining them to create a single candlestick . Therefore, you will be taking the open, high, low,
and close prices of the bars in question to create a single composite candlestick .
Doji Reversal
The doji candlestick is the epitome of indecision. The pattern illustrates a virtual stalemate between buyers
and sellers, which means the existing trend may be on the verge of a reversal. If buyers have been controlling a
bullish advance over a period of time, you will typically see full-bodied candlesticks that personify the bullish
nature of the move. However, if a doji candlestick suddenly appears, the indication is that buyers are suddenly
not as confident in upside price potential as they once were. This is clearly a point of indecision, as buyers are no
longer pushing price to higher valuation, and have allowed sellers to battle them to a draw-at least for this one
candlestick . This leads to profit taking, as buyers begin to sell their profitable long positions, which is heightened
by responsive sellers entering the market due to perceived overvaluation. This "double whammy" of selling
pressure essentially pushes price lower, as responsive sellers take control of the market and push price back
toward fair value.
B3 Donchian CloudsThis is the Donchian Channel expressed with a percentage cloud. Default 12.5% of the range will be filled at each edge, this helps to show reversal possibilities as price returns to the area between the clouds. This offers a usage to essentially fade the turtle trader system. That system is loosely based on the playing of the breakouts of the the channel... as you can see the that last turtle trade long in YM1! was and is off the charts awesome. I will look for the fall out of the cloud to short the market.