Variable Fractals For ThinkOrSwim

wpnet50

New member
VIP
VariableFractals.jpg
I think that fractals are underutilized. I do not like standard fractals as they do not have much reliability.

# shared_WP_VL_BW_Fractals
# Created by WP on 8/30/2024
# Variable MA lenght fractals based on the concepts below
# reddit.com - custom_fractal_indicator_for_thinkorswim
# https://usethinkscript.com/threads/bill-williams-fractal-indicator-for-thinkorswim.600/page-2
# the red green arrows signify bill-williams fractal signal (needs more testing to show that they are reliable to make any profits)
# Looks promising but still needs more testing to verify its reliability of correct signals. Fractals have generally a poor reputation..
# 9/2/24, added RTH and volume filter

input fractal_length = 8;
DefineGlobalColor("UFR", CreateColor(161,0,102)); # red
DefineGlobalColor("DFR", CreateColor(0,153,153)); # green
def up_cond1 = high == Highest(high, fractal_length);
def up_cond2 = high > Highest(high, fractal_length)[fractal_length];
def up_cond3 = if close[-fractal_length] then high > Highest(high, fractal_length)[-fractal_length] else high > Highest(high, fractal_length);
def frac_up = up_cond1 && up_cond2 && up_cond3;

def down_cond1 = low == Lowest(low, fractal_length);
def down_cond2 = low < Lowest(low, fractal_length)[fractal_length];
def down_cond3 = if close[-fractal_length] then low < Lowest(low, fractal_length)[-fractal_length] else low < Lowest(low, fractal_length);
def frac_down = down_cond1 && down_cond2 && down_cond3;

# RTH and Volume filter
def myRTH = secondsFromTime(0945) >= 0 and SecondsTillTime(1545) >= 0;
input length = 12; #1.5 * fractal_length for now
def Vol = volume;
def VolAvg = Average(volume, length);
def abVol = Vol > VolAvg;
plot upF = if frac_up and myRTH and abVol then high + (25*TickSize()) else double.NaN;
plot downF = if frac_down and myRTH and abVol then low - (25*TickSize()) else double.nan;

upF.SetPaintingStrategy(paintingStrategy.ARROW_DOWN);
upF.SetDefaultColor(GlobalColor("UFR"));
upF.SetLineWeight(4);
downF.SetPaintingStrategy(paintingStrategy.ARROW_UP);
downF.SetDefaultColor(GlobalColor("DFR"));
downF.SetLineWeight(4);
 
Last edited:

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
310 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