OPEN-SOURCE SCRIPT

Mentor Q Locked Levels Engine 4h

729
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:

免責聲明

這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。