clocks156t174

scalping against trapped countertrend

Abstract
This script attempts to find the end of countertrend.
This script uses oscillators to measure long term and short period trends. When the long term trend keeps positive and clear short term period is over, this script provides a buy signal.
This script does not contain pullback, cut loss and re-enter. You need to add it manually.

Introduction
Many traders want to buy when long term trend is bullish and short term pullback is over.
This is because we can take advantage to the emotion of countertrend traders.
Countertrend traders realizes their profit is finite and therefore want to protect their profit well and limit their loss.
This script is inspired by a searchable trading strategy video.
The video mentioned 4 points.
(1) long term trend. The video did not spend much ink on this point. You can use any method to observe.
(2) clear pullback bar (at least 50% body)
(3) weak bar after clear pullback
(4) entry trigger buy stop
This script attempts to quantize these points to determine trading direction.
This script is originally designed for timeframes lower than examples in the video but you can apply it on any timeframe.

Computing and Adjusting
(1) long term trend
This script uses smoothed stochastic.
(2) clear pullback bar
Since this script is originally designed for timeframes lower than examples in the video, so the condition becomes:
RSI is low enough
(3) weak bar after clear pullback
RSI goes back from low level.
(4) entry trigger buy stop
This script does not include this condition.
You can decide enter when buy stop or pullback.

Parameters
x_src : the value for computing oscillators
x_len_a : how many bars for measuring short term trend
x_len_b : how many bars for measuring long term trend
x_k_b : smooth long term trend, the average value of stochastic values
x_changk = check if clear short term pullback appears recently. 1 means do not use, larger numbers means how long of periods to check.
x_rsi_ct : threshold of short term pullback clear
x_rsi_ft : threshold of short term pullback end

Reading numbers in Strategy Tester
Most possible loss :
(1) to find rational pullback. Generally 1/3 to 2/3 atr.
(2) to find cut loss distance. Generally 1 to 2 atr.
Most possible profit :
to find if trading the opposite direction against this script is profitable.

Conclusion
This script can suggest us trading direction.
Waiting for pullback can reduce risk, compared to buy stop.
This script does not provide good signals in sideways markets.

Reference
A searchable trading strategy video
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?