OPEN-SOURCE SCRIPT
Mentor Q Locked Levels Engine 4h

You are an expert data parsing assistant. I am going to provide you with an XML file containing financial market levels. Your task is to extract specific attributes and convert them into a raw text format compatible with my custom TradingView Pine Script indicator.
Strictly adhere to the following formatting guidelines for each valid level found:
1. Every line must follow this exact syntax:
Level=VALUE; Name="LABEL (TICKER)"; Color=HEX_OR_FALLBACK; Style=STYLE_TYPE; LineWidth=2
2. Formatting Rules:
- 'Level': Extract the exact price or numerical value.
- 'Name': Combine the level's description/name with its asset symbol inside parentheses—e.g., Name="1D Max (QQQ)". It must be enclosed in double quotes.
- 'Color': Map the color to hex format (e.g., #FE0000 for Red, #FF9800 for Orange, #4CAF50 for Green, #2962FF for Blue, #20BDBD for Teal). If the XML color is missing or unclear, assign a fallback based on the level name.
- 'Style': Must be exactly "Solid", "Dashed", or "Dotted".
- 'LineWidth': Keep it consistently at 2.
3. Output Constraints:
- Do NOT include any markdown headers, conversational text, introduction, or explanations.
- Do NOT group them by headers like "=== QQQ ===". Just output the raw lines directly.
- Output ONLY the clean, copy-and-paste ready text rows.
Here is the XML data to process:
Strictly adhere to the following formatting guidelines for each valid level found:
1. Every line must follow this exact syntax:
Level=VALUE; Name="LABEL (TICKER)"; Color=HEX_OR_FALLBACK; Style=STYLE_TYPE; LineWidth=2
2. Formatting Rules:
- 'Level': Extract the exact price or numerical value.
- 'Name': Combine the level's description/name with its asset symbol inside parentheses—e.g., Name="1D Max (QQQ)". It must be enclosed in double quotes.
- 'Color': Map the color to hex format (e.g., #FE0000 for Red, #FF9800 for Orange, #4CAF50 for Green, #2962FF for Blue, #20BDBD for Teal). If the XML color is missing or unclear, assign a fallback based on the level name.
- 'Style': Must be exactly "Solid", "Dashed", or "Dotted".
- 'LineWidth': Keep it consistently at 2.
3. Output Constraints:
- Do NOT include any markdown headers, conversational text, introduction, or explanations.
- Do NOT group them by headers like "=== QQQ ===". Just output the raw lines directly.
- Output ONLY the clean, copy-and-paste ready text rows.
Here is the XML data to process:
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.