Half Trend (Halftrend) Scalper Indicator for ThinkorSwim

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

How have experiences been using this indicator? Just saw this indicator today and it looks very promising (especially if it does not repaint)
 
How have experiences been using this indicator? Just saw this indicator today and it looks very promising (especially if it does not repaint)
I stumbled upon this last night as I couldn't sleep after eating too much at Thanksgiving yesterday. After being away from my computer most of the morning I came back and implemented it and went 3 for 3 trading CL futures. Not sure I'm using this right however...basically I didn't go long or short until price had crossed the Half Trend Line and used a few other things for context. I did not like the Up/Down signal arrows as they appeared to get you into a trade late
 
When I add this indicator to a chart of the Treasury Notes (/ZNH22), sometimes I get a value of 0 for it, and that makes for a messed-up chart. I can't tell what is causing this, because it happens on some time frames and not others, and it can disappear when adding in more data at times but not at other times. Example: if I create a 5-minute chart with 5 days of data, it's messed up. This error always happens right at the beginning of the plotting of the indicator.

Interesting, that works for me now as well, but 10 days of 30-minute and 30 days of 30-minute does not.
 
Last edited by a moderator:
When I add this indicator to a chart of the Treasury Notes (/ZNH22), sometimes I get a value of 0 for it, and that makes for a messed-up chart. I can't tell what is causing this, because it happens on some time frames and not others, and it can disappear when adding in more data at times but not at other times. Example: if I create a 5-minute chart with 5 days of data, it's messed up. This error always happens right at the beginning of the plotting of the indicator.

Interesting, that works for me now as well, but 10 days of 30-minute and 30 days of 30-minute does not.
When putting indicators on your chart, you need to provide enough bars for the equations of the script to work.
In this case, use 90d30min
7NtWS8L.png
 
Yes, 90 days of 30-minute data works and 30 days of 30-minute data does not work. Which means stepping it down even further to 20 days of 30-minute data should not work, yet it does. There is even less data on the 20 day chart, yet it works. Even selecting 15 days works. There are a few zeros at the beginning of the calculations when it is not working.

Here is where I got this indicator:

https://usethinkscript.com/threads/half-trend-halftrend-scalper-indicator-for-thinkorswim.3305/
 
Last edited by a moderator:
Current amplitude is set to a whole number (1,2,3). I tried to change it to a decimal value .5, but there is no change. Wondering if the script can be altered to accept decimal to have it be more finite or whole number is best it can adjust to? thanks
 
Last edited by a moderator:
Current amplitude is set to a whole number (1,2,3). I tried to change it to a decimal value .5, but there is no change. Wondering if the script can be altered to accept decimal to have it be more finite or whole number is best it can adjust to? thanks
The 'amplitude' in this particular script is the lookback number and the length.
The ToS platform does not provide to look back 3 1/2 bars nor for a moving average length of 3 1/2.
So in this particular script, that variable must remain a whole number.
 
Last edited:
Has anyone found a way to stop the red line that goes to the edge? I have tried everything that I could find here, and even deleted and
reloaded it but cannot fix it.
Can't add anything more to @BenTen's advice which you already quoted in your post.
 
Last edited:
Can't add anything more to @BenTen's advice which you already quoted in your post.

@jaymac

i think i found an alternate solution. change the following line:
halftrend.AssignValueColor(if trend == 0 then color.green else color.red );
halftrend.setDefaultColor(color.white);


the line will default to white or default color until trend changes.

also, if you want a little more play in response , i separated the amplitude (period) for average with the following.
add:
input AmpAvg = 1;
change:
lowma = average(low, AmpAvg);
highma = average(high, AmpAvg);
 
Last edited:

@jaymac

i think i found an alternate solution. change the following line:
halftrend.AssignValueColor(if trend == 0 then color.green else color.red );
halftrend.setDefaultColor(color.white);


the line will default to white or default color until trend changes.

also, if you want a little more play in response , i separated the amplitude (period) for average with the following.
add:
input AmpAvg = 1;
change:
lowma = average(low, AmpAvg);
highma = average(high, AmpAvg);
can you update this somewhere and post a link to this new version?
 
any time mobius writes something, it's always a good idea to go to the ToS One Note file and see what a search on the study brings up. in the case of this here half trend, what you find is this:


17:12 AlphaInvestor: Mobius - took some digging in the archives, but that PRC_Halftrend_Indicator looks interesting
17:12 AlphaInvestor: kinda like a Supertrend in a way
17:13 Mobius: Looks can be deceiving. I ran some Q&D backtests on it and its no better than a moving average
17:13 AlphaInvestor: thanks for that info. I will file that one away
17:13 Mobius: yep
17:14 AlphaInvestor: it WAS an interesting coding exercise
17:14 Mobius: yep
17:14 UpTheCreek: based on when it changes color?
17:14 UpTheCreek: *strategy that is
17:14 MD2201: Alpha lurking
17:14 Mobius: I ran them both as price crossing and changing direction
17:15 Mobius: But it does look good on a chart. And afterall that's what is really important. Hell I ignore most of what's on my charts anyway :)
17:16 AlphaInvestor: It does look snazzy
17:17 Mobius: I does make me feel warm and fuzzy when I get signals from everthing on my charts to buy about 4 bars after I bought.
 
any time mobius writes something, it's always a good idea to go to the ToS One Note file and see what a search on the study brings up. in the case of this here half trend, what you find is this:
You don't need to go to One Note to find out that
  • all moving averages provide the same information.
  • all moving averages lag 1/2 their length.
It doesn't make this and other moving average indicators useless.
It means:
  • moving averages are not optimal for signaling entries or exits
  • one moving average indicator on a chart is more than enough
  • no indicator should be used in isolation
  • moving averages of some type are still the standard for confirming trend
Mobius stated in the 1st post. He created the indicator for the challenge. No, he does not use it.
The Half Trend is for scalping. He is not a scalper nor a day trader and neither is anyone that was quoted in the above post.
 
Last edited:
"moving averages are not optimal for signaling entries or exits" -- and yet so many indicators are based on MAs one way or ta other. i mean, most everything lags to one degree or another, meaning most everything is not optimal and right now, in today's climate, i can't think of anything trend following that works. it's all chop chop chop.
 
Can someone help me please?
Do the five-minute time frames not work conditional buy and sell orders, according to the study?

I don't know more details, but this is one of the buy/sell orders that I missed. It works for one minute and does not work for five minutes. I'm trying to send a picture, but I don't know how +20 TQQQ MKT GTC WHEN

TQQQ STUDY '{tho=true};AMIR_HALFTREND1("amplitude" = 2)."UpSignal" from 1 bars ago is true;5m' IS TRUE.
 
Last edited by a moderator:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
414 Online
Create Post

Similar threads

Similar threads

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