OPEN-SOURCE SCRIPT
Güncellendi BackToBasic XEMA

คำอธิบายการทำงานของอินดิเคเตอร์ "BackToBasic XEMA"
BackToBasic XEMA เป็นอินดิเคเตอร์ที่ใช้หลักการเปรียบเทียบ สองเส้นวิเคราะห์แนวโน้มราคาที่มีความไวต่างกัน
เมื่อเส้นที่ตอบสนองต่อราคาไวกว่า ตัดขึ้นเหนือเส้นที่ตอบสนองช้ากว่า → แสดงสัญญาณ Buy
ในทางกลับกัน หากตัดลงต่ำกว่า → แสดงสัญญาณ Sell
อินดิเคเตอร์นี้มีระบบพิเศษที่เรียกว่า เส้นติดตามผลอัตโนมัติ (Trail Line)
เมื่อราคาเคลื่อนไปในทิศทางที่ถูกต้องตามสัญญาณเกินระยะที่กำหนด (เช่น 2500 จุด)
จะมีเส้นแนวนอนลากตามระดับราคา เพื่อใช้เป็นแนวพิจารณาการปิดกำไรโดยอัตโนมัติ (หรือเชิงกลยุทธ์)
คุณสามารถปรับระยะห่างของสัญลักษณ์ Buy/Sell, เปิด/ปิดเส้นติดตาม และเลือกว่าจะใช้เส้นไหนเป็นฐานได้
🧠 HowBackToBasic XEMA Indicator Works
BackToBasic XEMA is an indicator based on comparing two trend-tracking lines with different sensitivities.
When the faster-reacting line crosses above the slower one → a Buy signal is shown.
Conversely, when it crosses below → a Sell signal appears.
It also features a dynamic horizontal trailing line, which only activates when the price has moved in the right direction by a certain amount (e.g., 2500 points).
This line extends horizontally from the latest calculated level and can be used as a reference for trailing stops or visual exit management.
Users can customize the symbol distance, toggle the trailing line, and choose which reference line to use for trailing.
BackToBasic XEMA เป็นอินดิเคเตอร์ที่ใช้หลักการเปรียบเทียบ สองเส้นวิเคราะห์แนวโน้มราคาที่มีความไวต่างกัน
เมื่อเส้นที่ตอบสนองต่อราคาไวกว่า ตัดขึ้นเหนือเส้นที่ตอบสนองช้ากว่า → แสดงสัญญาณ Buy
ในทางกลับกัน หากตัดลงต่ำกว่า → แสดงสัญญาณ Sell
อินดิเคเตอร์นี้มีระบบพิเศษที่เรียกว่า เส้นติดตามผลอัตโนมัติ (Trail Line)
เมื่อราคาเคลื่อนไปในทิศทางที่ถูกต้องตามสัญญาณเกินระยะที่กำหนด (เช่น 2500 จุด)
จะมีเส้นแนวนอนลากตามระดับราคา เพื่อใช้เป็นแนวพิจารณาการปิดกำไรโดยอัตโนมัติ (หรือเชิงกลยุทธ์)
คุณสามารถปรับระยะห่างของสัญลักษณ์ Buy/Sell, เปิด/ปิดเส้นติดตาม และเลือกว่าจะใช้เส้นไหนเป็นฐานได้
🧠 HowBackToBasic XEMA Indicator Works
BackToBasic XEMA is an indicator based on comparing two trend-tracking lines with different sensitivities.
When the faster-reacting line crosses above the slower one → a Buy signal is shown.
Conversely, when it crosses below → a Sell signal appears.
It also features a dynamic horizontal trailing line, which only activates when the price has moved in the right direction by a certain amount (e.g., 2500 points).
This line extends horizontally from the latest calculated level and can be used as a reference for trailing stops or visual exit management.
Users can customize the symbol distance, toggle the trailing line, and choose which reference line to use for trailing.
Sürüm Notları
ไทย:– เพิ่มปุ่มเปิด/ปิดการแสดงเส้นและป้ายคำนวณกำไร–ขาดทุน
– ปรับสีและความหนาของเส้นกับสีข้อความของป้าย ได้ตามต้องการ
– เลือกขนาดข้อความบนป้าย (เล็ก–ใหญ่)
– แยกเปิด/ปิดและตั้งค่าสีของเส้น “Trailing Line” ได้อิสระ
– แก้โค้ดให้ใช้ตัวแปรสถานะ (var) และฟังก์ชันวาดเส้น/ป้าย (line.new, label.new) ถูกต้องตาม Pine v6
English:
– Added an on/off switch for drawing profit/loss lines & labels
– You can now pick line thickness and colors for both PnL and labels
– Allows choosing label text size (tiny to huge)
– Separate enable switch and color settings for the horizontal “Trailing Line”
– Updated variables and drawing calls (var, line.new, label.new) to match Pine Script v6 syntax
Sürüm Notları
คำอธิบายการแก้ไข (ไทย):-คำนวณ PnL โดยใช้การเปลี่ยนแปลงราคาตรง ๆ ต่อสัญญา
-กำหนดจำนวนสัญญาที่ต้องการผ่าน input
-แสดงผลเป็นทศนิยม 2 ตำแหน่ง ตามตัวอย่าง 10 → 10.00$
-ตั้งค่าสีของข้อความ PnL ให้เป็นบวก/ลบตามกำไรหรือขาดทุน เพื่อให้เข้าใจง่าย
-ตรวจสอบและแก้ไขบัคที่อาจเกิดขึ้น ในการคำนวณหรือแสดงผล
Explanation of Fixes (English):
-Calculate PnL based on direct price change per contract
-Allow setting number of contracts via input
-Format output to 2 decimals, e.g., 10 → 10.00$
-Add color settings for PnL labels to indicate profit/loss more clearly
-Debugged the calculation and display issues to ensure accurate results
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.