อินดิเคเตอร์สำหรับ TradingView · แสดงในหน้าต่างของตัวเองTradingView indicator · draws in its own pane
OBV Consolidation Zones v1.0.0
อินดิเคเตอร์นี้วาด On Balance Volume (OBV) ในหน้าต่างใต้กราฟราคา แล้วเพิ่มสามโมดูลบนเส้นนั้น: Consolidation ตีกรอบช่วงที่ OBV เดินออกข้างแคบกว่าปกติของตัวเอง และบอกเมื่อ OBV หลุดออกจากกรอบ (ส่วนหลักของอินดิเคเตอร์) Divergence หาไดเวอร์เจนซ์ระหว่าง OBV กับราคาจากจุดกลับตัวของ OBV และ Smoothing MA เส้นเฉลี่ยของ OBV พร้อมแถบเบี่ยงเบนที่เปิดได้ alert ทั้งหมดส่งผ่าน alert ตัวเดียว ต้องใช้กราฟที่มีข้อมูล volume ถ้าสินทรัพย์ไม่มี volume อินดิเคเตอร์จะหยุดพร้อมข้อความแจ้ง กราฟทุกอันในหน้านี้เป็นกราฟจริงที่กดได้: ราคาอยู่ด้านบน หน้าต่างของ OBV อยู่ด้านล่าง เลื่อนเมาส์ไปบนแท่งไหน ค่าในหน้าต่าง OBV จะแสดงตามแท่งนั้น กด ตั้งค่า เพื่อเปิดแผงตั้งค่าแบบเดียวกับบน TradingViewThis indicator draws On Balance Volume (OBV) in a pane under the price chart and adds three modules on that line: Consolidation boxes the stretches where OBV moves sideways, tight for its own recent behaviour, and reports when OBV breaks out of a box (the core of the indicator); Divergence finds divergence between OBV and price from OBV's turns; Smoothing MA is a moving average of OBV with optional deviation bands. Every alert goes through one alert. It needs volume data: on a symbol without volume it stops with a message. Every chart on this page is live: price on top, the OBV pane below. Move the cursor over a bar to read that bar in the OBV pane, and press Settings for the same settings you have on TradingView.
ส่วนที่ 1Part 1
เส้น OBV และเส้นเฉลี่ยThe OBV line and its average
1โมดูลนี้คืออะไรWhat it is
OBV สะสม volume ตามทิศของราคาปิดแต่ละแท่ง จึงบอกว่า volume ไหลไปทางเดียวกับราคาหรือไม่ ระดับตัวเลขของ OBV ไม่มีความหมายในตัวเอง เพราะขึ้นกับว่ากราฟโหลดประวัติย้อนไปถึงไหน สิ่งที่อ่านได้คือรูปทรงและทิศของเส้น ตามค่าเริ่มต้นเส้นเปลี่ยนสีตามทิศของแท่งต่อแท่ง: เขียวอมฟ้าเมื่อ OBV สูงกว่าแท่งก่อน แดงเมื่อไม่สูงกว่า (รวมแท่งที่เท่าเดิม)OBV accumulates volume in the direction of each bar's close, so it shows whether volume is flowing with price. Its number means nothing on its own, because it depends on how far back the chart's history starts; what reads is the line's shape and direction. By default the line is coloured bar over bar: teal where OBV is above the previous bar, red where it is not (an unchanged bar included).
Smoothing MA คือเส้นเฉลี่ยของ OBV (ค่าเริ่มต้น EMA 14) เนื่องจากระดับของ OBV เปลี่ยนไปตามประวัติที่โหลด ตำแหน่งของ OBV เทียบกับเส้นเฉลี่ยของตัวเองจึงเป็นการอ่านเดียวที่ไม่ขึ้นกับระดับ เปิด Deviation bands ได้ เป็นแถบเหนือและใต้เส้นเฉลี่ยตามจำนวนส่วนเบี่ยงเบนมาตรฐานของ OBV ที่ตั้งไว้ บอกว่า OBV ยืดออกจากช่วงล่าสุดของตัวเองมากแค่ไหน แถบบรรทัดสถานะแสดงแค่ค่า OBV และเส้นเฉลี่ยThe Smoothing MA is a moving average of OBV (EMA 14 by default). Since OBV's level shifts with the history loaded, its position against its own average is the one reading that does not depend on the level. Deviation bands can be switched on: bands the chosen number of OBV standard deviations above and below the average, showing how far OBV is stretched against its own recent range. The status line shows OBV and the average only.
2อ่านบนกราฟยังไงReading it on the chart
- เส้น OBV เขียวอมฟ้า สูงกว่าแท่งก่อน แดง ไม่สูงกว่าแท่งก่อน หนา 2 พิกเซลThe OBV line teal, above the previous bar red, not above it; 2 px wide
- เส้นเฉลี่ย เส้นสีขาวโปร่งแสงบาง ค่าบนแกนขวาเป็นสีเทาThe average the thin translucent white line
- ปิดไว้ตามค่าเริ่มต้น Deviation bandsOff by default: Deviation bands
3ปรับแล้วได้อะไรWhat each setting changes
เรียงตามหน้าตั้งค่าบน TradingView ปุ่มสีทองในแต่ละข้อจะเปลี่ยนค่าบนกราฟด้านบนให้ดูทันทีIn the order TradingView lists them. The gold buttons change the chart above so you can see the effect.
OBV Lineสีของเส้นLine colour1
เปิด: สีตามทิศแท่งต่อแท่ง ขึ้นใช้สีแรก ไม่ขึ้นใช้สีที่สอง ปิด: เส้นสีน้ำเงินสีเดียวแบบ OBV ในตัวของ TradingViewOn: coloured bar over bar, rising in the first colour, not rising in the second. Off: one flat blue, as TradingView's built-in OBV.
Modulesสวิตช์ของเส้นเฉลี่ยThe average's switches2
เปิดปิดเส้นเฉลี่ย ปิดแล้ว alert การตัดเส้นเฉลี่ยก็ไม่ส่งShows the average. Off, the MA-cross alerts stop too.
ซ่อนเส้นเฉลี่ยบนไทม์เฟรมกราฟที่สูงกว่าค่านี้ ซ่อนแค่การแสดงผลและ alert การคำนวณยังทำงาน Off แสดงทุกไทม์เฟรมHides the average on chart timeframes above this one: display and alerts only, the calculation keeps running. Off shows it on every timeframe.
Smoothing MAเส้นเฉลี่ยและแถบAverage and bands2
ชนิดและความยาวของเส้นเฉลี่ย: EMA, SMA, WMA, RMA หรือ VWMA (ถ่วงด้วย volume) ความยาวเป็นจำนวนแท่งType and length of the average: EMA, SMA, WMA, RMA or VWMA (volume-weighted); the length is in bars.
แถบเหนือและใต้เส้นเฉลี่ย ห่างเท่าจำนวนส่วนเบี่ยงเบนมาตรฐานของ OBV ที่ตั้ง (ใช้ความยาวเดียวกับเส้นเฉลี่ย) พร้อมพื้นระหว่างแถบ ปิดไว้ตามค่าเริ่มต้นBands the chosen number of OBV standard deviations above and below the average (over the average's length), with a fill between. Off by default.
4ทดลองปรับค่าเองTry it
- เส้นเฉลี่ยแบบอื่นAnother average
เปลี่ยนเป็น SMA แล้ว 28 แท่ง เส้นจะช้าลงและ OBV ตัดผ่านน้อยลงSwitch to SMA, then 28 bars: the line slows and OBV crosses it less often.
- OBV ยืดแค่ไหนHow stretched OBV is
เปิดแถบ 2σ แล้วดูว่า OBV แตะขอบแถบบ่อยแค่ไหนSwitch the 2σ bands on and see how often OBV reaches their edges.
5จุดที่มักเข้าใจผิดCommon pitfalls
- ค่า OBV ไม่ตรงกับกราฟของคุณOBV does not match your chart's number
ระดับของ OBV ขึ้นกับประวัติที่โหลด กราฟตัวอย่างเริ่มนับจากข้อมูลชุดของมันเอง ตัวเลขจึงต่างจากบน TradingView ได้ แต่รูปทรงเหมือนกันOBV's level depends on the history loaded. The demo counts from its own data set, so the number can differ from TradingView's while the shape is the same.
- เส้นเฉลี่ยมองไม่เห็นบนพื้นสว่างThe average is hard to see on a light chart
เส้นเฉลี่ยเป็นสีขาวโปร่งแสง ถ้าใช้ธีมสว่าง เปลี่ยนสีได้ที่แท็บ StyleThe average is translucent white; on a light theme change its colour in the Style tab.
- ตัดเส้นเฉลี่ยบ่อยในช่วงออกข้างMany crosses in a sideways stretch
ตอน OBV เดินออกข้าง เส้นจะตัดเส้นเฉลี่ยไปมาหลายครั้ง กรอบ Consolidation สรุปช่วงนั้นเป็นการเบรกครั้งเดียวWhile OBV moves sideways it crosses its average again and again; the Consolidation box sums that stretch up as one break.
ส่วนที่ 2Part 2
กรอบ ConsolidationConsolidation boxes
1โมดูลนี้คืออะไรWhat it is
โมดูลนี้ตีกรอบช่วงที่ OBV เดินออกข้างแคบกว่าปกติของสินทรัพย์นี้ในช่วงหลัง ทุกแท่ง อินดิเคเตอร์ดูช่วงกว้างของ OBV ใน Window ล่าสุด (ค่าเริ่มต้น 50 แท่ง) เทียบกับค่าเฉลี่ยของช่วงกว้างในกรอบเวลาเดียวกันย้อนหลัง Lookback แท่ง (100) ถ้าแคบกว่าค่าเฉลี่ยคูณ Tightness (0.6) ถือว่าแคบ แล้วเปิดกรอบโดยใช้ OBV สูงสุดและต่ำสุดของ Window นั้นเป็นขอบ ขอบคงที่ตั้งแต่ตอนเปิดกรอบ ไม่ขยายตาม OBV เพราะถ้าขยายตามทุกครั้ง OBV จะไม่มีวันหลุดออก ไม่มีช่องตั้งความกว้าง การวัดเป็นสัดส่วนกับพฤติกรรมของ OBV เอง จึงใช้ได้กับทุกสินทรัพย์This module boxes the stretches where OBV moves sideways, tight for this instrument lately. On every bar it takes OBV's range over the last Window (50 bars by default) and compares it with the average range of such windows over the last Lookback bars (100); below that average times Tightness (0.6) counts as tight, and a box opens with the window's highest and lowest OBV as its edges. The edges are fixed when the box opens and do not follow OBV, because if they did OBV could never leave. There is no width setting: the test is a ratio against OBV's own behaviour, so it means the same on any instrument.
กรอบจะวาดและส่ง alert ได้ก็ต่อเมื่อมีอายุครบ Minimum bars (40) เมื่อ OBV ปิดนอกกรอบ กรอบจะหยุดไว้ชั่วคราว ถ้า OBV กลับเข้ามาภายใน Grace bars (6) กรอบจะเปิดต่อและขยายให้ครอบส่วนที่ออกไป (เบรกล้มเหลว) การเบรกจะยืนยันเมื่อครบ Grace bars แล้ว OBV ยังอยู่นอกกรอบ หรือเร็วกว่านั้นถ้า OBV ออกไปไกลกว่าขอบเกิน Confirm (0.75) OBV step หนึ่ง OBV step คือขนาดเฉลี่ยของการเปลี่ยนแปลงของ OBV ต่อแท่ง ประมาณ volume เฉลี่ยต่อแท่ง เบรกที่ยืนยันแล้วกรอบจะกลายเป็นกรอบที่จบแล้ว เก็บไว้ดูย้อนหลังได้ถึง Boxes retained (30)A box draws and can raise alerts only once it has lasted Minimum bars (40). When OBV closes outside, the box freezes provisionally; if OBV comes back inside within Grace bars (6) the box reopens and widens to take in the excursion (a failed break). The break confirms when the grace bars run out with OBV still outside, or sooner if OBV travels more than Confirm (0.75) OBV steps beyond the edge. One OBV step is the average size of one bar's OBV change, roughly the average bar volume. A confirmed break turns the box into a finished one, kept as a record up to Boxes retained (30).
2อ่านบนกราฟยังไงReading it on the chart
- กรอบที่กำลังก่อตัว สีม่วงอ่อน ขอบบนและล่างเป็นเส้นทึบ เส้นกลางเป็นเส้นประ ขยายไปถึงแท่งล่าสุดA forming box pale purple, solid top and bottom edges, a dashed midline, running to the latest bar
- กรอบที่จบแล้ว สีเทา จบที่แท่งที่ OBV หลุดออกA finished box grey, ending at the bar OBV left it
- ป้าย Consolidation อยู่ใต้ขอบบนกลางกรอบ แสดงเฉพาะกรอบที่จุดกึ่งกลางอยู่ภายใน 250 แท่งล่าสุดThe Consolidation label sits under the top edge, mid-box, only on boxes whose middle is within the last 250 bars
3ปรับแล้วได้อะไรWhat each setting changes
เรียงตามหน้าตั้งค่าบน TradingView ปุ่มสีทองในแต่ละข้อจะเปลี่ยนค่าบนกราฟด้านบนให้ดูทันทีIn the order TradingView lists them. The gold buttons change the chart above so you can see the effect.
Modulesสวิตช์ของโมดูลModule switches2
เปิดปิดโมดูล Consolidation ปิดแล้วกรอบและ alert ของกรอบหายทั้งหมดSwitches the Consolidation module; off, the boxes and their alerts go.
ซ่อนกรอบบนไทม์เฟรมกราฟที่สูงกว่าค่านี้ ซ่อนการแสดงผลและ alert การคำนวณยังทำงานHides the boxes above this chart timeframe: display and alerts only, the engine keeps running.
ConsolidationการหาและยืนยันกรอบFinding and confirming a box6
Window: จำนวนแท่งที่ใช้วัดช่วงกว้างของ OBV และเป็นด้านซ้ายของกรอบเมื่อเปิด Lookback: จำนวนแท่งย้อนหลังที่ใช้หาค่าเฉลี่ยของช่วงกว้างเพื่อเทียบWindow: the bars OBV's range is measured over, and where a new box starts. Lookback: the bars the average range is taken over for the comparison.
ช่วงกว้างต้องต่ำกว่าค่าเฉลี่ยคูณค่านี้จึงนับว่าแคบ 1.0 คือต่ำกว่าค่าเฉลี่ย ซึ่งเกิดราวครึ่งหนึ่งของเวลา ค่าน้อยลงเข้มขึ้น เป็นสัดส่วน จึงมีความหมายเหมือนกันทุกสินทรัพย์The range must sit below the average times this to count as tight. 1.0 is anything below average, roughly half the time; lower is stricter. A ratio, so it means the same on any instrument.
กรอบต้องมีอายุครบเท่านี้จึงวาดและส่ง alert ได้ นับเป็นเวลา (จำนวนแท่ง × ไทม์เฟรม) จากต้นกรอบ ช่วงที่ตลาดปิด เช่นสุดสัปดาห์ จึงนับรวมด้วยA box draws and alerts only once it has lasted this long. Counted as time (bars × the timeframe) from the box's start, so a market closure such as a weekend counts too.
เพดานความสูงของกรอบ เป็น OBV step 0 คือปิด การทดสอบความแคบเป็นสัดส่วน ช่วงที่ OBV แกว่งกว้างทั้งตลาดจึงอาจได้กรอบที่สูง ค่านี้ใช้ตัดกรอบแบบนั้นA ceiling on box height, in OBV steps; 0 is off. The tightness test is relative, so in a wide stretch a box can still be tall; this cuts those out.
Grace bars: จำนวนแท่งที่ OBV กลับเข้ามาได้หลังหลุดออก ถ้ากลับเข้ามา กรอบเปิดต่อและขยายครอบส่วนที่ออกไป Confirm: ระยะที่ OBV ออกไปเกินขอบ (เป็น OBV step) ที่ยืนยันการเบรกทันทีโดยไม่ต้องรอGrace bars: how long OBV may take to come back after leaving; if it does, the box reopens and widens over the excursion. Confirm: how far beyond the edge (in OBV steps) confirms the break at once, without waiting.
กรอบใหม่วัด Window ย้อนหลัง หลังเบรกจึงยังมีแท่งของกรอบเก่าอยู่ No overlap: กรอบใหม่เปิดได้เมื่อ Window ทั้งหมดอยู่หลังจุดเบรกแล้ว Merge into zone: ถ้ากรอบใหม่ซ้อนกรอบเก่าทั้งเวลาและราคา กรอบเก่าจะเปิดต่อและขยาย กลายเป็นโซนเดียว alert เบรกของกรอบเก่าที่ส่งไปแล้วจึงกลายเป็นเบรกหลอก ทั้งสองแบบกรอบไม่ซ้อนกันทางเวลาA new box measures its window backwards, so right after a break the window still holds the old box's bars. No overlap: a new box may form only once its whole window is after the break. Merge into zone: if the new box would overlap the old one in time and OBV, the old box reopens and widens into one zone, and its break alert, already sent, turns out to have been a false break. Either way, boxes never overlap in time.
ConsolidationการแสดงผลDisplay5
สีพื้นของกรอบที่กำลังก่อตัว (ยังรับ OBV) และกรอบที่จบแล้ว ขอบและเส้นกลางใช้สีเดียวกันแต่ทึบกว่าFill of a forming box (still taking OBV) and of a finished one; the edges and midline use the same colour, more opaque.
ขอบบนและล่างเป็นเส้นทึบ และเส้นกลางเป็นเส้นประที่จุดกึ่งกลางของกรอบ เป็นจุดสมดุลของช่วงThe solid top and bottom edges, and the dashed midline halfway between, the range's equilibrium.
หลังเบรก ถ้า OBV กลับมาที่เส้นกลางของกรอบภายในจำนวนแท่งนี้ นับเป็นการทดสอบซ้ำ (ใช้กับ alert Midline retested) นับจากแท่งที่ OBV หลุดออกAfter a break, a return to the box's midline within this many bars counts as a retest (for the Midline retested alert), counted from the bar OBV left.
ป้าย Consolidation และขนาดตัวอักษรThe Consolidation label and its size.
จำนวนกรอบที่จบแล้วที่เก็บไว้บนกราฟ เก่าสุดออกก่อนHow many finished boxes stay on the chart, oldest out first.
4ทดลองปรับค่าเองTry it
- แคบแค่ไหนถึงนับHow tight counts
ลอง Tightness 0.4 แล้ว 0.8 ดูว่ากรอบน้อยลงหรือมากขึ้นTry Tightness 0.4, then 0.8: see the boxes thin out or multiply.
- รวมเป็นโซนMerge into a zone
เลือก Merge into zone กรอบที่เกิดซ้อนกันหลังเบรกจะรวมเป็นกรอบเดียวPick Merge into zone: boxes that would stack right after a break merge into one.
5จุดที่มักเข้าใจผิดCommon pitfalls
- เบรกครั้งแรกยังไม่ใช่เบรกThe first close outside is not the break
ปิดนอกกรอบครั้งแรกเป็นแค่การหยุดชั่วคราว การเบรกยืนยันเมื่อครบ Grace bars หรือออกไปเกิน Confirm alert เบรกจึงมาช้ากว่าแท่งแรกที่หลุดThe first close outside only freezes the box provisionally; the break confirms after the grace bars or beyond Confirm, so the break alert comes after the first bar out.
- กรอบเปลี่ยนรูปหลังเกิดA box can change shape after it appears
เบรกที่ล้มเหลวทำให้กรอบเปิดต่อและขยายครอบส่วนที่ออกไป และในโหมด Merge into zone กรอบที่จบแล้วอาจเปิดต่อได้อีกA failed break reopens the box and widens it over the excursion, and with Merge into zone a finished box can reopen too.
- Minimum bars นับเป็นเวลาMinimum bars counts time
อายุของกรอบวัดเป็นเวลา ไม่ใช่จำนวนแท่ง กรอบที่คร่อมสุดสัปดาห์จึงครบ Minimum bars เร็วกว่าที่นับแท่งได้A box's age is measured in time, not in bars, so a box spanning a weekend reaches Minimum bars sooner than its bar count says.
ส่วนที่ 3Part 3
Divergence
1โมดูลนี้คืออะไรWhat it is
โมดูลนี้หาจุดกลับตัวของ OBV (ยอดและก้น) แล้วเทียบกับจุดกลับตัวก่อนหน้าชนิดเดียวกัน พร้อมราคาที่แท่งนั้น (Low ของแท่งก้น High ของแท่งยอด) Regular: ราคาทำจุดสุดใหม่แต่ OBV ไม่ทำตาม คือแรงซื้อขายที่จางลงระหว่างการวิ่ง อ่านเป็นสัญญาณอ่อนแรงที่อาจกลับตัว Hidden: ราคายังรักษาโครงสร้างแนวโน้ม แต่ OBV ทำจุดสุดใหม่ อ่านเป็นการย่อที่ถูกดูดซับแล้วไปต่อ ค่าเริ่มต้นเปิดแค่ RegularThis module finds OBV's turns (peaks and troughs) and compares each with the previous turn of the same kind, along with price on that bar (the Low at a trough, the High at a peak). Regular: price makes a new extreme and OBV does not, participation fading into the move, a potential exhaustion read. Hidden: price holds its trend structure while OBV makes the new extreme, a pullback absorbed, a continuation read. Only Regular is on by default.
จุดกลับตัวต้องมีแท่งก่อนหน้าและหลังตามจำนวนที่ตั้ง (ค่าเริ่มต้น 5 / 5) จึงรู้ว่าเป็นจุดกลับตัวได้หลังแท่ง after ปิดครบ ไดเวอร์เจนซ์จึงปรากฏช้ากว่าจุดกลับตัวเท่านั้น และวาดย้อนกลับไปที่จุดกลับตัว นี่คือวิธีหาจุดกลับตัว ไม่ใช่การ repaint สองจุดจะถูกเทียบก็ต่อเมื่อจำนวนแท่งระหว่างแท่งที่ยืนยันทั้งสองอยู่ในช่วง min / max (5 / 60) เส้นเชื่อมสองจุดกลับตัวอยู่ในหน้าต่าง OBV เก็บไว้ 40 อันล่าสุดA turn needs the set bars before and after it (5 / 5 by default), so it is known only once the after-bars have closed: a divergence appears that many bars after the turn and is drawn back at the turn itself. That is how turns are found, not repainting. Two turns are compared only when the bars between their confirmations fall within min / max (5 / 60). A line joins the two turns in the OBV pane; the newest 40 are kept.
2อ่านบนกราฟยังไงReading it on the chart
- Bull เส้นและป้ายเขียวอมฟ้าใต้ก้นของ OBV: ไดเวอร์เจนซ์ขาขึ้นแบบปกติBull a teal line and tag under OBV's trough: regular bullish divergence
- Bear เส้นและป้ายแดงเหนือยอดของ OBV: ไดเวอร์เจนซ์ขาลงแบบปกติBear a red line and tag over OBV's peak: regular bearish divergence
- H สีเดียวกันแต่จางกว่า: ไดเวอร์เจนซ์แบบซ่อนH the same colours, paler: hidden divergence
- ปิดไว้ตามค่าเริ่มต้น HiddenOff by default: Hidden
3ปรับแล้วได้อะไรWhat each setting changes
เรียงตามหน้าตั้งค่าบน TradingView ปุ่มสีทองในแต่ละข้อจะเปลี่ยนค่าบนกราฟด้านบนให้ดูทันทีIn the order TradingView lists them. The gold buttons change the chart above so you can see the effect.
Modulesสวิตช์ของโมดูลModule switches2
เปิดปิดโมดูล Divergence ปิดแล้วเส้น ป้าย และ alert ไดเวอร์เจนซ์หายทั้งหมดSwitches the Divergence module; off, the lines, tags and divergence alerts go.
ซ่อนไดเวอร์เจนซ์บนไทม์เฟรมกราฟที่สูงกว่าค่านี้ ซ่อนการแสดงผลและ alertHides the divergences above this chart timeframe: display and alerts.
DivergenceชนิดและจุดกลับตัวKinds and turns3
เลือกชนิดที่หา Regular (เปิด) และ Hidden (ปิด)Which kinds are found: Regular (on) and Hidden (off).
จำนวนแท่งที่ต้องอยู่ทั้งสองข้างของจุดกลับตัว ไดเวอร์เจนซ์ปรากฏช้ากว่าจุดกลับตัวเท่าจำนวน after ค่าน้อยเร็วกว่าแต่มีสัญญาณรบกวนมากกว่าBars needed on each side of a turn. A divergence appears this many after-bars late; fewer is faster and noisier.
ระยะห่างของสองจุดกลับตัวที่จะนำมาเทียบ นับจำนวนแท่งระหว่างแท่งที่ยืนยันทั้งสอง คู่ที่ใกล้หรือไกลกว่านี้ถูกข้ามHow far apart two turns may be to be compared, counted between the bars each confirmed on; pairs closer or further apart are skipped.
4ทดลองปรับค่าเองTry it
- ไดเวอร์เจนซ์แบบซ่อนHidden divergence
เปิด Hidden แล้วดูป้าย H ที่จางกว่าSwitch Hidden on and look for the paler H tags.
- จุดกลับตัวที่ชัดขึ้นClearer turns
ตั้ง before 8 เหลือเฉพาะจุดกลับตัวที่เด่นกว่าSet Before to 8: only the more prominent turns remain.
5จุดที่มักเข้าใจผิดCommon pitfalls
- ไดเวอร์เจนซ์มาช้าA divergence arrives late
จุดกลับตัวรู้ได้หลังแท่ง after ปิดครบ เส้นจึงวาดย้อนหลังไปที่จุดกลับตัว และ alert ส่งตอนยืนยัน ไม่ใช่ตอนจุดกลับตัวA turn is known only after its after-bars close, so the line is drawn back at the turn and the alert fires at the confirmation, not at the turn.
- จุดกลับตัวก่อนหน้าเปลี่ยนเสมอThe previous turn always moves on
ทุกจุดกลับตัวใหม่แทนที่จุดก่อนหน้า แม้คู่นั้นจะถูกข้ามเพราะห่างเกินช่วง จึงเทียบได้แค่จุดที่ติดกันEach new turn replaces the previous one even when the pair was skipped for its distance, so only consecutive turns are compared.
ส่วนที่ 4Part 4
Alerts
1โมดูลนี้คืออะไรWhat it is
สร้าง alert บน TradingView ตัวเดียว ตั้ง Condition เป็นอินดิเคเตอร์นี้ → Any alert() function call แล้วเลือกเหตุการณ์ในกลุ่ม Alerts · … ต้องเปิด Enable alerts ก่อน (ปิดไว้ตามค่าเริ่มต้น) ถ้าปิดอยู่ ไม่มีเหตุการณ์ไหนส่งเลย ไม่ว่าจะติ๊กอะไรไว้ ค่าเริ่มต้นติ๊กไว้แค่ Broke above และ Broke belowCreate one TradingView alert with Condition set to this indicator → Any alert() function call, then pick the events in the Alerts · … groups. Enable alerts must be on first (off by default); off, nothing fires whatever is ticked. Only Broke above and Broke below are ticked by default.
ทุกเหตุการณ์ที่ติ๊กไว้และเกิดในแท่งเดียวกัน มาในข้อความเดียว คั่นด้วย · ในรูปแบบ OBV Zones · XAUUSD 5m — OBV broke above its consolidation box @ 3958.120 ไทม์เฟรมเขียนพร้อมหน่วย (5m, 1h, 1D) ราคาหลัง @ คือราคาปิดของแท่ง alert ตามการซ่อนของโมดูลด้วย: โมดูลที่ปิดหรือถูกซ่อนด้วย Hide above จะไม่ส่งEvery ticked event raised on one bar arrives in one message, joined with ·, in the form OBV Zones · XAUUSD 5m — OBV broke above its consolidation box @ 3958.120. The timeframe carries its unit (5m, 1h, 1D); the price after @ is the bar's close. Alerts follow module visibility: a module that is off or hidden with Hide above sends nothing.
2อ่านบนกราฟยังไงReading it on the chart
- จุดสีส้มเหนือแท่งราคาคือแท่งที่มี alert ▲ ขาขึ้น ▼ ขาลง • ไม่มีทิศ บันทึกใต้กราฟเป็นข้อความที่จะได้รับ กดเพื่อไปที่แท่งนั้นAn orange dot over a price bar marks an alert: ▲ up, ▼ down, • no direction. The log under the chart shows the messages; press one to go to its bar.
- กราฟนี้เปิด Enable alerts ไว้ให้ (เฉพาะการ์ดนี้)This card has Enable alerts on (this card only).
3ปรับแล้วได้อะไรWhat each setting changes
เรียงตามหน้าตั้งค่าบน TradingView ปุ่มสีทองในแต่ละข้อจะเปลี่ยนค่าบนกราฟด้านบนให้ดูทันทีIn the order TradingView lists them. The gold buttons change the chart above so you can see the effect.
Alertsสวิตช์หลักMaster switch2
สวิตช์หลัก ปิดแล้วไม่มีเหตุการณ์ไหนส่งThe master switch; off, no event fires.
เปิด (ค่าเริ่มต้น): เหตุการณ์ต้องอยู่จนแท่งปิด ปิด: ไดเวอร์เจนซ์และการตัดเส้นเฉลี่ยส่งได้ระหว่างแท่ง และอาจหายไปก่อนแท่งปิด เหตุการณ์ของกรอบยืนยันตอนแท่งปิดเสมอ ตัวอย่างนี้แสดงแบบแท่งปิดOn (default): an event must survive the bar close. Off: divergence and MA-cross events can fire within the bar and may vanish before it closes; box events are close-confirmed regardless. The demo shows close-confirmed events.
Alerts · ConsolidationกรอบBoxes3
ส่งเมื่อการเบรกยืนยัน (ออกไปเกิน Confirm หรือครบ Grace bars) ไม่ใช่ตอนปิดนอกกรอบครั้งแรก เฉพาะกรอบที่มีอายุครบ Minimum bars ข้อความ OBV broke above its consolidation box / OBV broke below its consolidation boxFires when a break CONFIRMS (beyond Confirm, or the grace bars ran out), not on the first close outside; only boxes that lasted Minimum bars. Message: OBV broke above its consolidation box / OBV broke below its consolidation box.
OBV หลุดออกแล้วกลับเข้ามาภายใน Grace bars กรอบเปิดต่อและขยาย ข้อความ Consolidation failed breakOBV left the box and came back within the grace bars, so the box reopened and widened. Message: Consolidation failed break.
Touched: OBV ตัดเส้นกลางของกรอบที่กำลังก่อตัว ครั้งเดียวต่อกรอบ Retested: OBV กลับมาที่เส้นกลางของกรอบที่เบรกแล้ว ภายใน Midline retest window ครั้งเดียวต่อกรอบ ข้อความ Consolidation midline touched / Consolidation midline retested สองตัวนี้ส่งได้แม้ปิด Draw midlineTouched: OBV crossed the midline of a forming box, once per box. Retested: OBV came back to a broken box's midline within the retest window, once per box. Messages Consolidation midline touched / Consolidation midline retested. Both still fire with Draw midline off.
Alerts · DivergenceDivergence1
ส่งที่แท่งที่ไดเวอร์เจนซ์ยืนยัน ชนิดนั้นต้องเปิดในกลุ่ม Divergence ด้วย ข้อความ Regular bullish divergence, Regular bearish divergence, Hidden bullish divergence, Hidden bearish divergenceFires on the bar a divergence confirms; that kind must be on in Divergence too. Messages Regular bullish divergence, Regular bearish divergence, Hidden bullish divergence, Hidden bearish divergence.
Alerts · Smoothing MASmoothing MA1
OBV ตัดขึ้นหรือลงผ่านเส้นเฉลี่ย ข้อความ OBV crossed above its MA / OBV crossed below its MAOBV crossing above or below its average. Messages OBV crossed above its MA / OBV crossed below its MA.
4ทดลองปรับค่าเองTry it
- หลายเหตุการณ์ในข้อความเดียวSeveral events in one message
เปิดทุกเหตุการณ์ของกรอบและ Regular divergence แล้วหาแท่งที่มีมากกว่าหนึ่งเหตุการณ์ในบันทึกSwitch every box event and regular divergence on, then look in the log for a bar with more than one event.
5จุดที่มักเข้าใจผิดCommon pitfalls
- ติ๊กแล้วไม่มี alertTicked, but nothing arrives
ต้องเปิด Enable alerts และสร้าง alert บน TradingView แบบ Any alert() function call โมดูลของเหตุการณ์นั้นต้องเปิดและไม่ถูกซ่อนบนไทม์เฟรมนั้นEnable alerts must be on and a TradingView alert set to Any alert() function call must exist; the event's module must be on and not hidden on that timeframe.
- alert ส่งได้ครั้งเดียวต่อแท่งOne alert per bar
alert() ใช้ความถี่ once per bar ถ้าปิด Fire on bar close only แล้วมีเหตุการณ์ระหว่างแท่ง ข้อความแรกของแท่งเท่านั้นที่ส่งalert() runs once per bar: with Fire on bar close only off, only the first message within a bar is sent.
อ้างอิงReference
การตั้งค่าทั้งหมดAll settings
ทุกช่องตั้งค่าของโค้ด v1.0.0 เรียงตามหน้าตั้งค่าบน TradingView ช่องที่มีจุดทอง เปลี่ยนแล้วกราฟเปลี่ยนตาม กด (i) เพื่ออ่านคำอธิบายของช่องนั้นEvery input of v1.0.0, in the order TradingView shows them. Inputs with a gold dot change the chart; press (i) for an input’s description.