EZ-Trend Scalping for Gold Futures in ThinkorSwim

uawgmsmco

New member
Long time lurker, first time poster.

*I came across this "EZ Trend" indicator a couple months back that was put together by @BenTen * I've turned your indicator into a strategy and I'm very grateful for your work!

- Let me start off by saying that I consider this an aggressive scalping strategy. It suits me very well, but maybe not others. I'm using this strategy on a 5-tick range bar chart, and sometimes it's even too aggressive for me as the bars can form faster than you can react, so you may have to switch to a 7-tick or 10-tick range chart depending on price action.

- I have slightly modified the original indicator. The original indicator plotted the difference of I believe an 8-period EMA and a 13-period EMA. I've experimented with many different types of MA's for this strategy, but eventually ended up back at the EMA, but using the difference of 13-EMA and the 21-EMA.

- There is NO REPAINTING. The only time you will see what could be considered repainting is when the Data line of the indicator is hovering on the zero line, and even then, you'll only have one or two candles at most that could flicker back and forth between green and red.

- It has alerts.

- The code and chart I'm sharing is catered towards Gold Futures (/GC). It may or may not backtest well on other commodities or equities. Play around. Experiment.

- Lastly: Open up the strategy settings and turn off the plots for it to display properly.

3cwjolp.png


Strategy:
Code:
# EZ Trend & Momentum strategy
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/IzvxaVhB-ROMI2/



def s2 = MovAvgExponential(close, 13) - MovAvgExponential(close, 21);

plot line = s2;
plot ZeroLine = 0;

line.AssignValueColor(if s2 <= 0 then Color.RED else Color.GREEN);

AssignPriceColor(if s2 <= 0 then Color.RED else Color.GREEN);

Alert(s2 crosses above ZeroLine, "Cross above 0", Alert.BAR, Sound.Ring);
Alert(s2 crosses below ZeroLine, "Cross below 0", Alert.BAR, Sound.Bell);


AddOrder(OrderType.BUY_AUTO, s2 crosses above ZeroLine, tickcolor = GetColor(1), arrowcolor = GetColor(1), name = "LE");
AddOrder(OrderType.SELL_AUTO, s2 crosses below ZeroLine, tickcolor = GetColor(2), arrowcolor = GetColor(2), name = "SE");

Lower indicator:
Code:
# EZ Trend & Momentum
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/IzvxaVhB-ROMI2/

declare lower;



def s2 = MovAvgExponential(close, 13) - MovAvgExponential(close, 21);

plot line = s2;
plot ZeroLine = 0;

line.AssignValueColor(if s2 <= 0 then Color.RED else Color.GREEN);

AssignPriceColor(if s2 <= 0 then Color.RED else Color.GREEN);

Chart link:
https://tos.mx/BxWTASl
 
Last edited:

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

unknown.png

@BenTen is the strategy buying and selling 500 contracts?

Code:
AddOrder(OrderType.BUY_AUTO, s2 crosses above ZeroLine, tickcolor = GetColor(1), arrowcolor = GetColor(1), name = "LE");
AddOrder(OrderType.SELL_AUTO, s2 crosses below ZeroLine, tickcolor = GetColor(2), arrowcolor = GetColor(2), name = "SE");

I got the code here, so if i want to change the 500 contracts to lets say 1 what do I do? (i tried entering a ",1" but it ruined the entire thing)
 
@television You actually don't need to touch the code at all. See the little half-empty beaker towards the top-right corner of your screen? The one next to the gear icon. Click it. Then click on "Global Strategy Settings" on the bottom-left corner of the small window that pops up. There is where you adjust the amount of contracts. In this setting, the term "contracts" is used interchangeably with Shares, in case you use this or other strategies on equities.
 
i never could get to show up on my charts last night i copied paste the code but no luck and I know nothing about coding
I got it to show up on my chart. a simple stupid mistake on my part. THANKS !
 
Last edited:
@uawgmsmco @Brad It is "alright" on an ES time based chart, but I would recommend using it on ES tick or range based charts as the best results for that asset while volatility is as high as it is
 
@uawgmsmco @Brad It is "alright" on an ES time based chart, but I would recommend using it on ES tick or range based charts as the best results for that asset while volatility is as high as it is
Yep I agree. Same reason why I eventually settled on range bars for this strategy when trading /GC. But feel free to change the moving averages within the code and you may get better results. My original post was catered more towards all the recent activity in gold, so.

Cheers
 
@tradebyday @uawgmsmco I haven't used the tick or range before. I use Candlestick currently, however, I prefer using 15/30 minute chart. What would you recommend for the tick or range chart to use?
 
@tradebyday @uawgmsmco I haven't used the tick or range before. I use Candlestick currently, however, I prefer using 15/30 minute chart. What would you recommend for the tick or range chart to use?
As I said in the title and description of this post, this particular strategy is catered towards Gold futures. Feel free to check it out on other tickers and check out the strategy report. Experiment with it.
 
Thank you very much for posting this. Always great to see a new tool for the toolkit. I am going to test this out in a few indexes in the coming week.
 
I do have a question for those more experienced with trading these scalping time frames - are there any resources you might recommend to those of us learning more about them?
 
@uawgmsmco @BenTen I was able to be at my computer Monday and took my account to the plus side for the first time using the scalper on the micro E-mini. Using 5 ema and 13 ema on a 3 minute chart . In the past i wasn't able to use the scalper because i traded from my phone. That brings me to my next question. Would you have any suggestion on anything similar to this i could use on an Iphone or how to code this for an Iphone. The lower indicator works on the phone. Thank you
 
@Brad Congrats, glad you're doing good. Are you saying the exponential moving average doesn't work on your phone?
 

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
520 Online
Create Post

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