# The Symmetry Wave Trading Method

#### john88

##### New member
VIP
RE: Finally a Better Elliott Wave that Doesn't Repaint and Makes Sense
https://www.optuma.com/blog/want-to-know-a-better-way-to-determine-trend

Hello, would someone please code the above?

It's a simple concept that seems to make a lot of sense. The link has all the details. My coding skills are embarrassingly limited, I'm still learning, but I coded this for an intraday chart, which is just something to get started, but not how it should be implemented.
Ruby:
``````input length = 4;
input averageType = AverageType.WILDERS;

def ATR = MovingAverage(averageType, TrueRange(high(period=”DAY”)[1], close(period=”DAY”)[1], low(period=”DAY”)[1]), length);

plot DailyHigh = high(period=”DAY”)[1];
plot D_High_MinusATR = dailyhigh - ATR;

plot DailyLow = low(period=”DAY”)[1];
plot D_Low_PlusATR = dailylow + ATR;``````

Last edited by a moderator:
It seems I improved the initial code a little, but cannot figure out how to plot the swing lines.
Ruby:
``````input length = 4;
input averageType = AverageType.WILDERS;

# Calculate ATR using a specified moving average
def ATR = MovingAverage(averageType, TrueRange(high(period = "DAY")[1], close(period = "DAY")[1], low(period = "DAY")[1]), length);

# Define Daily High and Daily Low minus/plus ATR respectively
def DailyHigh = high(period = "DAY")[1];
def D_High_MinusATR = DailyHigh - ATR;

def DailyLow = low(period = "DAY")[1];
def D_Low_PlusATR = DailyLow + ATR;

# Initialize "ZigZag" plotting
rec isUpTrend = if close > D_Low_PlusATR and close[1] <= D_Low_PlusATR[1] then 1 else if close < D_High_MinusATR and close[1] >= D_High_MinusATR[1] then 0 else isUpTrend[1];
rec lastPivot = CompoundValue(1, if (isUpTrend and isUpTrend[1] == 0) or (!isUpTrend and isUpTrend[1]) then close else lastPivot[1], close);
plot line = lastPivot;
line.EnableApproximation();

# Set line properties for visualization
line.SetDefaultColor(Color.CYAN);
line.SetStyle(Curve.FIRM);
line.SetLineWeight(1);``````

Last edited by a moderator:

87k+ Posts
379 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

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?