EZ-Trend Scalping for Gold Futures in ThinkorSwim

@Brad Ahh I see, that makes sense. Backtesting strategy will not work on the mobile app.
 
@bcnhill Sorry it's taken so long to reply! As far as resources, you can find plenty of videos on YouTube that would explain exactly how Range bars are formed. They're my preferred type of candle because they omit time as a factor in the creation of the bars. Strictly price action baby! They're similar to Renko bars, yet have distinct and important differences.

 
@uawgmsmco Thank you very much, I will review this video. I have been testing this set up, and like it so far. The chart type is somewhat new to me, but seems like you get some very interesting looks. I do think this shows promise in other markets besides Gold.

Thanks again!
 
@Brad Hi brad, can you share bit more details on how you are using this on the Eminis?
@uawgmsmco how do you use the bottom indicator? IF for instance, its showing up as Long, do I confirm with the trend indicator to see if its green yet ?
 
@tshirt99 This is a backtesting strategy. If you want alerts, you can get it via the original indicator. What you can do is setup a scanner for the EZ-Trend indicator, save it as a watchlist, and then select the option called "Alert when scan results change..."
 
From looking at the code, this appears to be a 13 and 21 EMA crossover strategy on the 5 Range chart, this might be a little too simple to trade with by itself and make too many trades a day, but may add on as a trend filter to other strategies.

WARNING FOR RANGE CHARTS:
On TOS, when a new range bar forms the first price of the new bar you see is one tick above the open (the close of the prev bar) if the previous bar was an up bar and one tick below the open (the close of the prev bar) if the prev bar was a down bar.
I know this sounds pretty daft, but this is especially important for range charts since it is not visually apparent unless you actually sit with the charts.
What this means is the results are inflated by one tick per order, so if this strategy places 50 orders(25 trades) a day then it is inflated by $500.
Furthermore, you have not accounted for slippage, which for popular futures(index, metals, crude) is generally one tick per order during RTH.
So in reality, the backtested results are inflated by a minimum of 2 ticks per order and we haven't even accounted for commission folks(so maybe $25 per order on GC)!
Again, this sounds pretty apparent but not heeding this could lead to a lot of head pounding, time waste and frustration when your strat makes an average of 4 ticks a trade in backtest but is a total loser in real life.

tldr; account for 2 ticks less per order when working on range charts.
 
I have a fundamental question. Do these buy/sell trades automatically execute when the strategy is loaded on the chart?
 
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
what stop loss you use for this
 
I'm glad to see an indicator that doesn't repaint. It would be cool if we could put together a thread with a list of strats/scripts that don't repaint.
 
anyone can help to pull the report with Profit target and stop loss. I want to see PT 3 points with 2 point stop loss with 10 tick settings
 
View attachment 1683
@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)
I imported this into strategies, turned off plots and it is showing as a straight line. Any suggestions?
 
@bcnhill Sorry it's taken so long to reply! As far as resources, you can find plenty of videos on YouTube that would explain exactly how Range bars are formed. They're my preferred type of candle because they omit time as a factor in the creation of the bars. Strictly price action baby! They're similar to Renko bars, yet have distinct and important differences.

Hi,Bro Do you have E2-Trend scalping for Gold version update 2024, Give me indicators or script please.
 

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

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
562 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