OPEN-SOURCE SCRIPT
PA Signal Levels: Final Fix tomgoodcar win v1

📚 คำอธิบายวิธีใช้งานและหลักการทำงานของอินดิเคเตอร์ "PA Signal Levels: Final Fix"อินดิเคเตอร์นี้ถูกออกแบบมาเพื่อการเทรดระยะสั้น/กลาง (Swing/Day Trading) โดยใช้กลยุทธ์ที่เน้นการ จับสัญญาณกลับตัว (Reversal) เมื่อราคาวิ่งออกไปถึงขอบเขตที่ไกลเกินไปของช่องทางแนวโน้ม (Channel)1. 🎯 หลักการทำงานของสัญญาณ (Buy/Sell Logic)อินดิเคเตอร์นี้รวมหลักการวิเคราะห์ทางเทคนิค 2 ส่วนเข้าด้วยกันเพื่อสร้างสัญญาณที่แม่นยำ:A. Linear Regression Channel (ช่องทางแนวโน้ม)อินดิเคเตอร์จะสร้างช่องทาง (Band) โดยใช้การถดถอยเชิงเส้น (Linear Regression) เพื่อกำหนดแนวโน้มหลัก และขีดเส้น Upper Band (แนวต้านพลวัต) และ Lower Band (แนวรับพลวัต) โดยมีค่าเบี่ยงเบนมาตรฐาน (StdDev) เป็นตัวกำหนดความกว้างUpper Band: ราคาที่สูงเกินไป (Overbought Zone)Lower Band: ราคาที่ต่ำเกินไป (Oversold Zone)การใช้งาน: ใช้เป็นตัวกรองสัญญาณ โดยสัญญาณจะเกิดเมื่อราคาอยู่ 'นอก' หรือ 'ติด' ขอบเขตเหล่านี้เท่านั้นB. Price Action (Engulfing Candlestick)ใช้รูปแบบแท่งเทียน Engulfing ที่แข็งแกร่ง (แท่งปัจจุบันกลืนกินแท่งก่อนหน้าทั้งหมด) เพื่อยืนยันการกลับตัวจากขอบเขตของ Channelสัญญาณ BUY (Bullish): เกิด Bullish Engulfing ในขณะที่แท่งเทียนนั้นต่ำกว่าหรือใกล้กับ Lower Bandสัญญาณ SELL (Bearish): เกิด Bearish Engulfing ในขณะที่แท่งเทียนนั้นสูงกว่าหรือใกล้กับ Upper Band2. 💰 การกำหนดความเสี่ยงและผลตอบแทน (SL/TP Calculation)เมื่อมีสัญญาณเกิดขึ้น อินดิเคเตอร์จะคำนวณและวาดระดับราคาสำคัญโดยอัตโนมัติ:ระดับราคาการคำนวณตามโค้ดบทบาทในการเทรดEntry Price (EP)ราคาปิด (close) ของแท่งเทียนที่เกิดสัญญาณจุดเริ่มต้นของการเข้าซื้อขายStop Loss (SL)คำนวณจาก Risk Size โดยใช้ค่า Lowest Low (สำหรับ Buy) หรือ Highest High (สำหรับ Sell) ย้อนหลังไปตามจำนวน SL Lookback (3 แท่ง)จุดออกเมื่อการวิเคราะห์ผิดพลาด โดยอิงตามแนวรับ/แนวต้านย่อยRisk Sizeระยะห่างระหว่าง EP กับ SLขนาดของความเสี่ยง (1R) ที่ใช้กำหนด TPTake Profit (TP1, 2, 3)$\text{EP} \pm (\text{Risk Size} \times \text{TP Ratio})$ระดับทำกำไรตามอัตราส่วนความเสี่ยงต่อผลตอบแทนที่ตั้งไว้ (1:1, 1:2, 1:3)กำลังคิดนี่คือคำแปลภาษาอังกฤษแบบมืออาชีพสำหรับคู่มือการใช้งานอินดิเคเตอร์ของคุณครับ: 📚 User Guide and Methodology: "PA Signal Levels: Final Fix" Indicator This indicator is designed for Short-to-Medium term trading (Swing/Day Trading), utilizing a strategy focused on catching reversals when the price reaches extreme boundaries of the trend channel. 1. 🎯 Buy/Sell Signal Logic The indicator combines two core technical analysis principles to generate high-accuracy signals: A. Linear Regression ChannelThe indicator constructs a channel based on Linear Regression to define the primary trend. It plots an Upper Band (Dynamic Resistance) and a Lower Band (Dynamic Support), with the width determined by Standard Deviation (StdDev). Upper Band: Overbought Zone (Price is too high).Lower Band: Oversold Zone (Price is too low).Usage: Acts as a signal filter; signals are only triggered when the price is "outside" or "touching" these boundaries. B. Price Action (Engulfing Candlestick)It uses strong Engulfing patterns (where the current candle completely engulfs the previous one) to confirm a reversal from the channel boundaries. BUY Signal (Bullish): A Bullish Engulfing occurs while the candle is below or near the Lower Band.SELL Signal (Bearish): A Bearish Engulfing occurs while the candle is above or near the Upper Band. 2. 💰 Risk and Reward Management (SL/TP Calculation) Once a signal is triggered, the indicator automatically calculates and plots key price levels: Price Level Calculation LogicTrading RoleEntry Price (EP)Closing price (close) of the signal candle.The starting point of the trade.Stop Loss (SL)Calculated based on the Lowest Low (for Buy) or Highest High (for Sell) over the SL Lookback period (3 candles).Exit point if the analysis is wrong, based on recent swing levels.Risk SizeThe distance between EP and SL.Represents 1 unit of risk (1R) used to determine TP levels.Take Profit (TP1, 2, 3)\(EP\pm (RiskSize\times TPRatio)\)Profit-taking levels based on the set Reward-to-Risk ratios (e.g., 1:1, 1:2, 1:3).คำศัพท์เทคนิคเพิ่มเติม: Reversal: การกลับตัวExtreme boundaries: ขอบเขตที่ไกลเกินไป (สุดโต่ง)Dynamic Support/Resistance: แนวรับ/แนวต้านที่เคลื่อนที่ตามราคาStandard Deviation (StdDev): ค่าเบี่ยงเบนมาตรฐานReward-to-Risk ratios: อัตราส่วนผลตอบแทนต่อความเสี่ยง
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.