OPEN-SOURCE SCRIPT
Aggiornato

siam RSI Cross

567
อินดิเคเตอร์ "Siam RSI Cross" ช่วยระบุจุดตัดระหว่าง RSI และ SMA ในโซน overbought (เหนือ 70) และ oversold (ใต้ 30)
- เส้นปะสีเหลืองและจุดสีแดง: RSI ตัดขึ้นใต้ระดับ 30 (โซน oversold)
- เส้นปะสีขาวและจุดสีเขียว: RSI ตัดลงเหนือระดับ 70 (โซน overbought)
- ปรับแต่งได้: ความยาว RSI (MA 1) และ SMA (MA 2)
- รองรับการแจ้งเตือนสำหรับสัญญาณซื้อ/ขาย


สรุปการทำงานของสคริปต์:
1. วัตถุประสงค์หลัก:
อินดิเคเตอร์นี้ใช้ RSI (Relative Strength Index) และ SMA (Simple Moving Average) ของ RSI เพื่อระบุจุดตัด (crossover และ crossunder) ในโซน overbought (เหนือ 70) และ oversold (ใต้ 30)
แสดงสัญญาณด้วย:
เส้นปะแนวตั้ง: เพื่อระบุจุดตัดในโซนที่กำหนด
จุดสี: เพื่อเน้นจุดตัดให้ชัดเจนยิ่งขึ้น
การแจ้งเตือน: เพื่อให้ผู้ใช้ตั้งค่าแจ้งเตือนใน TradingView ได้
2. องค์ประกอบของอินดิเคเตอร์:
เส้น RSI: คำนวณจาก ta.rsi(close, len1) โดย len1 (ค่าเริ่มต้น 34) เป็นความยาวที่ผู้ใช้กำหนดได้ แสดงเป็นเส้นสีน้ำเงิน
เส้น SMA ของ RSI: คำนวณจาก ta.sma(sh, len2) โดย len2 (ค่าเริ่มต้น 68) เป็นความยาวที่ผู้ใช้กำหนดได้ แสดงเป็นเส้นสีเขียว
เส้นแนวนอน: ที่ระดับ 30 (Oversold) และ 70 (Overbought) เป็นเส้นสีเทาแบบปะ
การเติมสีระหว่างเส้น 30 และ 70: ใช้สีน้ำเงินโปร่งใส (opacity 80)
การเติมสีระหว่าง RSI และ SMA:
สีเขียวอ่อน (lime) เมื่อ RSI > SMA
สีแดงเมื่อ RSI < SMA
3. เงื่อนไขและการแสดงสัญญาณ:
RSI ตัดขึ้น (Crossover) ใต้เส้น 30:
เงื่อนไข: RSI ตัดขึ้นผ่าน SMA (ta.crossover(sh, ln)) และ RSI < 30 (sh < 30)
เส้นปะแนวตั้งสีเหลือง: วาดจากระดับ 0 ถึง 100 ในหน้าต่าง RSI ด้วย line.new
จุดสีแดง: วาดที่ระดับ RSI (sh) ตรงจุดตัด ด้วย plotshape (รูปวงกลม, ขนาดเล็ก)
RSI ตัดลง (Crossunder) เหนือเส้น 70:
เงื่อนไข: RSI ตัดลงผ่าน SMA (ta.crossunder(sh, ln)) และ RSI > 70 (sh[1] > 70 and sh > 70)
เส้นปะแนวตั้งสีขาว: วาดจากระดับ 0 ถึง 100 ในหน้าต่าง RSI ด้วย line.new
จุดสีเขียว: วาดที่ระดับ RSI (sh) ตรงจุดตัด ด้วย plotshape (รูปวงกลม, ขนาดเล็ก)
หมายเหตุ: เงื่อนไข sh[1] > 70 and sh > 70 ช่วยให้แน่ใจว่าการตัดลงเกิดในโซน overbought และป้องกันการตรวจจับที่ผิดพลาด
4. การแจ้งเตือน (Alert Conditions):
สัญญาณซื้อทั่วไป: เมื่อ RSI ตัดขึ้นผ่าน SMA (ta.crossover(sh, ln)) ชื่อ: "Buy", ข้อความ: "RSI Cross. Buy Signal"
สัญญาณขายทั่วไป: เมื่อ RSI ตัดลงผ่าน SMA (ta.crossunder(sh, ln)) ชื่อ: "Sell", ข้อความ: "RSI Cross. Sell Signal"
สัญญาณตัดขึ้นใต้ 30: ชื่อ: "Buy Cross Below 30", ข้อความ: "RSI Cross Up Below 30"
สัญญาณตัดลงเหนือ 70: ชื่อ: "Sell Cross Above 70", ข้อความ: "RSI Cross Down Above 70"
ผู้ใช้สามารถตั้งค่าการแจ้งเตือนใน TradingView โดยเลือกเงื่อนไขเหล่านี้
5. การตั้งค่าที่ผู้ใช้ปรับได้:
len1: ความยาวของ RSI (ค่าเริ่มต้น: 34) ปรับได้ผ่านอินพุต "MA 1"
len2: ความยาวของ SMA (ค่าเริ่มต้น: 68) ปรับได้ผ่านอินพุต "MA 2"
6. การแสดงผล:
อินดิเคเตอร์แสดงในหน้าต่างแยก (ไม่ทับบนชาร์ตราคา) เนื่องจาก overlay=false
เส้นแนวตั้งและจุดสีทั้งหมดปรากฏในหน้าต่าง RSI โดย:
เส้นปะแนวตั้งครอบคลุมช่วง 0 ถึง 100
จุดสีแดงและสีเขียวอยู่ที่ระดับ RSI ตรงจุดตัด

Summary of the Script's Functionality:
1. Main Objective:
The indicator uses the Relative Strength Index (RSI) and a Simple Moving Average (SMA) of the RSI to identify crossover and crossunder points in the overbought (above 70) and oversold (below 30) zones.

It displays signals using:

Dashed vertical lines: To mark crossover/crossunder points in the specified zones.
Colored dots: To highlight the crossover/crossunder points more clearly.
Alerts: To allow users to set up notifications in TradingView.
2. Components of the Indicator:
RSI Line: Calculated using ta.rsi(close, len1), where len1 (default: 34) is a user-defined length, displayed as a blue line.
SMA of RSI: Calculated using ta.sma(sh, len2), where len2 (default: 68) is a user-defined length, displayed as a green line.
Horizontal Lines: At levels 30 (Oversold) and 70 (Overbought), shown as dashed gray lines.
Fill Between 30 and 70: Filled with a translucent blue color (opacity 80).
Fill Between RSI and SMA:
Light green (lime) when RSI > SMA.
Red when RSI < SMA.
3. Conditions and Signal Display:
RSI Crossover Below 30:
Condition: RSI crosses above SMA (ta.crossover(sh, ln)) and RSI < 30 (sh < 30).
Yellow Dashed Vertical Line: Drawn from level 0 to 100 in the RSI window using line.new.
Red Dot: Plotted at the RSI level (sh) at the crossover point using plotshape (circle shape, small size).
RSI Crossunder Above 70:
Condition: RSI crosses below SMA (ta.crossunder(sh, ln)) and RSI > 70 (sh[1] > 70 and sh > 70).
White Dashed Vertical Line: Drawn from level 0 to 100 in the RSI window using line.new.
Green Dot: Plotted at the RSI level (sh) at the crossunder point using plotshape (circle shape, small size).
Note: The condition sh[1] > 70 and sh > 70 ensures that the crossunder occurs in the overbought zone and prevents false detections.
4. Alert Conditions:
General Buy Signal: When RSI crosses above SMA (ta.crossover(sh, ln)), Name: "Buy", Message: "RSI Cross. Buy Signal".
General Sell Signal: When RSI crosses below SMA (ta.crossunder(sh, ln)), Name: "Sell", Message: "RSI Cross. Sell Signal".
Crossover Below 30 Signal: Name: "Buy Cross Below 30", Message: "RSI Cross Up Below 30".
Crossunder Above 70 Signal: Name: "Sell Cross Above 70", Message: "RSI Cross Down Above 70".
Users can set up alerts in TradingView by selecting these conditions.
5. User-Adjustable Settings:
len1: RSI length (default: 34), adjustable via the "MA 1" input.
len2: SMA length (default: 68), adjustable via the "MA 2" input.
6. Display:
The indicator is displayed in a separate window (not overlaid on the price chart) due to overlay=false.
All vertical lines and colored dots appear in the RSI window:
Dashed vertical lines span from 0 to 100.
Red and green dots are placed at the RSI level at the crossover/crossunder points.
Note di rilascio
Summary of the Script's Functionality:
1. Main Objective:
The indicator uses the Relative Strength Index (RSI) and a Simple Moving Average (SMA) of the RSI to identify crossover and crossunder points in the overbought (above 70) and oversold (below 30) zones.

It displays signals using:

Dashed vertical lines: To mark crossover/crossunder points in the specified zones.
Colored dots: To highlight the crossover/crossunder points more clearly.
Alerts: To allow users to set up notifications in TradingView.
2. Components of the Indicator:
RSI Line: Calculated using ta.rsi(close, len1), where len1 (default: 34) is a user-defined length, displayed as a blue line.
SMA of RSI: Calculated using ta.sma(sh, len2), where len2 (default: 68) is a user-defined length, displayed as a green line.
Horizontal Lines: At levels 30 (Oversold) and 70 (Overbought), shown as dashed gray lines.
Fill Between 30 and 70: Filled with a translucent blue color (opacity 80).
Fill Between RSI and SMA:
Light green (lime) when RSI > SMA.
Red when RSI < SMA.
3. Conditions and Signal Display:
RSI Crossover Below 30:
Condition: RSI crosses above SMA (ta.crossover(sh, ln)) and RSI < 30 (sh < 30).
Yellow Dashed Vertical Line: Drawn from level 0 to 100 in the RSI window using line.new.
Red Dot: Plotted at the RSI level (sh) at the crossover point using plotshape (circle shape, small size).
RSI Crossunder Above 70:
Condition: RSI crosses below SMA (ta.crossunder(sh, ln)) and RSI > 70 (sh[1] > 70 and sh > 70).
White Dashed Vertical Line: Drawn from level 0 to 100 in the RSI window using line.new.
Green Dot: Plotted at the RSI level (sh) at the crossunder point using plotshape (circle shape, small size).
Note: The condition sh[1] > 70 and sh > 70 ensures that the crossunder occurs in the overbought zone and prevents false detections.
4. Alert Conditions:
General Buy Signal: When RSI crosses above SMA (ta.crossover(sh, ln)), Name: "Buy", Message: "RSI Cross. Buy Signal".
General Sell Signal: When RSI crosses below SMA (ta.crossunder(sh, ln)), Name: "Sell", Message: "RSI Cross. Sell Signal".
Crossover Below 30 Signal: Name: "Buy Cross Below 30", Message: "RSI Cross Up Below 30".
Crossunder Above 70 Signal: Name: "Sell Cross Above 70", Message: "RSI Cross Down Above 70".
Users can set up alerts in TradingView by selecting these conditions.
5. User-Adjustable Settings:
len1: RSI length (default: 34), adjustable via the "MA 1" input.
len2: SMA length (default: 68), adjustable via the "MA 2" input.
6. Display:
The indicator is displayed in a separate window (not overlaid on the price chart) due to overlay=false.
All vertical lines and colored dots appear in the RSI window:
Dashed vertical lines span from 0 to 100.
Red and green dots are placed at the RSI level at the crossover/crossunder points.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.