Ehlers Simple Cycle For ThinkOrSwim

wpnet50

New member
Plus
HfRKqmZ.jpeg

Ehlers Simple Cycle
Based on https://www.tradingview.com/script/xQ4mP4kc-Ehlers-Simple-Cycle-Indicator-LazyBear/
This should work well with Ehlers Instantaneous Trend [LazyBear].

mod note:
Momentum Direction (The Crossover Signal)

primary trading signal generated by the crossing of the two lines.
Signal TypeEhlers Cycle LineCloud ColorTrading Interpretation
Bullish SignalCrosses Above Lagging LineGreenUpward Momentum: Market is entering the rising phase of its cycle. Consider a Long entry confirmation.
Bearish SignalCrosses Below Lagging LineRedDownward Momentum: Market is entering the falling phase of its cycle. Consider a Short entry confirmation.

Strength and Amplitude (Cycle Position)
tells you about the conviction behind the current move.
Relative to ZeroCycle AmplitudeTrading Interpretation (Risk/Opportunity)
Far from the Zero Line (Highly Positive or Highly Negative)Cycle Exhaustion ZoneHigh Entry Risk. The momentum is well-established but may be reaching exhaustion. Avoid new entries in the direction of the cycle; instead, focus on managing existing trades or preparing for a potential reversal.
Near the Zero LineCycle Rest/Reset ZonePremium Entry Zone / Low Risk. The momentum has paused, and the cycle is "resetting." This is the ideal area to look for low-risk entries when the cycle confirms a new direction.


Strategy Idea: Cycle Confirmation Trading
  1. Define Your Primary Signal (The Entry Zone): Identify a key area on the price chart.
    • Example: Price successfully bounces off a strong Support Level or breaks above a previous resistance level.
  2. Look for Ehlers Cycle Confirmation (The Trigger): Wait for the indicator in the lower pane to align with your primary signal.
    • Long Entry (Buy): Wait for the price to show a bullish action AND the Ehlers Cycle line to cross above the Lagging Cycle line (or the cloud to turn Green). This confirms that upward momentum is now aligned with your entry zone.
    • Short Entry (Sell): Wait for the price to show a bearish action AND the Ehlers Cycle line to cross below the Lagging Cycle line (or the cloud to turn Red). This confirms downward momentum.
Key Considerations for Day Trading:
  • Timeframe: Ehlers indicators work well on shorter timeframes (e.g., 5-minute or 15-minute charts) for day trading. Be aware that the signals will be frequent and you must filter them with your primary signal.
  • Input 'a': The input a = 0.07 is a smoothing factor. A smaller number makes the indicator more sensitive (more signals, more noise); a larger number makes it smoother (fewer signals, more lag). You can adjust this in the indicator settings if you find it too noisy.
  • Exit Strategy: The cycle crossing back to the opposite color (Green to Red or Red to Green) can serve as an early warning that the momentum is reversing, which you can use as a signal to tighten your stop-loss or take partial profits.
Code:
# sh_WP_Ehlers_Cycle
# Lower study, prints Ehlers Cycle, should work well with Elhers Instantanous Trend
# Based on https://www.tradingview.com/script/xQ4mP4kc-Ehlers-Simple-Cycle-Indicator-LazyBear/
# created by wpnet50 12/14/2025

#DECLARATIONS
declare lower;
declare once_per_bar;


#USER INPUTS
input src = hl2;
input a = 0.07;
input showCL = yes;
input colorLN = yes;
#input showArr = yes;
#input colorBars = yes;

# GLOBAL COLORS
DefineGlobalColor("Green", CreateColor(0,255,0));
DefineGlobalColor("BGreen", CreateColor(34,208,104));
DefineGlobalColor("DGreen", CreateColor(6,18,52));
DefineGlobalColor("BRed", CreateColor(242,58,110));
DefineGlobalColor("DRed", CreateColor(146,6,44));
DefineGlobalColor("DGray", CreateColor(87,78,80));
DefineGlobalColor("BGray", CreateColor(138,128,132));

DefineGlobalColor("SRed", CreateColor(176,18,80));
DefineGlobalColor("SGreen", CreateColor(12,134,94));

# CALCULATIONS
def smooth = if BarNumber() < 3 then src else if BarNumber() > 3 then (src + 2 * src[1] + 2 * src[2] + src[3]) / 6.0 else smooth[1];
def init = if BarNumber() > 2 then (src - 2 * src[1] + src[2]) / 4.0 else init[1];

def cycleA = if BarNumber() < 3 then src else if BarNumber() < 7 then init else if BarNumber() > 6 then
(1 - 0.5 * a) * (1 - 0.5 * a) * (Smooth - 2 * Smooth[1] + Smooth[2]) + 2 * (1 - a) * cycleA[1] - (1 - a) * (1 - a) * cycleA[2] else cycleA[1];


#PLOTS
plot elhC = cycleA;
elhC.AssignValueColor(if colorLN then if cycleA > cycleA[1] then GlobalColor("DGreen") else if cycleA < cycleA[1] then GlobalColor("DRed") else GlobalColor("DGray") else color.CURRENT);
elhC.HideTitle();
elhC.HideBubble();
elhC.SetLineWeight(1);

plot lagC = cycleA[1];;
lagC.AssignValueColor(if colorLN then if cycleA > cycleA[1] then GlobalColor("DGreen") else if cycleA < cycleA[1] then GlobalColor("DRed") else GlobalColor("DGray") else color.CURRENT);
lagC.HideTitle();
lagc.HideBubble();
lagC.SetLineWeight(1);

def zero_level = 0;
plot ZeroLine = zero_level;
ZeroLine.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ZeroLine.SetDefaultColor(GlobalColor("DGray"));
ZeroLine.SetLineWeight(1);

#CLOUD
AddCloud(if showCL then elhC else Double.NaN, if showCL then lagC else Double.NaN, GlobalColor("BGreen"), GlobalColor("BRed"));
 
Last edited by a moderator:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
589 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top