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:

television

Member
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)
 

uawgmsmco

New member
@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.
 

Brad

New member
Lifetime
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:

tradebyday

Active member
@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

New member
@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
 

Brad

New member
Lifetime
@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?
 

uawgmsmco

New member
@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.
 

bcnhill

New member
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.
 

bcnhill

New member
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?
 

Brad

New member
Lifetime
@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
 

BenTen

Administrative
Staff
VIP
@Brad Congrats, glad you're doing good. Are you saying the exponential moving average doesn't work on your phone?
 

Similar threads

Top