ChartArt

Market Trend Strength (MTS) (by ChartArt)

See the current trend strength of the market. An additional filter makes trend consolidation areas visible. The color changes there each bar back and forth between green and red.

This area was interesting. Would have been a better example:


If the filter is deactivated the indicator shows the last measured price trend (green for up and down for red).


สคริปต์โอเพนซอร์ซ

ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?
study(title="Market Trend Strength (MTS) (by ChartArt)", shorttitle="CA_-_MTS", overlay=true)

// Version 1.0
// Idea by ChartArt on June 3, 2015.
//
// This indicator is measuring if there are two
// consecutive higher or lower prices. Therefore
// it measures the trend strength of the market.
// 
// The additional filter shows the trend before
// the trend changed the last time. This filter
// makes consolidation areas without a trend visible.
//
// List of my work: 
// https://www.tradingview.com/u/ChartArt/

switch=input(true, title="Show consolidation areas? (The color changes there each bar)")
ShowConsolidation = 2

GetBgColor =	iff( (hl2 > hl2[1]) and (hlc3 > hlc3[1]) and (close > close[1])  and  (hl2[1] > hl2[2]) and (hlc3[1] > hlc3[2]) and (close[1] > close[2]), 1, 
	            iff( (hl2 < hl2[1]) and (hlc3 < hlc3[1]) and (close < close[1])  and  (hl2[1] < hl2[2]) and (hlc3[1] < hlc3[2]) and (close[1] < close[2]), -1, nz(GetBgColor[switch?ShowConsolidation:1], 0) ))

SelectBgColor = GetBgColor == -1 ? red: GetBgColor == 1 ? green: na

bgcolor(SelectBgColor, transp = 85)