NexusFi: Find Your Edge


Home Menu

 





Identify Descending Rectangles Utilizing ADX & Scan Them


Discussion in ThinkOrSwim

Updated
    1. trending_up 2,068 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

Identify Descending Rectangles Utilizing ADX & Scan Them

  #1 (permalink)
SinSanDiego
Del Mar, CA
 
Posts: 4 since Mar 2021
Thanks Given: 2
Thanks Received: 0

Somewhat surprising to see ThinkOrSwim affords the user the capacity to identify rectangle chart patterns but not descending (or ascending) rectangle chart patterns, especially as descending and ascending triangles are included in that software. I am looking for the capacity to identify and scan a list of stock symbols for descending rectangles. Is this feasible? Can I pay an adroit user here to create this function in ThinkOrSwim using the parameters as follows:

Falling rectangle defined: formed when prices trace lower highs and lower lows but remain confined within a narrow range. In the case of rising rectangles, prices form higher highs and higher lows while remaining within a narrow range.

During the formation of a falling rectangle, prices should remain closely within a narrow range defined by 5% standard deviation above or below the 20-period simple moving average --as measured with Moving Average Envelope parameters (20,5), resulting in two curves outlining the upper and lower boundaries. Prices are required to fall within these boundaries most of the time for a falling rectangle pattern to be established.

The stock should be non-trending in technical terms during the formation of the falling rectangle. Although the establishment of lower highs and lower lows indicates a visual down trend, the stock should have an Average Directional Movement of below 20 (ADX<20) during the formation of the rectangle.

The duration of time of the falling rectangle should be at least 15 trading days. The longer the time a stock stays in a falling rectangle formation, the more explosive and profitable the move is likely to be.

I'm looking for falling rectangles where prices do not stray more than 5% from the moving average 70% of the time or more.

Is this feasible? Thank you for any insights.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Better Renko Gaps
The Elite Circle
Deepmoney LLM
Elite Quantitative GenAI/LLM
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
38 thanks
NexusFi site changelog and issues/problem reporting
27 thanks
GFIs1 1 DAX trade per day journal
19 thanks
The Program
18 thanks
  #2 (permalink)
 JayC 
San Diego, CA
 
Experience: Beginner
Platform: TOS, Sierra
Trading: Emini ES, Crude CL
Posts: 55 since Mar 2019
Thanks Given: 9
Thanks Received: 43

I tried to implement your request, but I don't think it does what you were looking for. The MA envelope ends up including a lot of the price moves, and it depends highly on the price and range. ADX also doesn't seem to be great at identifying non-trends. Instead of explicit lower lows and lower highs, I used the IsDescending function, which is a regression slope, which should be more forgiving than explicitly checking each low/high. Anyway, try this code and see if it helps.

JayC

 
Code
input envLength = 20;
input envPct = 5;
input maxADX = 20;

def fallingHighs = IsDescending(high, 14);
def fallingLows = IsDescending(low, 14);
def downtrend = fallingHighs and fallingLows;

plot sma = Average(close, envLength);

plot upperCurve = sma * (1 + (envPct / 100));
plot lowerCurve = sma * (1 - (envPct / 100));

def adx = ADX(length = envLength);
def insideBounds = high < upperCurve && low > lowerCurve;
def qualified = adx < maxADX and insideBounds and downtrend;

def sumQualified = Sum(qualified, 14);
AddChartBubble(sumQualified >= 14, high, "Qualified");

AssignPriceColor(if qualified then Color.CYAN else Color.CURRENT);

Reply With Quote
Thanked by:
  #3 (permalink)
SinSanDiego
Del Mar, CA
 
Posts: 4 since Mar 2021
Thanks Given: 2
Thanks Received: 0


Thank you JayC. Does this sort of thing interest you? If so, I will try to work on using a different indicator than ADX and will post here if I find something useful.

Reply With Quote
  #4 (permalink)
 JayC 
San Diego, CA
 
Experience: Beginner
Platform: TOS, Sierra
Trading: Emini ES, Crude CL
Posts: 55 since Mar 2019
Thanks Given: 9
Thanks Received: 43

Mainly I enjoy solving these requests as puzzles, regardless of their value to me for trading.

While I think scanning for consolidation areas would be useful, not sure if there’s any edge there alone. However, breakout setups have been on my research list lately.

The ttm squeeze indicator has been used in the past, and there’s plenty of articles on that. Coming up with something custom might be nice, but I think breakouts are tough to execute well, and that’s where I assume the edge is.

If you have other ideas you want to try, let me know.

JayC

Reply With Quote




Last Updated on March 24, 2021


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts