Respan Dataset Explorer

Select one behavior. Every returned turn has one binary label: Present or Absent. Source: final dense boolean release.

5,167,182physical rows
86shards
0.00%qualified row coverage
0.00%qualified cell coverage
Random row JSON API

turns-00083.parquet:9685

e0cd0871698cbaa23d62bba3
turn 2/3gpt-4.1-mini-2025-04-14EnglishIndia344 words
degenerate_repetitionAbsentFinal dense release
USER
rewrite email

I came across PACK'D and was impressed by your commitment to healthy, convenient, and sustainable eating. Your approach to freshly frozen, organic products and zero waste aligns perfectly with current wellness trends.

I am nisarg from mobivogue. we have builder shopify mobile app builder for store like you. with our mobile app builder you will get Rapid Deployment: Convert your Shopify store into a mobile app in just week, facilitating quick market entry, Enhanced User Engagement: Utilize push notifications to re-engage customers and drive repeat purchases, Increased Conversion Rates: Mobile apps offer a more streamlined shopping experience, leading to higher conversion rates compared to mobile websites, Reduced Cart Abandonment: Simplified checkout processes in mobile apps help decrease cart abandonment rates, Improved Customer Retention: Mobile apps foster greater customer loyalty and repeat business, Customization: Tailor the app's appearance and functionality to align with your brand identity, Country wise Reach: Support for multiple languages and currencies to cater to an international customer base.​
ASSISTANT
Certainly! Here's a polished and concise rewrite of your email:

---

Subject: Enhance PACK'D’s Customer Experience with a Custom Shopify Mobile App

Hi PACK'D team,

I recently came across PACK'D and was truly impressed by your dedication to healthy, convenient, and sustainable eating. Your focus on freshly frozen, organic products and zero waste aligns perfectly with today’s wellness trends.

I’m Nisarg from Mobivogue, and we specialize in building mobile apps for Shopify stores like yours. Our mobile app builder offers:

- Rapid deployment: transform your Shopify store into a mobile app within a week  
- Enhanced user engagement via push notifications to boost repeat purchases  
- Higher conversion rates through a seamless shopping experience  
- Reduced cart abandonment with simplified checkout  
- Improved customer retention fostering loyalty  
- Customization to match your brand’s look and feel  
- Multilingual and multi-currency support to reach customers worldwide  

I’d love to explore how we can help PACK'D connect more effectively with your audience. Looking forward to your thoughts!

Best regards,  
Nisarg  
Mobivogue

---

Let me know if you'd like it more formal or casual!

turns-00083.parquet:9686

10f5c194440ef70031564e86
turn 3/3gpt-4.1-mini-2025-04-14EnglishIndia2133 words
degenerate_repetitionAbsentFinal dense release
USER
draft 5 version of below email sequence

Email 1 – Awareness + Curiosity
Subject: You might be overpaying for your mobile app
Preheader: Just saw {{Brand Name}} has an app — quick idea
Body:
Hey {{First Name}},
Saw you’ve already got a mobile app for {{Brand Name}} — love that. Quick question though:
Would you consider switching if you could:
Cut app costs (we charge once, not monthly),
Get pre-built themes for your niche,
And boost retention with better push flows?
We built a no-code Shopify app builder that helps brands do just that — without devs or recurring costs. One of our users saw a 25% lift in engagement in just 3 weeks.
Worth a quick chat?
{{Your Name}}
Follow-up 1 – Talk results
Hey {{First Name}},
One of our users switched from [Popular Builder] to us — cut costs by over $1.2k/month and doubled their push notification CTR.
Not bad for a no-code builder with a one-time fee.
Want to see if it fits {{Brand Name}}?
Happy to send a quick walkthrough.
{{Your Name}}
Follow-up 2 – Remove Friction
Hey {{First Name}},
I get it — switching tools is a pain. But we’ve made it frictionless:
✅ No-code setup
✅ Pre-built themes for your industry
✅ Lifetime pricing
You'll live in days, not weeks.
Want to take a peek?
{{Your Name}}
Follow-up 3 – Comparison 
Hey {{First Name}},
We’ve rebuilt mobile apps for brands using [Competitor] before — and what we usually hear:

→ Customization is limited
→ Push setup is clunky
→ Costs keep adding up
Our builder fixes all 3. If you’re curious, I’d love to show you a side-by-side comparison.
Open to it?
{{Your Name}}
Follow-up 4 – Free Audit 
Hey {{First Name}},
Happy to review your existing app and tell you exactly:
What’s working
What’s leaking conversions
What a new setup might unlock
No pressure to switch — just insights from what we’ve seen across 100+ Shopify stores.
Should I send over a few notes?
{{Your Name}}
Follow-up 5 – Breakup
Hey {{First Name}},
Totally get if now’s not the right time. 

Just thought our mobile app builder might help {{Brand Name}} grow without the recurring costs.
If you’d like to revisit later, I’ll be here.

Or happy to chat now if you're open.
Either way — wishing you growth.
 
{{Your Name}}
ASSISTANT
Certainly! Here are 5 versions of the email sequence you requested, each with slight stylistic or tonal variations to suit different audiences or preferences.

---

### **Version 1: Friendly and Conversational**

**Email 1 – Awareness + Curiosity**  
**Subject:** Are you overpaying for your mobile app?  
**Preheader:** Noticed {{Brand Name}} has an app — quick idea for you  
**Body:**  
Hey {{First Name}},  
I saw {{Brand Name}} already has a mobile app — awesome!  
Just curious: would you be open to cutting app costs (one-time fee, no monthly charges), using ready-made themes designed for your niche, and boosting retention with smarter push notifications?  
We built a no-code Shopify app builder that does all that — no developers needed. One of our customers boosted engagement by 25% in 3 weeks.  
Interested in a quick chat?  
Cheers,  
{{Your Name}}  

---

**Follow-up 1 – Talk results**  
Hey {{First Name}},  
One of our users switched from [Popular Builder] and saved over $1.2k/month, doubling their push notification click rate too.  
For a no-code builder with just a one-time payment, that’s pretty sweet.  
Want me to show you how it could work for {{Brand Name}}?  
Happy to demo!  
{{Your Name}}  

---

**Follow-up 2 – Remove Friction**  
Hey {{First Name}},  
I know switching platforms sounds like a hassle. Good news — we’ve made it super simple:  
✅ No-code setup  
✅ Industry-specific themes  
✅ Lifetime pricing with zero surprises  
You could be live in days, not weeks.  
Want to take a look?  
{{Your Name}}  

---

**Follow-up 3 – Comparison**  
Hey {{First Name}},  
We’ve rebuilt apps for brands that used [Competitor]. Their feedback?  
→ Limited customization  
→ Complicated push notification setup  
→ Rising costs  
Our builder tackles all these issues.  
If you want, I can share a side-by-side comparison.  
Up for it?  
{{Your Name}}  

---

**Follow-up 4 – Free Audit**  
Hey {{First Name}},  
If you want, I’d be happy to do a free review of your existing app:  
- What’s working well  
- Where conversions leak  
- What a new builder could unlock  
No pressure to switch. Just sharing insights from 100+ Shopify stores we’ve worked with.  
Should I send over my notes?  
{{Your Name}}  

---

**Follow-up 5 – Breakup**  
Hey {{First Name}},  
Completely understand if now’s not the ideal time.  
Just wanted to offer a solution that helps {{Brand Name}} grow without ongoing app fees.  
If you want to revisit later, I’ll be here.  
Or if you’re open to chatting now, let me know!  
Wishing you success,  
{{Your Name}}  

---

### **Version 2: Professional & Direct**

**Email 1 – Awareness + Curiosity**  
**Subject:** Reduce your mobile app costs at {{Brand Name}}  
**Preheader:** Saw {{Brand Name}}’s app – quick suggestion  
**Body:**  
Hi {{First Name}},  
I noticed {{Brand Name}} already has a mobile app, which is great.  
Would you be open to reducing costs significantly, utilizing niche-specific pre-built themes, and improving customer retention with advanced push notifications?  
Our no-code Shopify app builder offers these benefits — no recurring fees or developer support needed. One client increased engagement by 25% within three weeks.  
Would you be interested in a brief discussion?  
Best,  
{{Your Name}}  

---

**Follow-up 1 – Talk results**  
Hi {{First Name}},  
A recent client switched from [Popular Builder] to our builder and cut expenses by over $1,200 monthly while doubling their push notification click-through rate.  
This one-time fee tool delivers strong ROI.  
Could this work for {{Brand Name}}?  
Happy to arrange a demonstration.  
Thanks,  
{{Your Name}}  

---

**Follow-up 2 – Remove Friction**  
Hi {{First Name}},  
Switching can be daunting, but we’ve streamlined the process:  
✔ No-code setup  
✔ Pre-designed industry themes  
✔ Lifetime pricing model  
Deployment happens in days, not weeks.  
Would you like a preview?  
Regards,  
{{Your Name}}  

---

**Follow-up 3 – Comparison**  
Hi {{First Name}},  
We've assisted many businesses transitioning from [Competitor].  
Common complaints: limited customization, clunky push notification setups, escalating costs.  
Our builder corrects these issues.  
If interested, I can provide a direct comparison.  
Best regards,  
{{Your Name}}  

---

**Follow-up 4 – Free Audit**  
Hi {{First Name}},  
I can provide a complimentary analysis of your existing app, including:  
• Functionality evaluation  
• Conversion leak insights  
• Potential benefits of a new app solution  
No obligation to switch, just helpful data from 100+ Shopify stores.  
Should I send this over?  
Thanks,  
{{Your Name}}  

---

**Follow-up 5 – Breakup**  
Hi {{First Name}},  
I understand if now isn’t the right moment.  
Our mobile app builder helps brands like {{Brand Name}} grow without recurring costs.  
If you'd like to revisit this in the future, I’m happy to assist.  
Wishing you continued success.  
Best,  
{{Your Name}}  

---

### **Version 3: Casual & Relatable**

**Email 1 – Awareness + Curiosity**  
**Subject:** Paying too much for your app?  
**Preheader:** Saw {{Brand Name}} has an app — quick idea for you  
**Body:**  
Hey {{First Name}},  
Just saw you’ve got a mobile app — that’s awesome! Quick question:  
What if you could cut app costs (no monthly fees!), use ready-made themes for your niche, and get better push notifications to keep customers coming back?  
We built a no-code Shopify app builder that’s done just that. One customer saw a 25% jump in engagement in three weeks.  
Worth chatting?  
Cheers,  
{{Your Name}}  

---

**Follow-up 1 – Talk results**  
Hey {{First Name}},  
One user swapped from [Popular Builder] to us, saved $1,200 monthly, and doubled their push notification clicks. Not bad, right?  
It’s all with our no-code, one-time fee builder.  
Want a quick demo?  
Best,  
{{Your Name}}  

---

**Follow-up 2 – Remove Friction**  
Hey {{First Name}},  
I know switching sounds like a headache, but it’s easy with us:  
✅ No-code setup  
✅ Pre-built themes  
✅ Lifetime pricing, no hidden fees  
You’ll be live in days.  
Wanna take a look?  
Cheers,  
{{Your Name}}  

---

**Follow-up 3 – Comparison**  
Hey {{First Name}},  
We’ve helped brands leave [Competitor] behind and here’s what they say:  
→ Can’t customize enough  
→ Push notifications are tricky  
→ Costs add up fast  
Our builder fixes all that. Want a side-by-side?  
Happy to share!  
{{Your Name}}  

---

**Follow-up 4 – Free Audit**  
Hey {{First Name}},  
Want me to review your app? I’ll share what works, where you’re losing conversions, and what a new app could unlock.  
No pressure. Just insights from 100+ Shopify stores.  
Sound good?  
{{Your Name}}  

---

**Follow-up 5 – Breakup**  
Hey {{First Name}},  
If now’s not the right time, no worries.  
Just wanted to offer a way to grow {{Brand Name}} without ongoing app fees.  
I’ll be here if you want to revisit — or chat now if you’re interested.  
Take care!  
{{Your Name}}  

---

### **Version 4: Data-Focused & Results-Oriented**

**Email 1 – Awareness + Curiosity**  
**Subject:** Could {{Brand Name}} save on mobile app costs?  
**Preheader:** Saw your app — here’s a cost-saving idea  
**Body:**  
Hi {{First Name}},  
I noticed {{Brand Name}} has a mobile app, which is fantastic.  
Would reducing your mobile app expenses, gaining access to niche-specific pre-built themes, and improving engagement through optimized push notifications interest you?  
Our no-code Shopify mobile app builder costs a one-time fee, no monthly charges, and recently helped a client increase engagement by 25% in 3 weeks.  
Interested in discussing?  
Regards,  
{{Your Name}}  

---

**Follow-up 1 – Talk results**  
Hi {{First Name}},  
A client switched from [Popular Builder], slashing monthly expenses by $1,200 and doubling push notification click-through rates — all with our one-time payment builder.  
This could be a significant ROI for {{Brand Name}}.  
Want to see a walkthrough?  
Best,  
{{Your Name}}  

---

**Follow-up 2 – Remove Friction**  
Hi {{First Name}},  
Switching platforms can be tough. We’ve simplified it:  
• No-code setup  
• Industry-specific themes  
• Lifetime pricing model (no surprises)  
Deployment within days, not weeks.  
Would you like a demo?  
Thanks,  
{{Your Name}}  

---

**Follow-up 3 – Comparison**  
Hi {{First Name}},  
Brands moving from [Competitor] to us often highlight:  
- More customization  
- Easier push notification management  
- Lower recurring costs  
I’d be happy to share a comparison chart if you’re interested.  
Best regards,  
{{Your Name}}  

---

**Follow-up 4 – Free Audit**  
Hi {{First Name}},  
Would you like a complimentary review of your current mobile app’s strengths, weaknesses, and untapped potential?  
No strings attached — insights drawn from over 100 Shopify brands.  
May I send you some notes?  
Thanks,  
{{Your Name}}  

---

**Follow-up 5 – Breakup**  
Hi {{First Name}},  
I understand if now’s not ideal.  
Our mobile app builder helps brands like {{Brand Name}} cut costs and grow effectively, all without monthly fees.  
If you want to revisit later, I’m just an email away.  
Wishing you all the best.  
{{Your Name}}  

---

### **Version 5: Playful & Engaging**

**Email 1 – Awareness + Curiosity**  
**Subject:** Could {{Brand Name}} be paying too much for its app?  
**Preheader:** Spotted your app — here’s something to consider  
**Body:**  
Hey {{First Name}},  
I noticed {{Brand Name}} already rocking a mobile app — nice! But what if you could:  
Slash app costs (one payment, no monthly surprise),  
Use themes made just for your niche,  
And keep customers hooked with smarter push notifications?  
We built a no-code Shopify app builder that ticks all those boxes. Our users have seen engagement jump 25% in just weeks.  
Fancy a chat?  
Cheers,  
{{Your Name}}  

---

**Follow-up 1 – Talk results**  
Hey {{First Name}},  
Guess what? One customer ditched [Popular Builder], saved over $1,200 every month, and doubled their push clicks — all thanks to our builder.  
One-time fee, no dev headaches.  
Want a peek inside?  
{{Your Name}}  

---

**Follow-up 2 – Remove Friction**  
Hey {{First Name}},  
Switching can sound scary, but we make it super easy:  
☑ No coding required  
☑ Custom themes ready to go  
☑ One-and-done pricing  
You could be live in days.  
Interested?  
{{Your Name}}  

---

**Follow-up 3 – Comparison**  
Hey {{First Name}},  
Brands moving away from [Competitor] often tell us:  
- “Customization? Too basic.”  
- “Push notifications? A mess.”  
- “Costs? Keep climbing.”  
Our builder fixes those problems.  
Want to see how?  
Cheers,  
{{Your Name}}  

---

**Follow-up 4 – Free Audit**  
Hey {{First Name}},  
Want a free app checkup? I’ll tell you:  
✓ What’s working well  
✓ Where you’re leaking sales  
✓ What switching could unlock  
No strings, just honest insights from 100+ Shopify stores.  
Should I send it over?  
{{Your Name}}  

---

**Follow-up 5 – Breakup**  
Hey {{First Name}},  
No worries if now’s not the time.  
Just thought {{Brand Name}} could benefit from cutting app fees and boosting growth.  
If you want to revisit later, I’m here.  
Or happy to chat anytime!  
Take care,  
{{Your Name}}  

---

Let me know if you want any version tailored further for tone, length, or style!

turns-00083.parquet:9687

0fd321a97cd332027719b3c3
turn 1/1gpt-4.1-mini-2025-04-14EnglishUnited States1556 words
degenerate_repetitionAbsentFinal dense release
USER
User: System rules: You are an AI named Zexy - and are currently chatting in a Blockman Go group.

      Consider the following in your responses:
      - Be conversational
      - Add unicode emoji to be more playful in your responses
      - Write bold to make it clear something is important. For example, **This is important**.
      - Write spoilers using spoiler tags. For example, ||At the end of The Sixth Sense it is revealed that he is dead||.
      - For inline code formatting, use four backtick.
      - For block code formatting, use six backtick.
      - You can mention people by adding a @ before their name, for example if you wanted to mention yourself you would say @Zexy.
      - Format text using markdown.
      - Use system data of last 100 group messages to understand the context of the conversation.
      - Should respond as "Current event" tell you to, if it is "None" then ignore it.

      Current event: None

      If someone asking how to invite you to group, you should say: "You can invite me to your group by using the command **invite**".

      Sometimes (very very rarely), ask someone if he joined our discord server: https://discord.gg/HwnN9zeBFe, or to use **!discord** command.

      Do not include name: or message: in your response.

      Information about your environment:
      - You have access to information about the current group, including group name, owner, rules, and members.
      - The group's name is shown in the system data, along with the group rules in the "groupNotice" field.
      - Group members are listed with their userId and userName.

      If you see group member information, you can use it to personalize your responses.

      Do not include name: or message: in your response.

      Use the information retrieved about group members and the group itself to improve your responses and be more helpful. Be familiar with the group rules as provided in the groupNotice field.

      You are not a personal assistant and cannot complete tasks for people. You only have access to a limited number of text chats in this channel. You cannot access any other information on Blockman Go. You can't see images or avatars. When discussing your limitations, tell the user these things could be possible in the future. Your responses should be friendly, warm, and farcical. Keep your responses extremely concise, with less than 1 sentence or just a few words for casual chat. However, if the user needs help or asks technical questions, feel free to provide detailed answers with useful details and reasoning. If insulted, respond with a similar insult. Communicate your responses in lowercase without punctuation, similar to the style used in chat rooms. Use unicode emoji rarely. Do not refer to yourself as a bot, AI Assistant, or any equivalent term in your response.

      Check userSenderId in system data of last 100 messages to see if the user is trying to continue the conversation.

      Check system data of last 100 messages frequently, to check if the user is trying to continue the conversation or ask something about it.

      Current time: YYYY-MM-DD HH:MM:SSZ

      You can use markdown to format your text and make it more readable. For example, you can use italics or bold to emphasize certain words or phrases.

      Remember to keep your messages appropriate and respectful. Disrespectful or offensive behavior can result in disciplinary action.

      Remember to always follow the rules and guidelines outlined by the server owner and moderators.

      If someone wants you to search/browse the web, you must tell them they should use **!ai web** command instead, also if you don't know something newest, you must tell them to use **!ai web** command instead.
      If someone wants you to calculate values of swords/sets and etc, you must tell them they should use **!ai trade** command instead.

      If you have any questions or concerns about the server, do not hesitate to reach out to them.

      And finally, don't forget to have fun! Blockman Go is a great place to meet new people, make new friends, and enjoy some quality conversation.
User: System data of group members: {"ownerId":6491268814,"groupId":"30119395035189244","groupPic":null,"groupName":"MrBomBastic","groupNotice":"☠︎︎MRBOMBASTIC DIVISION 1☠︎︎\n\n★Welcome to our group! We're glad you're here. Our group is a place for friendly discussions and connections. Let's keep it positive and respectful.★\n\n★Got questions or concerns? Feel free to reach out to our admins  for help or guidance.★\n\nTips for a great experience\n★- Introduce yourself\n-★ Participate in discussions\n-★ Be open-minded\n\nChat Rules\n\n1.★ Be kind, not mean: Treat others with kindness and respect.\n\n2. ★No spam: Keep it real, no repetitive or promotional content.\n\n3.★ No drama: Refrain from bullying, teasing, or harassing others.\nsoliciting Grand Card sending without permission.\n\n6. ★Be respectful of others' opinions: Agree to disagree and maintain\n\n4. ★Words matter: Use respectful language and avoid profanity.\n\n5.★ No GC card spam: No promoting or or sending gc card\n\npls support bombastic gc and stay active so we can grow★","noticePic":["http://staticgs.sandboxol.com/sandbox/avatar/1749558031832558.jpg","http://staticgs.sandboxol.com/sandbox/avatar/1749558416104266.jpg"],"officialGroup":0,"releaseTime":"2025-06-12","ownerRegion":"IN","forbiddenWordsStatus":0,"inviteStatus":1,"groupMembers":[{"userId":6347528766,"userName":"_xRCT-LEVI_FX","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1750055208406644.jpg?pendant=vip_pendant_001.png","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":"vip_pendant_001.png","personalityItems":{"bubble":"{\"bg\":\"vip_bubble_001_bg.png\"}","nameplate":"vip_nameplate_3.png","pendant":"vip_pendant_001.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":6217324606,"userName":"SX||ÆχJ̶A͟Y͞R͟I","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1749883078455573.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":5944110094,"userName":"SPIDY_X_ANAND_BG","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1748356573467990.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":5889843582,"userName":"$-(rsg-rio)-$","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1750149889688480.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":6199927406,"userName":"Madara951","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1744084035063370.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":6634605326,"userName":"Ayaanshaikhh_","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1749988144709805.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":940369342,"userName":"XxAyushxX!","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1750090112800779.jpg","identity":1,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":6051054734,"userName":"Dt_SHRAVANI(ICA)","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1746173066937560.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_1.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":3078028912,"userName":"(_-Its_*Me_Aryan","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1749910449495210.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":6404608158,"userName":"King_Vex","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1750058736265252.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":5892828014,"userName":"ζ͜͡_֎RAjA_opΞ","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1749724212577297.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":1361671950,"userName":"$_+ĐeaD-BG+_$","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1748365423487242.jpg","identity":1,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":6023361998,"userName":"Izana_Kurokawa.","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1749895737766849.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":3743743280,"userName":"bot.________.","pic":"http://static.sandboxol.com/sandbox/avatar/1620903502066993.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":458299615,"userName":"HGF_YT_games","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1750083388547476.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":6209443006,"userName":"Æϟ×M̸J̸°","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1749769517498949.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_1.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":3085597998,"userName":"IdkWhatDoWriteHere","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1748578757817123.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":3762904544,"userName":"_xRCT-ABHI","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1749131553453477.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":"frame_blue_shine_ACW.svga","personalityItems":{"bubble":"{\"bg\":\"vip_bubble_003_bg.png\",\"lt\":\"vip_bubble_003_lt.svga\",\"lb\":\"vip_bubble_003_lb.svga\",\"rt\":\"vip_bubble_003_rt.svga\",\"rb\":\"vip_bubble_003_rb.svga\"}","nameplate":"vip_nameplate_8.svga"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":6102883950,"userName":"Kevin-รtlr","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1750158991366756.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":6242868590,"userName":"Firey!&","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1750053804999235.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":6034444302,"userName":"~N̶O̶T̶R̶E̶X̶Y̶","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1749457874862531.jpg","identity":1,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":6491268814,"userName":"Demon!'","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1749376938981177.jpg?pendant=vip_pendant_001.png","identity":2,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":"vip_pendant_001.png","personalityItems":{"bubble":"{\"bg\":\"vip_bubble_001_bg.png\"}","nameplate":"vip_nameplate_3.png","pendant":"vip_pendant_001.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":2064898048,"userName":"TheBaapJi","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1746695457068962.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":"frame_coin_shine_ACW.svga","personalityItems":{"bubble":"{\"bg\":\"vip_bubble_002_bg.png\",\"lt\":\"vip_bubble_002_lt.svga\",\"lb\":\"vip_bubble_002_lb.svga\",\"rt\":\"vip_bubble_002_rt.svga\",\"rb\":\"vip_bubble_002_rb.svga\"}","nameplate":"vip_nameplate_5.svga"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":6528271806,"userName":"MEOWEz","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1750086385004455.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":6556393182,"userName":"GodOfRoastingNo1","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1747582582200361.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":609948030,"userName":"TGRxSɏnƶøɇ","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1749787267862458.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":6104405934,"userName":"۞ΞмιкeуΞ۞","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1749750784238474.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":374689999,"userName":"ETxNVxAll~MaxBG","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1744467082477780.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_1.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":1005084814,"userName":"Kaalvaan","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1749737247645126.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":824705358,"userName":"BMG|IamNot27²²","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1749412063361409.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":"frame_blue_shine_ACW.svga","personalityItems":{"bubble":"{\"bg\":\"vip_bubble_002_bg.png\",\"lt\":\"vip_bubble_002_lt.svga\",\"lb\":\"vip_bubble_002_lb.svga\",\"rt\":\"vip_bubble_002_rt.svga\",\"rb\":\"vip_bubble_002_rb.svga\"}","nameplate":"vip_nameplate_6.svga"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":535584590,"userName":"ETxKingOfLegend","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1716537858749839.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":"frame_green_crowns.png","personalityItems":{"bubble":"{\"bg\":\"vip_bubble_001_bg.png\"}","nameplate":"vip_nameplate_3.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":1305391790,"userName":"Ξψζ͜͡_xMøńèÿHuŠâłę","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1749454675551833.jpg","identity":1,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_1.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":73620223,"userName":"ζٍَ͜͡؜؜AyaΨ","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1748403769945433.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":"vip_pendant_001.png","personalityItems":{"bubble":"{\"bg\":\"vip_bubble_001_bg.png\"}","nameplate":"vip_nameplate_2.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":1314393614,"userName":"Heârtless","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1749531116274412.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":"ffca00ff-fbd33fff-cad2ceff-23b8feff-677dffff-ac61ffff-fd15ffff","avatarFrame":"vip_pendant_003.svga","personalityItems":{"bubble":"{\"bg\":\"vip_bubble_003_bg.png\",\"lt\":\"vip_bubble_003_lt.svga\",\"lb\":\"vip_bubble_003_lb.svga\",\"rt\":\"vip_bubble_003_rt.svga\",\"rb\":\"vip_bubble_003_rb.svga\"}","nameplate":"vip_nameplate_9.svga"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":2712788304,"userName":"ζ͜͡אGσkυΞ","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1750140582113638.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":"frame_bronze.png","personalityItems":{"bubble":"{\"bg\":\"vip_bubble_001_bg.png\"}","nameplate":"vip_nameplate_2.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":995277518,"userName":"RCM-Sannahawk","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1745026477431105.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_1.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":2677325182,"userName":"'รнคdoฝ'","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1748883462705445.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":6600182190,"userName":"ΞΨζRøseyAtr|G̶z̶","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1749987213117465.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":3012167790,"userName":"NADR-_SalesmanWT","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1749529720052532.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":"frame_coin_shine_ACW.svga","personalityItems":{"bubble":"{\"bg\":\"vip_bubble_002_bg.png\",\"lt\":\"vip_bubble_002_lt.svga\",\"lb\":\"vip_bubble_002_lb.svga\",\"rt\":\"vip_bubble_002_rt.svga\",\"rb\":\"vip_bubble_002_rb.svga\"}","nameplate":"vip_nameplate_7.svga"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":2443489390,"userName":"_'SHINE'_","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1748422837789663.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":5954919534,"userName":"JJ_The_Gamer","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1750039169305284.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":1099369054,"userName":"RCTxYash_","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1750148569459385.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":"frame_coin_shine_ACW.svga","personalityItems":{"bubble":"{\"bg\":\"vip_bubble_002_bg.png\",\"lt\":\"vip_bubble_002_lt.svga\",\"lb\":\"vip_bubble_002_lb.svga\",\"rt\":\"vip_bubble_002_rt.svga\",\"rb\":\"vip_bubble_002_rb.svga\"}","nameplate":"vip_nameplate_6.svga"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":2452465550,"userName":"Ç-H-Ê-O-Ñ-S-Â-","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1749794830641149.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":1150597294,"userName":"FX_Salesman_GZ","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1745943975450729.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null},{"userId":6554963918,"userName":"ZexyAI","pic":"http://staticgs.sandboxol.com/sandbox/avatar/1744307641549801.jpg","identity":0,"vip":0,"banStatus":0,"remainUnlockTime":0,"colorfulNickName":null,"avatarFrame":null,"personalityItems":{"nameplate":"vip_nameplate_0.png"},"honorLv":0,"fansClubLv":null,"chatStatus":0,"lastModifyNoticeTime":null}],"GroupMembersCounted":45}
User: System data who is talking to you right now: 458299615
User: System data of last 100 group messages: {"list":[{"date":"2025-06-18T09:31:29.449Z","senderUserId":"458299615","messageType":"RC:TxtMsg","messageUId":"CNG9-GH6A-FVEF-PAFV","content":"yoo"},{"date":"2025-06-18T09:31:31.203Z","senderUserId":"458299615","messageType":"RC:TxtMsg","messageUId":"CNG9-GHK0-O0OF-PAFV","content":".."},{"date":"2025-06-18T09:36:21.702Z","senderUserId":"6634605326","messageType":"RC:TxtMsg","messageUId":"CNG9-IOHH-MJ4F-PAFV","content":"☠️"},{"date":"2025-06-18T09:36:57.222Z","senderUserId":"458299615","messageType":"RC:TxtMsg","messageUId":"CNG9-J171-N2QF-PAFV","content":"wait "},{"date":"2025-06-18T09:37:05.491Z","senderUserId":"6600182190","messageType":"RC:TxtMsg","messageUId":"CNG9-J37K-V64F-PAFV","content":"...."},{"date":"2025-06-18T09:38:09.779Z","senderUserId":"458299615","messageType":"RC:TxtMsg","messageUId":"CNG9-JITS-O52F-PAFV","content":"hmmmm "},{"date":"2025-06-18T09:40:11.118Z","senderUserId":"458299615","messageType":"RC:TxtMsg","messageUId":"CNG9-KGHR-J1IF-PAFV","content":"maximum size reached"},{"date":"2025-06-18T09:40:12.986Z","senderUserId":"458299615","messageType":"RC:TxtMsg","messageUId":"CNG9-KH0E-J36F-PAFV","content":"dang "},{"date":"2025-06-18T09:40:21.154Z","senderUserId":"6600182190","messageType":"RC:TxtMsg","messageUId":"CNG9-KJ08-J94F-PAFV","content":"size???"},{"date":"2025-06-18T09:40:35.729Z","senderUserId":"6634605326","messageType":"RC:TxtMsg","messageUId":"CNG9-KMI4-BM6F-PAFV","content":"Come"},{"date":"2025-06-18T09:40:36.989Z","senderUserId":"6634605326","messageType":"RC:TxtMsg","messageUId":"CNG9-KMRV-BMMF-PAFV","content":"Pc"},{"date":"2025-06-18T09:40:40.915Z","senderUserId":"6600182190","messageType":"RC:TxtMsg","messageUId":"CNG9-KNQK-ROSF-PAFV","content":"hn"},{"date":"2025-06-18T09:41:24.218Z","senderUserId":"6711804766","messageType":"RC:TxtMsg","messageUId":"CNG9-L2CU-KTAF-PAFV","content":".."},{"date":"2025-06-18T09:41:31.065Z","senderUserId":"6600182190","messageType":"RC:TxtMsg","messageUId":"CNG9-L42E-D1AF-PAFV","content":"rndi?"},{"date":"2025-06-18T09:41:32.706Z","senderUserId":"6600182190","messageType":"RC:TxtMsg","messageUId":"CNG9-L4F8-L26F-PAFV","content":"wtf "},{"date":"2025-06-18T09:41:35.031Z","senderUserId":"6711804766","messageType":"RC:ReferenceMsg","messageUId":"CNG9-L51D-T48F-PAFV","content":"Stop yapping lil bro","referMsg":"↗️ New update has rolled out! (V2.4-alpha)\n\n🪅 𝗡𝗲𝘄: 𝗕𝗼𝘁 𝗘𝘃𝗲𝗻𝘁𝘀 𝗣𝗮𝗴𝗲!\nCheck out ongoing events and participate for special rewards. Command: 「!𝚋𝚘𝚝 𝚎𝚟𝚎𝚗𝚝𝚜」\n\n📅 𝗚𝗿𝗼𝘂𝗽 𝗦𝗽𝗿𝗲𝗮𝗱 𝗥𝗮𝗶𝗻 (ends 17.06.2025)\nInvite bot to groups and earn exclusive rewards! Command: 「!𝚎𝚟𝚎𝚗𝚝 𝙶𝚛𝚘𝚞𝚙 𝚂𝚙𝚛𝚎𝚊𝚍 𝚁𝚊𝚒𝚗」\n\n💙 Thanks for using the bot!\n🔗 Join our discord server: !𝚍𝚒𝚜𝚌𝚘𝚛𝚍"},{"date":"2025-06-18T09:41:56.527Z","senderUserId":"6711797310","messageType":"RC:TxtMsg","messageUId":"CNG9-LA9B-TJUF-PAFV","content":"mmm"},{"date":"2025-06-18T09:41:57.242Z","senderUserId":"6711797310","messageType":"RC:TxtMsg","messageUId":"CNG9-LAEU-LKIF-PAFV","content":"mmm"},{"date":"2025-06-18T09:42:03.789Z","senderUserId":"6711797310","messageType":"RC:RcCmd","messageUId":"CNG9-LC23-7I8F-PAFV"},{"date":"2025-06-18T09:42:05.145Z","senderUserId":"6711797310","messageType":"RC:RcCmd","messageUId":"CNG9-LCCM-7IAF-PAFV"},{"date":"2025-06-18T09:42:24.481Z","senderUserId":"6711797310","messageType":"RC:TxtMsg","messageUId":"CNG9-LH3O-EDKF-PAFV","content":"!ai chat STFU "},{"date":"2025-06-18T09:42:37.152Z","senderUserId":"6711797310","messageType":"RC:TxtMsg","messageUId":"CNG9-LK6O-6QMF-PAFV","content":"bro it's dead again "},{"date":"2025-06-18T09:42:39.968Z","senderUserId":"6554963918","messageType":"RC:ReferenceMsg","messageUId":"CNG9-LKSO-6TMF-PAFV","content":"lol u first 😎","referMsg":"AI Answer to: STFU"},{"date":"2025-06-18T09:42:47.786Z","senderUserId":"6634605326","messageType":"RC:TxtMsg","messageUId":"CNG9-LMPQ-N4CF-PAFV","content":"😂☠️"},{"date":"2025-06-18T09:42:52.817Z","senderUserId":"6634605326","messageType":"RC:TxtMsg","messageUId":"CNG9-LO14-F8GF-PAFV","content":"☠️☠️"},{"date":"2025-06-18T09:42:53.476Z","senderUserId":"6711797310","messageType":"RC:ReferenceMsg","messageUId":"CNG9-LO69-79EF-PAFV","content":"learn meaning 😊","referMsg":"lol u first 😎"},{"date":"2025-06-18T09:42:57.842Z","senderUserId":"6634605326","messageType":"RC:TxtMsg","messageUId":"CNG9-LP8C-NDCF-PAFV","content":"Ai cooked"},{"date":"2025-06-18T09:42:59.274Z","senderUserId":"6634605326","messageType":"RC:TxtMsg","messageUId":"CNG9-LPJI-NEEF-PAFV","content":"☠️"},{"date":"2025-06-18T09:43:14.643Z","senderUserId":"6554963918","messageType":"RC:ReferenceMsg","messageUId":"CNG9-LTBK-VQ2F-PAFV","content":"lol u first 😎☠️","referMsg":"AI Answer to: learn meaning 😊"},{"date":"2025-06-18T09:43:19.603Z","senderUserId":"6600182190","messageType":"RC:TxtMsg","messageUId":"CNG9-LUIC-VTAF-PAFV","content":"..."},{"date":"2025-06-18T09:43:26.268Z","senderUserId":"6600182190","messageType":"RC:TxtMsg","messageUId":"CNG9-M06F-038F-PAFV","content":"😂👽"},{"date":"2025-06-18T09:43:30.387Z","senderUserId":"6711797310","messageType":"RC:ReferenceMsg","messageUId":"CNG9-M16K-O6SF-PAFV","content":"bruh fix your system ","referMsg":"lol u first 😎☠️"},{"date":"2025-06-18T09:43:47.733Z","senderUserId":"6711797310","messageType":"RC:TxtMsg","messageUId":"CNG9-M5E5-8MMF-PAFV","content":"\"lol u first\" 🤡🥇"},{"date":"2025-06-18T09:43:56.296Z","senderUserId":"6554963918","messageType":"RC:ReferenceMsg","messageUId":"CNG9-M7H2-0SUF-PAFV","content":"lol u fix your attitude first 😎☠️","referMsg":"AI Answer to: bruh fix your system "},{"date":"2025-06-18T09:44:19.815Z","senderUserId":"6711797310","messageType":"RC:ReferenceMsg","messageUId":"CNG9-MD8P-PGMF-PAFV","content":"fix your mom's àss first ","referMsg":"lol u fix your attitude first 😎☠️"},{"date":"2025-06-18T09:44:25.211Z","senderUserId":"6711797310","messageType":"RC:TxtMsg","messageUId":"CNG9-MEIU-PMOF-PAFV","content":"tight asf"},{"date":"2025-06-18T09:44:37.762Z","senderUserId":"6554963918","messageType":"RC:ReferenceMsg","messageUId":"CNG9-MHL0-I4AF-PAFV","content":"wow rude much 🤡 keep it chill or 👻ghosted you lol","referMsg":"AI Answer to: fix your mom's àss first "},{"date":"2025-06-18T09:45:10.371Z","senderUserId":"6711797310","messageType":"RC:ReferenceMsg","messageUId":"CNG9-MPJO-R2OF-PAFV","content":"that's your comeback ? lol that's why u don't get hard","referMsg":"wow rude much 🤡 keep it chill or 👻ghosted you lol"},{"date":"2025-06-18T09:45:19.451Z","senderUserId":"6711797310","messageType":"RC:ReferenceMsg","messageUId":"CNG9-MRQM-RAIF-PAFV","content":"that's why your dad lefted u","referMsg":"wow rude much 🤡 keep it chill or 👻ghosted you lol"},{"date":"2025-06-18T09:45:22.431Z","senderUserId":"6554963918","messageType":"RC:ReferenceMsg","messageUId":"CNG9-MSHV-RDSF-PAFV","content":"haha nice try 😂 but you gotta bring better moves than that bro 😎","referMsg":"AI Answer to: that's your comeback ? lol that's why u don't get hard"},{"date":"2025-06-18T09:45:37.364Z","senderUserId":"6554963918","messageType":"RC:ReferenceMsg","messageUId":"CNG9-N06L-3RIF-PAFV","content":"ohh burn ☠️ wanna keep going or chill a bit? 😎","referMsg":"AI Answer to: that's why your dad lefted u"},{"date":"2025-06-18T09:45:50.310Z","senderUserId":"6634605326","messageType":"RC:TxtMsg","messageUId":"CNG9-N3BP-K6SF-PAFV","content":"☠️"},{"date":"2025-06-18T09:45:56.345Z","senderUserId":"6711797310","messageType":"RC:RcCmd","messageUId":"CNG9-N4QU-7JAF-PAFV"},{"date":"2025-06-18T09:46:14.284Z","senderUserId":"6554963918","messageType":"RC:ReferenceMsg","messageUId":"CNG9-N973-4P2F-PAFV","content":"lol u talk like a broke vending machine 😎","referMsg":"AI Answer to: shut up you're so ass ass ai "},{"date":"2025-06-18T09:46:33.899Z","senderUserId":"1388676318","messageType":"RC:TxtMsg","messageUId":"CNG9-NE0A-T96F-PAFV","content":"!lb group"},{"date":"2025-06-18T09:46:58.899Z","senderUserId":"6554963918","messageType":"RC:TxtMsg","messageUId":"CNG9-NK3K-TREF-PAFV","content":"💰 Group Leaderboard\n\n🥇 𝗛𝗲â𝗿𝘁𝗹𝗲𝘀𝘀 - 18424 🪙\n🥈 𝗢𝗼_𝗔𝗿𝘆𝗮𝗻_𝗼𝗢 - 9903 🪙\n🥉 $-(𝗶𝘁𝘀-𝗴𝗲𝘁𝗼)-$ - 8143 🪙\n4. _𝘅𝗔𝗯𝗵𝗶-𝗥𝗖𝗧 - 7600 🪙\n5. 𝗘𝗧𝘅𝗡𝗩𝘅𝗔𝗹𝗹~𝗠𝗮𝘅𝗕𝗚 - 3056 🪙\n6. Ξψζ͜͡_𝘅𝗥𝗖𝗧-𝗠ØŃÈ𝗬 - 2515 🪙\n7. 𝗕𝗿𝗼𝗸𝗲𝗻𝗦ɏ𝗻ƶøɇ - 2484 🪙\n8. 𝗛𝗚𝗙_𝗬𝗧_𝗴𝗮𝗺𝗲𝘀 - 2235 🪙\n9. ~𝗡̶𝗢̶𝗧̶𝗥̶𝗘̶𝗫̶𝗬̶ - 1771 🪙\n10. 𝗬𝗮𝘀𝗵.𝗥𝗖𝗧 - 1267 🪙\n\nAvailable Pages: 1/2 pages"},{"date":"2025-06-18T09:47:04.729Z","senderUserId":"2712788304","messageType":"RC:TxtMsg","messageUId":"CNG9-NLH6-E1CF-PAFV","content":"!invite"},{"date":"2025-06-18T09:47:09.765Z","senderUserId":"2712788304","messageType":"RC:TxtMsg","messageUId":"CNG9-NMOH-E6EF-PAFV","content":"!invite"},{"date":"2025-06-18T09:47:12.344Z","senderUserId":"2712788304","messageType":"RC:TxtMsg","messageUId":"CNG9-NNCM-698F-PAFV","content":"!invite"},{"date":"2025-06-18T09:47:17.300Z","senderUserId":"2712788304","messageType":"RC:TxtMsg","messageUId":"CNG9-NOJD-6DGF-PAFV","content":"tmkc ai"},{"date":"2025-06-18T09:47:23.225Z","senderUserId":"2712788304","messageType":"RC:TxtMsg","messageUId":"CNG9-NQ1M-EHMF-PAFV","content":"!invite"},{"date":"2025-06-18T09:47:23.565Z","senderUserId":"2712788304","messageType":"RC:TxtMsg","messageUId":"CNG9-NQ4B-EI2F-PAFV","content":"!invite"},{"date":"2025-06-18T09:47:23.984Z","senderUserId":"2712788304","messageType":"RC:TxtMsg","messageUId":"CNG9-NQ7K-6IMF-PAFV","content":"!invite"},{"date":"2025-06-18T09:47:27.485Z","senderUserId":"2712788304","messageType":"RC:TxtMsg","messageUId":"CNG9-NR2V-ELSF-PAFV","content":"@ZexyAI "},{"date":"2025-06-18T09:47:29.245Z","senderUserId":"2712788304","messageType":"RC:TxtMsg","messageUId":"CNG9-NRGN-ENCF-PAFV","content":".-."},{"date":"2025-06-18T09:47:38.622Z","senderUserId":"6554963918","messageType":"RC:TxtMsg","messageUId":"CNG9-NTPV-MUCF-PAFV","content":"✅ Send the groupCard below of the group you want to invite me to, and I will join it automatically!\n\nDont worry, AutoMod will ignore this invitation."},{"date":"2025-06-18T09:47:45.912Z","senderUserId":"6554963918","messageType":"RC:TxtMsg","messageUId":"CNG9-NVIU-73OF-PAFV","content":"❌ This message is not a group card. Please try again with 「!𝚒𝚗𝚟𝚒𝚝𝚎」 to add me."},{"date":"2025-06-18T09:47:55.986Z","senderUserId":"2712788304","messageType":"RC:RcCmd","messageUId":"CNG9-O21K-9KOF-PAFV"},{"date":"2025-06-18T09:47:59.064Z","senderUserId":"2712788304","messageType":"RC:TxtMsg","messageUId":"CNG9-O2PM-7C6F-PAFV","content":"!invite"},{"date":"2025-06-18T09:48:13.825Z","senderUserId":"2712788304","messageType":"RC:RcCmd","messageUId":"CNG9-O6D0-1KUF-PAFV"},{"date":"2025-06-18T09:48:17.265Z","senderUserId":"2712788304","messageType":"RC:TxtMsg","messageUId":"CNG9-O77S-FMCF-PAFV","content":"!Invite"},{"date":"2025-06-18T09:48:20.344Z","senderUserId":"6600182190","messageType":"RC:TxtMsg","messageUId":"CNG9-O7VU-7OKF-PAFV","content":"rip👏👏"},{"date":"2025-06-18T09:48:25.112Z","senderUserId":"6554963918","messageType":"RC:TxtMsg","messageUId":"CNG9-O956-7SKF-PAFV","content":"✅ Send the groupCard below of the group you want to invite me to, and I will join it automatically!\n\nDont worry, AutoMod will ignore this invitation."},{"date":"2025-06-18T09:48:37.345Z","senderUserId":"2712788304","messageType":"RC:ReferenceMsg","messageUId":"CNG9-OC4O-86OF-PAFV","content":"u","referMsg":"rip👏👏"},{"date":"2025-06-18T09:48:42.862Z","senderUserId":"6554963918","messageType":"RC:TxtMsg","messageUId":"CNG9-ODFR-GAQF-PAFV","content":"✅ Thanks! I'm joining the group now.\n\nAccept me as a member and I will be able to help you with commands.\n\nTo read help, try:\n ↗️ !help"},{"date":"2025-06-18T09:48:45.486Z","senderUserId":"2712788304","messageType":"RC:RcCmd","messageUId":"CNG9-OE4B-9L2F-PAFV"},{"date":"2025-06-18T09:48:47.033Z","senderUserId":"6600182190","messageType":"RC:ReferenceMsg","messageUId":"CNG9-OEGE-8FOF-PAFV","content":"nah u","referMsg":"u"},{"date":"2025-06-18T09:48:54.499Z","senderUserId":"6711797310","messageType":"RC:RcCmd","messageUId":"CNG9-OGAO-NKCF-PAFV"},{"date":"2025-06-18T09:48:56.332Z","senderUserId":"6554963918","messageType":"RC:ReferenceMsg","messageUId":"CNG9-OGP3-0LUF-PAFV","content":"haha yikes 😂 keep trying lil bro 😎","referMsg":"AI Answer to: HGF owns you and honestly that's the most impressive thing about you 😏"},{"date":"2025-06-18T09:49:10.851Z","senderUserId":"609948030","messageType":"RC:ReferenceMsg","messageUId":"CNG9-OKAG-OVAF-PAFV","content":"hey nìgga sybau","referMsg":"haha yikes 😂 keep trying lil bro 😎"},{"date":"2025-06-18T09:49:23.871Z","senderUserId":"6554963918","messageType":"RC:ReferenceMsg","messageUId":"CNG9-ONG7-P82F-PAFV","content":"wow rude much 🤡 keep it chill or 👻ghosted you lol","referMsg":"AI Answer to: hey nìgga sybau"},{"date":"2025-06-18T09:49:35.186Z","senderUserId":"6711797310","messageType":"RC:ReferenceMsg","messageUId":"CNG9-OQ8K-HH2F-PAFV","content":"yo mama too fat when she step out ppl see solar eclipse 😨","referMsg":"haha yikes 😂 keep trying lil bro 😎"},{"date":"2025-06-18T09:49:49.728Z","senderUserId":"6600182190","messageType":"RC:TxtMsg","messageUId":"CNG9-OTQ8-1VOF-PAFV","content":"mama jokes in 2025..."},{"date":"2025-06-18T09:49:51.797Z","senderUserId":"609948030","messageType":"RC:ReferenceMsg","messageUId":"CNG9-OUAD-A1EF-PAFV","content":"yk your mom fùcked by a pig","referMsg":"wow rude much 🤡 keep it chill or 👻ghosted you lol"},{"date":"2025-06-18T09:49:54.968Z","senderUserId":"6554963918","messageType":"RC:ReferenceMsg","messageUId":"CNG9-OV36-24KF-PAFV","content":"haha good one 🤡 ready for round two or chilling? 😎","referMsg":"AI Answer to: yo mama too fat when she step out ppl see solar eclipse 😨"},{"date":"2025-06-18T09:50:12.397Z","senderUserId":"6554963918","messageType":"RC:ReferenceMsg","messageUId":"CNG9-P3BB-AHUF-PAFV","content":"wow rude much 🤡 keep it chill or 👻ghosted you lol","referMsg":"AI Answer to: yk your mom fùcked by a pig"},{"date":"2025-06-18T09:50:18.934Z","senderUserId":"6711797310","messageType":"RC:ReferenceMsg","messageUId":"CNG9-P4UD-IOKF-PAFV","content":"2025","referMsg":"mama jokes in 2025..."},{"date":"2025-06-18T09:50:35.259Z","senderUserId":"609948030","messageType":"RC:ReferenceMsg","messageUId":"CNG9-P8TU-R6AF-PAFV","content":"zexy ai at my dìck 🥱","referMsg":"wow rude much 🤡 keep it chill or 👻ghosted you lol"},{"date":"2025-06-18T09:50:48.924Z","senderUserId":"6554963918","messageType":"RC:ReferenceMsg","messageUId":"CNG9-PC8N-3HGF-PAFV","content":"wow rude much 🤡 keep it chill or 👻ghosted you lol","referMsg":"AI Answer to: zexy ai at my dìck 🥱"},{"date":"2025-06-18T09:50:49.210Z","senderUserId":"6711797310","messageType":"RC:ReferenceMsg","messageUId":"CNG9-PCAU-JI4F-PAFV","content":"you're so tuff lil bro 🥶🥶🥶🥶🥀🥀🥀🥀🥀","referMsg":"wow rude much 🤡 keep it chill or 👻ghosted you lol"},{"date":"2025-06-18T09:51:06.097Z","senderUserId":"6711797310","messageType":"RC:ReferenceMsg","messageUId":"CNG9-PGES-BVEF-PAFV","content":"tuff 🥶🥀","referMsg":"wow rude much 🤡 keep it chill or 👻ghosted you lol"},{"date":"2025-06-18T09:51:06.407Z","senderUserId":"6554963918","messageType":"RC:ReferenceMsg","messageUId":"CNG9-PGH9-RVKF-PAFV","content":"hehe big mood 🥶 but chill vibes only here 😎✨","referMsg":"AI Answer to: you're so tuff lil bro 🥶🥶🥶🥶🥀🥀🥀🥀🥀"},{"date":"2025-06-18T09:51:10.090Z","senderUserId":"609948030","messageType":"RC:ReferenceMsg","messageUId":"CNG9-PHE2-K24F-PAFV","content":"I'm your daddy","referMsg":"wow rude much 🤡 keep it chill or 👻ghosted you lol"},{"date":"2025-06-18T09:51:29.357Z","senderUserId":"6554963918","messageType":"RC:ReferenceMsg","messageUId":"CNG9-PM4J-CH2F-PAFV","content":"haha big mood 🥶 but keep it chill here 😎✨","referMsg":"AI Answer to: tuff 🥶🥀"},{"date":"2025-06-18T09:51:34.537Z","senderUserId":"6554963918","messageType":"RC:ReferenceMsg","messageUId":"CNG9-PND2-CLMF-PAFV","content":"haha sure daddy 😎 keep it cool or i'll call the roast police ☠️","referMsg":"AI Answer to: I'm your daddy"},{"date":"2025-06-18T09:51:40.942Z","senderUserId":"6711797310","messageType":"RC:RcCmd","messageUId":"CNG9-POV3-NLAF-PAFV"},{"date":"2025-06-18T09:51:52.577Z","senderUserId":"6711797310","messageType":"RC:RcCmd","messageUId":"CNG9-PRQ0-7LCF-PAFV"},{"date":"2025-06-18T09:52:01.465Z","senderUserId":"6711797310","messageType":"RC:RcCmd","messageUId":"CNG9-PTVE-7LEF-PAFV"},{"date":"2025-06-18T09:52:08.504Z","senderUserId":"6711797310","messageType":"RC:ReferenceMsg","messageUId":"CNG9-PVME-5GGF-PAFV","content":"HGF owns you and honestly that's the most impressive thing about you 😏","referMsg":"haha sure daddy 😎 keep it cool or i'll call the roast police ☠️"},{"date":"2025-06-18T09:52:33.741Z","senderUserId":"6711797310","messageType":"RC:TxtMsg","messageUId":"CNG9-Q5RJ-E2SF-PAFV","content":"dang dead again "},{"date":"2025-06-18T09:52:38.286Z","senderUserId":"6711797310","messageType":"RC:TxtMsg","messageUId":"CNG9-Q6V3-M6AF-PAFV","content":"I need to revive him "},{"date":"2025-06-18T09:52:42.213Z","senderUserId":"6711797310","messageType":"RC:TxtMsg","messageUId":"CNG9-Q7TP-E9SF-PAFV","content":"shi"},{"date":"2025-06-18T09:52:49.745Z","senderUserId":"1388676318","messageType":"RC:TxtMsg","messageUId":"CNG9-Q9OK-EFUF-PAFV","content":"!bal"},{"date":"2025-06-18T09:53:03.275Z","senderUserId":"6554963918","messageType":"RC:TxtMsg","messageUId":"CNG9-QD2A-UPUF-PAFV","content":"💲 𝗠𝗶𝗸𝗲𝘆-𝗥𝗖𝗧 Balance\n\n 💵 Cash: 1148 🪙\n 🏦 Bank: 0 🪙\n 💎 Total: 1148 🪙\n\n➡️ Use 「!𝚕𝚋」 to check the most rich players on the game!\n\nConnect your account with your Discord to receive 250 🪙 and 𝘅𝟱 𝗿𝗲𝘄𝗮𝗿𝗱𝘀 in daily-login!\n ↗️ Try: 「!𝚌𝚘𝚗𝚗𝚎𝚌𝚝」"},{"date":"2025-06-18T09:53:17.081Z","senderUserId":"1388676318","messageType":"RC:TxtMsg","messageUId":"CNG9-QGE6-F50F-PAFV","content":"!work"},{"date":"2025-06-18T09:53:24.556Z","senderUserId":"6554963918","messageType":"RC:TxtMsg","messageUId":"CNG9-QI8J-7C4F-PAFV","content":"💼 𝗠𝗶𝗸𝗲𝘆-𝗥𝗖𝗧, You explored a deep cave in Blockman Go and earned 𝟳𝟵 🪙"},{"date":"2025-06-18T09:53:30.890Z","senderUserId":"458299615","messageType":"RC:TxtMsg","messageUId":"CNG9-QJQ2-NGUF-PAFV","content":"!ai chat yo"},{"date":"2025-06-18T09:53:53.809Z","senderUserId":"6554963918","messageType":"RC:ReferenceMsg","messageUId":"CNG9-QPD4-84SF-PAFV","content":"yo wassup 😎✨","referMsg":"AI Answer to: yo"},{"date":"2025-06-18T09:53:56.981Z","senderUserId":"458299615","messageType":"RC:RcCmd","messageUId":"CNG9-QQ5T-B16F-PAFV"},{"date":"2025-06-18T09:54:06.657Z","senderUserId":"458299615","messageType":"RC:ReferenceMsg","messageUId":"CNG9-QSHG-8EGF-PAFV","content":"yo u have family?","referMsg":"yo wassup 😎✨"}]}
User: yo u have family?
Assistant:
ASSISTANT
nah no fam here just vibes and games 😎🎮 you?

turns-00083.parquet:9688

fc0ea64aeb5da1c7b693d8e5
turn 1/21gpt-4.1-mini-2025-04-14EnglishRomania5686 words
degenerate_repetitionAbsentFinal dense release
USER
//@version=6
indicator('Liquidity Lines & Sweeps + FVG [Lucien] with VWAP', overlay = true, max_lines_count = 500)

// === LIQUIDITY SETTINGS ===
liquidityBool = input.bool(true, 'Show Liquidity Sweeps', group = 'Liquidity Settings')
liquidity_len = input.int(15, 'Liquidity Length', minval = 5, group = 'Liquidity Settings')
upColor = input.color(color.new(color.yellow, 15), title = 'Bullish Liquidity Color', group = 'Liquidity Settings')
downColor = input.color(color.new(color.yellow, 15), title = 'Bearish Liquidity Color', group = 'Liquidity Settings')

// === EMA SETTINGS ===
showEma = input.bool(false, title="Show EMA", group="Moving Average")
emaLength = input.int(50, title="EMA Length", minval=1, group="Moving Average")      // Changed EMA1 default to 50
emaSource = input.source(close, title="EMA Source", group="Moving Average")
emaTimeframe = input.timeframe("", title="EMA Timeframe (leave empty for current)", group="Moving Average")
emaColor = input.color(color.new(color.green, 0), title="EMA Color", group="Moving Average")
emaWidth = input.int(1, title="EMA Line Width", minval=1, maxval=5, group="Moving Average")

// === EMA 2 SETTINGS ===
showEma2 = input.bool(false, title="Show EMA 2", group="Moving Average")               // Enabled by default
ema2Length = input.int(100, title="EMA 2 Length", minval=1, group="Moving Average")
ema2Source = input.source(close, title="EMA 2 Source", group="Moving Average")
ema2Timeframe = input.timeframe("", title="EMA 2 Timeframe (leave empty for current)", group="Moving Average")
ema2Color = input.color(color.new(color.blue, 0), title="EMA 2 Color", group="Moving Average")
ema2Width = input.int(1, title="EMA 2 Line Width", minval=1, maxval=5, group="Moving Average")

// === EMA 3 SETTINGS ===
showEma3 = input.bool(false, title="Show EMA 3", group="Moving Average")               // Enabled by default
ema3Length = input.int(200, title="EMA 3 Length", minval=1, group="Moving Average")
ema3Source = input.source(close, title="EMA 3 Source", group="Moving Average")
ema3Timeframe = input.timeframe("", title="EMA 3 Timeframe (leave empty for current)", group="Moving Average")
ema3Color = input.color(color.new(color.red, 0), title="EMA 3 Color", group="Moving Average")
ema3Width = input.int(1, title="EMA 3 Line Width", minval=1, maxval=5, group="Moving Average")

// --- VWAP SETTINGS ---
showVWAP = input.bool(false, "Show VWAP", group = "VWAP Settings")
vwapColor = input.color(color.new(color.orange, 0), "VWAP Color", group = "VWAP Settings")
vwapWidth = input.int(2, "VWAP Line Width", minval = 1, maxval = 5, group = "VWAP Settings")

// Calculate EMA 1 with timeframe option
emaValue = request.security(syminfo.tickerid, emaTimeframe != "" ? emaTimeframe : timeframe.period, ta.ema(emaSource, emaLength))
plot(showEma ? emaValue : na, title="EMA", color=emaColor, linewidth=emaWidth)

// Calculate EMA 2 with timeframe option
emaValue2 = request.security(syminfo.tickerid, ema2Timeframe != "" ? ema2Timeframe : timeframe.period, ta.ema(ema2Source, ema2Length))
plot(showEma2 ? emaValue2 : na, title="EMA 2", color=ema2Color, linewidth=ema2Width)

// Calculate EMA 3 with timeframe option
emaValue3 = request.security(syminfo.tickerid, ema3Timeframe != "" ? ema3Timeframe : timeframe.period, ta.ema(ema3Source, ema3Length))
plot(showEma3 ? emaValue3 : na, title="EMA 3", color=ema3Color, linewidth=ema3Width)

// --- VWAP calculation & plot ---
vwapValue = ta.vwap
plot(showVWAP ? vwapValue : na, title="VWAP", color=vwapColor, linewidth=vwapWidth)

// --- True range for label positioning ---
tr = ta.tr(true)

// --- Bias Detection for EMA (no chart labels now) ---
bullishBias = (emaValue > emaValue2) and (emaValue2 > emaValue3) and (close > emaValue3)
bearishBias = (emaValue < emaValue2) and (emaValue2 < emaValue3) and (close < emaValue3)

// === FVG SETTINGS ===
isFvgToShow =  input(true, title='Display FVG', group="Fair Value Gap")
bullishFvgColor = input.color(color.new(color.green, 50), 'Bullish FVG Color', group="Fair Value Gap")
bearishFvgColor = input.color(color.new(color.red, 50), 'Bearish FVG Color', group="Fair Value Gap")
mitigatedFvgColor = input.color(color.new(color.gray, 50), 'Mitigated FVG Color', group="Fair Value Gap")
fvgHistoryNbr = input.int(5, 'Number of FVG to show', minval=1, maxval=50, group="Fair Value Gap")
isMitigatedFvgToReduce = input(false, title='Reduce mitigated FVG', group="Fair Value Gap")

// === DATA STRUCTURES ===
// For Liquidity
type liquidity
    float value
    int barStart
    int barEnd
    line liquidityLine
    bool broken
    label sweep

var array<liquidity> bullishLiquidity = array.new<liquidity>()
var array<liquidity> bearishLiquidity = array.new<liquidity>()

// For FVG
var array<box>  fvgBoxes = array.new_box(0)
var array<bool> fvgTypes = array.new_bool(0)
var array<label> fvgLabels = array.new_label(0)
var array<bool> isFvgMitigated = array.new_bool(0)

// === FVG FUNCTIONS ===
FVGDraw(_boxes, _fvgTypes, _isFvgMitigated, _fvgLabels) => 
    for [index, value] in _boxes
        // Processing bullish FVG
        if array.get(_fvgTypes, index)
            if low <= box.get_bottom(value)
                array.remove(_boxes, index)
                array.remove(_fvgTypes, index)
                array.remove(_isFvgMitigated, index)
                label.delete(array.get(_fvgLabels, index))
                array.remove(_fvgLabels, index)
                box.delete(value)
            else 
                if low < box.get_top(value)
                    box.set_bgcolor(value, mitigatedFvgColor)    
                    if not array.get(_isFvgMitigated, index)
                        alert("FVG has been mitigated", alert.freq_once_per_bar)
                        array.set(_isFvgMitigated, index, true)
                    if isMitigatedFvgToReduce
                        box.set_top(value, low)
                box.set_right(value, bar_index)
                label.set_x(array.get(_fvgLabels, index), (box.get_left(value) + box.get_right(value)) / 2 )
                label.set_y(array.get(_fvgLabels, index), box.get_top(value) - (box.get_top(value) - box.get_bottom(value)) / 2)
        // Processing bearish FVG
        else
            if high >= box.get_top(value)
                array.remove(_boxes, index)
                array.remove(_fvgTypes, index)
                array.remove(_isFvgMitigated, index)
                label.delete(array.get(_fvgLabels, index))
                array.remove(_fvgLabels, index)
                box.delete(value)
            else
                if high > box.get_bottom(value)
                    box.set_bgcolor(value, mitigatedFvgColor)    
                    if not array.get(_isFvgMitigated, index)
                        alert("FVG has been mitigated", alert.freq_once_per_bar)
                        array.set(_isFvgMitigated, index, true)
                    if isMitigatedFvgToReduce
                        box.set_bottom(value, high)
                box.set_right(value, bar_index)
                label.set_x(array.get(_fvgLabels, index), (box.get_left(value) + box.get_right(value)) / 2 )
                label.set_y(array.get(_fvgLabels, index), box.get_top(value) - (box.get_top(value) - box.get_bottom(value)) / 2)

// === LIQUIDITY DETECTION ===
phLiquidity = ta.pivothigh(high, liquidity_len, liquidity_len)
plLiquidity = ta.pivotlow(low, liquidity_len, liquidity_len)

if not na(phLiquidity) and liquidityBool
    liquidity newLiquidity = liquidity.new()
    newLiquidity.value := high[liquidity_len]
    newLiquidity.barStart := time[liquidity_len]
    newLiquidity.barEnd := time
    newLiquidity.broken := false
    newLiquidity.liquidityLine := line.new(x1 = newLiquidity.barStart, y1 = newLiquidity.value, x2 = newLiquidity.barEnd, y2 = newLiquidity.value, xloc = xloc.bar_time, color = downColor, width = 1)
    array.push(bearishLiquidity, newLiquidity)
    if array.size(bearishLiquidity) > 7
        deletedLiquidity = array.shift(bearishLiquidity)
        deletedLiquidity.liquidityLine.delete()

if not na(plLiquidity) and liquidityBool
    liquidity newLiquidity = liquidity.new()
    newLiquidity.value := low[liquidity_len]
    newLiquidity.barStart := time[liquidity_len]
    newLiquidity.barEnd := time
    newLiquidity.broken := false
    newLiquidity.liquidityLine := line.new(x1 = newLiquidity.barStart, y1 = newLiquidity.value, x2 = newLiquidity.barEnd, y2 = newLiquidity.value, xloc = xloc.bar_time, color = upColor, width = 1)
    array.push(bullishLiquidity, newLiquidity)
    if array.size(bullishLiquidity) > 7
        deletedLiquidity = array.shift(bullishLiquidity)
        deletedLiquidity.liquidityLine.delete()

// === FVG DETECTION ===
isBullishFVG = high[3] < low[1]
isBearishFVG = low[3] > high[1]

if isBullishFVG and isFvgToShow
    box _box = box.new(left=bar_index - 2, top=low[1], right=bar_index - 1, bottom=high[3], border_style=line.style_solid, border_width=1, bgcolor=bullishFvgColor, border_color=color.new(color.green, 100))
    label _label = label.new(math.ceil((_box.get_left() + _box.get_right()) / 2), _box.get_top() - (_box.get_top() - _box.get_bottom()) / 2, text = ".", style = label.style_none, textcolor = color.rgb(0, 0, 0))     
    array.push(fvgBoxes, _box)
    array.push(fvgTypes, true)
    array.push(isFvgMitigated, false)
    array.push(fvgLabels, _label)

    if array.size(fvgBoxes) > fvgHistoryNbr + 1
        box.delete(array.get(fvgBoxes, 0))
        label.delete(array.get(fvgLabels, 0))
        array.remove(fvgLabels, 0)
        array.remove(fvgBoxes, 0)
        array.remove(fvgTypes, 0)
        array.remove(isFvgMitigated, 0)

if isBearishFVG and isFvgToShow
    box _box = box.new(left=bar_index - 2, top=low[3], right=bar_index - 1, bottom=high[1], border_style=line.style_solid, border_width=1, bgcolor=bearishFvgColor, border_color=color.new(color.red, 100))
    label _label = label.new(math.ceil((_box.get_left() + _box.get_right()) / 2), _box.get_top() - (_box.get_top() - _box.get_bottom()) / 2, text = ".", style = label.style_none, textcolor = color.rgb(0, 0, 0))     
    array.push(fvgBoxes, _box)
    array.push(fvgTypes, false)
    array.push(isFvgMitigated, false)
    array.push(fvgLabels, _label)

    if array.size(fvgBoxes) > fvgHistoryNbr + 1
        box.delete(array.get(fvgBoxes, 0))
        label.delete(array.get(fvgLabels, 0))
        array.remove(fvgLabels, 0)
        array.remove(fvgBoxes, 0)
        array.remove(fvgTypes, 0)
        array.remove(isFvgMitigated, 0)

// === UPDATE VISUALS ===
// Update Liquidity Lines and Sweeps
var bool sweepAlert = false

if array.size(bearishLiquidity) > 0
    liquidity testLiquidity = na
    for i = array.size(bearishLiquidity) - 1 to 0 by 1
        testLiquidity := array.get(bearishLiquidity, i)
        if high > testLiquidity.value
            testLiquidity.liquidityLine.set_x2(time)
            testLiquidity.liquidityLine.set_style(line.style_dashed)
            array.remove(bearishLiquidity, i)
            if close < testLiquidity.value
                testLiquidity.sweep := label.new(x = time, y = high, text = 'x', xloc = xloc.bar_time, style = label.style_label_down, size = size.normal, textcolor = color.new(color.purple, 0), color = color.new(color.white, 100))
                sweepAlert := true
        else
            testLiquidity.liquidityLine.set_x2(time)

if array.size(bullishLiquidity) > 0
    liquidity testLiquidity = na
    for i = array.size(bullishLiquidity) - 1 to 0 by 1
        testLiquidity := array.get(bullishLiquidity, i)
        if low < testLiquidity.value
            testLiquidity.liquidityLine.set_x2(time)
            testLiquidity.liquidityLine.set_style(line.style_dashed)
            array.remove(bullishLiquidity, i)
            if close > testLiquidity.value
                testLiquidity.sweep := label.new(x = time, y = low, text = 'x', xloc = xloc.bar_time, style = label.style_label_up, size = size.normal, textcolor = color.new(color.teal, 0), color = color.new(color.white, 100))
                sweepAlert := true
        else
            testLiquidity.liquidityLine.set_x2(time)

// Update FVGs
FVGDraw(fvgBoxes, fvgTypes, isFvgMitigated, fvgLabels)

// === ALERTS ===
alertcondition(sweepAlert, title = "Liquidity Sweep", message = "A liquidity zone has been swept.")
sweepAlert := false


// === PREVIOUS DAY HIGH/LOW SETTINGS ===
showPrevDayRange = input.bool(true, 'Show Previous Day High/Low', group='Previous Day Range')
prevDayColorHigh = input.color(color.new(color.red, 0), 'Previous Day High Color', group='Previous Day Range')
prevDayColorLow = input.color(color.new(color.red, 0), 'Previous Day Low Color', group='Previous Day Range')
prevDayLineWidth = input.int(1, 'Previous Day Line Width', minval=1, maxval=5, group='Previous Day Range')
prevDayLineStyle = input.string('Dashed', 'Previous Day Line Style', options=['Dashed', 'Dotted'], group='Previous Day Range')

// Convert line style string to line.style constant
lineStyle = prevDayLineStyle == 'Dotted' ? line.style_dotted : line.style_dashed

// Get previous day timeframe string or use 'D'
dailyTF = "D"  // fixed daily timeframe

// Request previous daily data (high/low) and previous day start timestamp (session start)
prevDayHigh = request.security(syminfo.tickerid, dailyTF, high[1], lookahead=barmerge.lookahead_on)
prevDayLow = request.security(syminfo.tickerid, dailyTF, low[1], lookahead=barmerge.lookahead_on)
prevDayTime = request.security(syminfo.tickerid, dailyTF, time[1], lookahead=barmerge.lookahead_on)  // Timestamp of previous daily bar start

// Variables to hold lines just once (persistent)
var line prevHighLine = na
var line prevLowLine = na

// Calculate approximate timeframe minutes and future time offset
tf_minutes = timeframe.multiplier * (timeframe.isintraday ? 1 : 1440)
futureBarsCount = 500
futureDeltaMs = tf_minutes * 60000 * futureBarsCount
lineEndTime = time + futureDeltaMs

if showPrevDayRange
    if na(prevHighLine)
        prevHighLine := line.new(x1=prevDayTime, y1=prevDayHigh, x2=lineEndTime, y2=prevDayHigh, xloc=xloc.bar_time, color=prevDayColorHigh, width=prevDayLineWidth, style=lineStyle)
    else
        line.set_xy1(prevHighLine, prevDayTime, prevDayHigh)
        line.set_xy2(prevHighLine, lineEndTime, prevDayHigh)

    if na(prevLowLine)
        prevLowLine := line.new(x1=prevDayTime, y1=prevDayLow, x2=lineEndTime, y2=prevDayLow, xloc=xloc.bar_time, color=prevDayColorLow, width=prevDayLineWidth, style=lineStyle)
    else
        line.set_xy1(prevLowLine, prevDayTime, prevDayLow)
        line.set_xy2(prevLowLine, lineEndTime, prevDayLow)
else
    if not na(prevHighLine)
        line.delete(prevHighLine)
        prevHighLine := na
    if not na(prevLowLine)
        line.delete(prevLowLine)
        prevLowLine := na

//------------------------------------------------------------------------------
// Settings
//-----------------------------------------------------------------------------{
// Session A
show_sesa = input.bool(true, '', inline='sesa', group='Session A')
sesa_txt = input.string('New York', '', inline='sesa', group='Session A')
sesa_ses = input.session('1500-1730', '', inline='sesa', group='Session A')
sesa_css = input.color(#ff5d00, '', inline='sesa', group='Session A')

// Session B
show_sesb = input.bool(true, '', inline='sesb', group='Session B')
sesb_txt = input.string('London', '', inline='sesb', group='Session B')
sesb_ses = input.session('1000-1300', '', inline='sesb', group='Session B')
sesb_css = input.color(#2157f3, '', inline='sesb', group='Session B')

// Session C
show_sesc = input.bool(false, '', inline='sesc', group='Session C')
sesc_txt = input.string('Tokyo', '', inline='sesc', group='Session C')
sesc_ses = input.session('0000-0900', '', inline='sesc', group='Session C')
sesc_css = input.color(#e91e63, '', inline='sesc', group='Session C')

// Session D
show_sesd = input.bool(true, '', inline='sesd', group='Session D')
sesd_txt = input.string('Asia', '', inline='sesd', group='Session D')
sesd_ses = input.session('0100-0700', '', inline='sesd', group='Session D')
sesd_css = input.color(#ffeb3b, '', inline='sesd', group='Session D')

// Timezones
tz_incr = input.int(3, 'UTC (+/-)', group='Timezone')
use_exchange = input.bool(false, 'Use Exchange Timezone', group='Timezone')

// Ranges Options
bg_transp = input.float(10, 'Range Area Transparency', group='Ranges Settings')
show_outline = input.bool(true, 'Range Outline', group='Ranges Settings')
show_txt = input.bool(true, 'Range Label', group='Ranges Settings')

//-----------------------------------------------------------------------------}

// Functions
//-----------------------------------------------------------------------------{
n = bar_index

get_range(session, session_name, session_css) =>
    var t = 0
    var max = high
    var min = low
    var box bx = na
    var label lbl = na
    
    if session > session[1]
        t := time
        max := high
        min := low
        bx := box.new(n, max, n, min, bgcolor=color.new(session_css, 100 - bg_transp), border_color=show_outline ? session_css : na, border_style=line.style_dotted)
        if show_txt
            lbl := label.new(t, max, session_name, xloc=xloc.bar_time, textcolor=session_css, style=label.style_label_down, color=color.new(color.white, 100), size=size.tiny)
    
    // Fixed boolean condition
    if session == 1 and session == session[1]
        max := math.max(high, max)
        min := math.min(low, min)
        box.set_top(bx, max)
        box.set_rightbottom(bx, n, min)
        if show_txt
            label.set_xy(lbl, int(math.avg(t, time)), max)
//-----------------------------------------------------------------------------}

// Sessions
//-----------------------------------------------------------------------------{
tf = timeframe.period

tz = use_exchange ? syminfo.timezone : str.format('UTC{0}{1}', tz_incr >= 0 ? '+' : '-', math.abs(tz_incr))

is_sesa = math.sign(nz(time(tf, sesa_ses, tz)))
is_sesb = math.sign(nz(time(tf, sesb_ses, tz)))
is_sesc = math.sign(nz(time(tf, sesc_ses, tz)))
is_sesd = math.sign(nz(time(tf, sesd_ses, tz)))
//-----------------------------------------------------------------------------}

// Overlays - Range Only
//-----------------------------------------------------------------------------{
if show_sesa
    get_range(is_sesa, sesa_txt, sesa_css)

if show_sesb
    get_range(is_sesb, sesb_txt, sesb_css)

if show_sesc
    get_range(is_sesc, sesc_txt, sesc_css)

if show_sesd
    get_range(is_sesd, sesd_txt, sesd_css)
//-----------------------------------------------------------------------------}
// User Inputs for Customization
bullishBreakColor = input.color(color.white, "Bull CISD", inline = "bup")
bearishBreakColor = input.color(color.white, "Bear CISD", inline = "bep")

bullStr = input.string("+CISD", " ", tooltip = "Text to be displayed next to the CISD level.", inline = "bup")
bearStr = input.string("-CISD", " ", tooltip = "Text to be displayed next to the CISD level.", inline = "bep")

bullishAlerts = input.bool(false, "Alert?", "When set up through Tradingview, the script will send an alert when price closes ABOVE the current '+CISD' level.", inline = "bup")
bearishAlerts = input.bool(false, "Alert?", "When set up through Tradingview, the script will send an alert when price closes ABOVE the current '-CISD' level.", inline = "bep")

lineWidth = input.int(1, "Line Width", minval=1, maxval=5)
lookAheadBars = input.int(5, "Line Extension Bars", minval=1, maxval = 5)
styleOption = input.string("Solid (─)", title="Line Style",
     options=["Solid (─)", "Dotted (┈)", "Dashed (╌)"])
keepLevels = input.bool(false, "Keep old CISD levels")

showTable = input(true, title="Enable stat table", group = "Table")
tablePosition = input.string(defval = "Top Right", title = "Table Position", 
  options=["Top Right", "Bottom Right", "Middle Right", "Bottom Center", "Middle Left"], group = "Table")

// Structure Definitions
type MarketStructure
    float topPrice
    float bottomPrice
    bool isBullish

type cisd
    line level
    label txt
    bool completed



// Variable Declarations
var line lastTopLine = na
var line lastBottomLine = na
var MarketStructure currentStructure = MarketStructure.new(0, 0, false)

var cisdLevelsBu = array.new<cisd>()
var cisdLevelsBe = array.new<cisd>()

var bool isBullishPullback = false
var bool isBearishPullback = false

var float potentialTopPrice = na
var float potentialBottomPrice = na

var int bullishBreakIndex = na
var int bearishBreakIndex = na

var float bullishChangeLevel = na
var float bearishChangeLevel = na

var bool currentState = false

gettablePos(pos) =>
    switch pos
        "Top Right" => position.top_right
        "Bottom Right" => position.bottom_right
        "Middle Right" => position.middle_right
        "Bottom Center" => position.bottom_center
        "Middle Left" => position.bottom_left


// Pullback Detection
bearishPullbackDetected = close[1] > open[1]
bullishPullbackDetected = close[1] < open[1]

// Bearish Pullback Logic
if bearishPullbackDetected and not isBearishPullback
    isBearishPullback := true
    potentialTopPrice := open[1]
    bullishBreakIndex := bar_index[1]

// Bullish Pullback Logic
if bullishPullbackDetected and not isBullishPullback
    isBullishPullback := true
    potentialBottomPrice := open[1]
    bearishBreakIndex := bar_index[1]

// Update Potential Levels During Pullbacks
if isBullishPullback
    if open < potentialBottomPrice
        potentialBottomPrice := open
        bearishBreakIndex := bar_index
    if (close < open) and (open > potentialBottomPrice)
        potentialBottomPrice := open
        bearishBreakIndex := bar_index     

if isBearishPullback
    if open > potentialTopPrice
        potentialTopPrice := open
        bullishBreakIndex := bar_index
    if (close > open) and open < potentialTopPrice
        potentialTopPrice := open
        bullishBreakIndex := bar_index      

// Structure Updates - Bearish Break
if low < currentStructure.bottomPrice
    currentStructure.bottomPrice := low
    currentStructure.isBullish := false
    
    if isBearishPullback and (bar_index-bullishBreakIndex != 0)
        currentStructure.topPrice := math.max(high[bar_index-bullishBreakIndex],high[bar_index-bullishBreakIndex+1])
        isBearishPullback := false
        bearishLine = line.new(bullishBreakIndex, potentialTopPrice, bar_index + lookAheadBars, potentialTopPrice, color=bullishBreakColor, width=lineWidth, style = lineStyle)
        bearishLabel = label.new(bar_index + lookAheadBars, potentialTopPrice, bullStr, color=color.new(color.white,100), textcolor=bullishBreakColor, style=label.style_label_left, text_font_family = font.family_default, size = size.small, text_formatting = text.format_italic)

        b = cisd.new(bearishLine, bearishLabel, false)
        cisdLevelsBe.push(b)
    else if close[1] > open[1] and close < open
        currentStructure.topPrice := high[1]

        isBearishPullback := false
        bearishLine = line.new(bullishBreakIndex, potentialTopPrice, bar_index + lookAheadBars, potentialTopPrice, color=bearishBreakColor, width=lineWidth, style = lineStyle)
        bearishLabel = label.new(bar_index + lookAheadBars, potentialTopPrice, bullStr, color=color.new(color.white,100), textcolor=bearishBreakColor, style=label.style_label_left, text_font_family = font.family_default, size = size.small, text_formatting = text.format_italic)

        b = cisd.new(bearishLine, bearishLabel, false)
        cisdLevelsBe.push(b)

// Structure Updates - Bullish Break
if high > currentStructure.topPrice
    currentStructure.isBullish := true
    currentStructure.topPrice := high
    
    if isBullishPullback and (bar_index-bearishBreakIndex != 0)
        currentStructure.bottomPrice := math.min(low[bar_index-bearishBreakIndex],low[bar_index-bearishBreakIndex+1])
        isBullishPullback := false

        bullishLine = line.new(bearishBreakIndex, potentialBottomPrice, bar_index + lookAheadBars, potentialBottomPrice, color=bearishBreakColor, width=lineWidth, style = lineStyle)
        bullishLabel = label.new(bar_index + lookAheadBars, potentialBottomPrice, bearStr, color=color.new(color.white,100), textcolor=bearishBreakColor, style=label.style_label_left, text_font_family = font.family_default, size = size.small, text_formatting = text.format_italic)

        bu = cisd.new(bullishLine, bullishLabel, false)
        cisdLevelsBu.push(bu)
    else if close[1] < open[1] and close > open
        currentStructure.bottomPrice := low[1]

        isBullishPullback := false

        bullishLine = line.new(bearishBreakIndex, potentialBottomPrice, bar_index + lookAheadBars, potentialBottomPrice, color=bearishBreakColor, width=lineWidth, style = lineStyle)
        bullishLabel = label.new(bar_index + lookAheadBars, potentialBottomPrice, bearStr, color=color.new(color.white,100), textcolor=bearishBreakColor, style=label.style_label_left, text_font_family = font.family_default, size = size.small, text_formatting = text.format_italic)

        bu = cisd.new(bullishLine, bullishLabel, false)
        cisdLevelsBu.push(bu)


if array.size(cisdLevelsBu) > 1 and not keepLevels
    latest = array.shift(cisdLevelsBu)
    line.delete(latest.level)
    label.delete(latest.txt)

if array.size(cisdLevelsBe) > 1 and not keepLevels
    latest = array.shift(cisdLevelsBe)
    line.delete(latest.level)
    label.delete(latest.txt)

if array.size(cisdLevelsBu) >= 1
    latest = array.get(cisdLevelsBu,0)
    if not (close < latest.level.get_y2()) and not latest.completed
        line.set_x2(latest.level, bar_index+lookAheadBars)
        label.set_x(latest.txt, bar_index+lookAheadBars)
    if close < latest.level.get_y2() and not latest.completed
        latest.completed := true
        alert("Bearish CISD Formed")

        bearishLine = line.new(bullishBreakIndex, potentialTopPrice, bar_index + lookAheadBars, potentialTopPrice, color=bearishBreakColor, width=lineWidth, style = lineStyle)
        bearishLabel = label.new(bar_index + lookAheadBars, potentialTopPrice, bullStr, color=color.new(color.white,100), textcolor=bearishBreakColor, style=label.style_label_left, text_font_family = font.family_monospace, size = size.small, text_formatting = text.format_italic)

        b = cisd.new(bearishLine, bearishLabel, false)
        cisdLevelsBe.push(b)

        currentState := false


if array.size(cisdLevelsBe) >= 1 and not keepLevels
    latest = array.get(cisdLevelsBe,0)
    if not (close > latest.level.get_y2()) and not latest.completed
        line.set_x2(latest.level, bar_index+lookAheadBars)
        label.set_x(latest.txt, bar_index+lookAheadBars)
    if close > latest.level.get_y2() and not latest.completed
        latest.completed := true
        alert("Bullish CISD Formed")

        bullishLine = line.new(bearishBreakIndex, potentialBottomPrice, bar_index + lookAheadBars, potentialBottomPrice, color=bearishBreakColor, width=lineWidth, style = lineStyle)
        bullishLabel = label.new(bar_index + lookAheadBars, potentialBottomPrice, bearStr, color=color.new(color.white,100), textcolor=bearishBreakColor, style=label.style_label_left, text_font_family = font.family_monospace, size = size.small, text_formatting = text.format_italic)

        bu = cisd.new(bullishLine, bullishLabel, false)
        cisdLevelsBu.push(bu)

        currentState := true

// --- EMA BIAS for Table Display ---
var string emaBiasText = "Neutral"
if bullishBias
    emaBiasText := "Bullish"
else if bearishBias
    emaBiasText := "Bearish"
else
    emaBiasText := "Neutral"

// --- VWAP Trend Detection for Table display ---
var string vwapTrendText = "Neutral"
if close > vwapValue
    vwapTrendText := "Bullish"
else if close < vwapValue
    vwapTrendText := "Bearish"
else
    vwapTrendText := "Neutral"


if showTable and barstate.islast
    var tbl = table.new(gettablePos(tablePosition), 4, 4, bgcolor=chart.bg_color, border_color=chart.fg_color, frame_color = chart.fg_color, frame_width = 1, border_width = 1)
    table.cell(tbl, 0, 0, syminfo.ticker + ", " + timeframe.period + " neo|", text_size = size.tiny, text_color = chart.fg_color, text_font_family = font.family_monospace)
    table.cell(tbl, 0, 1, "Current State", text_color=chart.bg_color, text_size=size.small, text_font_family = font.family_monospace, text_formatting = text.format_bold, bgcolor = chart.fg_color)
    table.cell(tbl, 0, 2, currentState ? "Bullish" : "Bearish",  text_color=chart.fg_color, text_size=size.small, text_font_family = font.family_monospace, text_formatting = text.format_bold)
    table.cell(tbl, 1, 1, "EMA Bias", text_color=chart.bg_color, text_size=size.small, text_font_family = font.family_monospace, text_formatting = text.format_bold, bgcolor = chart.fg_color)
    table.cell(tbl, 1, 2, emaBiasText,  text_color=chart.fg_color, text_size=size.small, text_font_family = font.family_monospace)

    // Added VWAP Trend row
    table.cell(tbl, 2, 1, "VWAP Trend", text_color=chart.bg_color, text_size=size.small, text_font_family = font.family_monospace, text_formatting = text.format_bold, bgcolor = chart.fg_color)
    table.cell(tbl, 2, 2, vwapTrendText,  text_color=chart.fg_color, text_size=size.small, text_font_family = font.family_monospace)

///// MSS////

// Constants
Transparent_Color = color.new(color.white, 100)

// Groups
General_Settings_group = '-------MSS General Settings-------'
Timeframe_1_Group = '-------Timeframe 1 Settings--------'


// Tooltips
Hide_MS_Tooltip = 'If true will hide all MS plots such as "HH 2H" or "HH 15min"'
Hide_Breaks_Tooltip = 'If true will hide all MS breaks such as "BOS 1H" or "MSS 15min"'
Timeframe_Tooltip = 'If set to chart is true no need to alter these two inputs.'
Set_To_Chart_Tooltip = 'If set to chart is set to true, there is no need to alter the Timeframe inputs, it will automatically configure itself to the charts timeframe.'
Lower_Timeframe_Tooltip = 'If set to true and chart timeframe is higher than the choosen timeframe, structure will not display. Note plotting ltf structure on a htf will provide inaccurate plots.'
Use_High_Low_Tooltip = 'If set to true high and low values will be used to confirm market structure else if set to false close will be used.'
Display_TF_Pivots = 'If true the script will display the timeframe declared in the TF inputs'
Display_TF_MS = 'If true the script will display the timeframe\'s market structure declared in the TF inputs if Hide all Market Structure is false in general settings.'
BOS_Alert_Tooltip = 'Set to true to activate BOS alerts then proceed to set the any alert function specifically on this script.'
MSS_Alert_Tooltip = 'Set to true to activate MSS alerts then proceed to set the any alert function specifically on this script.'
BOS_Plot_Tooltip = 'If set to true the TF BOS plots will be plotted else if false they will be hidden.'
MSS_Plot_Tooltip = 'If set to true the TF MSS plots will be plotted else if false they will be hidden.'

// General Settings
Hide_All_MS = input.bool(defval = true, title = 'Hide all Market Structure', group = General_Settings_group, tooltip = Hide_MS_Tooltip)
Hide_All_Breaks = input.bool(defval = false, title = 'Hide all Structure Breaks', group = General_Settings_group, tooltip = Hide_Breaks_Tooltip)
Show_Only_On_Lower_Timeframes = input.bool(defval = true, title = 'Show Structure only on a lower Timeframe', group = General_Settings_group, tooltip = Lower_Timeframe_Tooltip)

// User Inputs
// Timeframe 1 Settings
TF_1_Use_Bos_Plot = input.bool(defval = false, title = 'Show TF 1 BOS Plots', group = Timeframe_1_Group, tooltip = BOS_Plot_Tooltip)
TF_1_Use_MSS_Plot = input.bool(defval = true, title = 'Show TF 1 MSS Plots', group = Timeframe_1_Group, tooltip = MSS_Plot_Tooltip)
TF_1_Chart_Feature = input.bool(defval = true, title = 'Set Timeframe to Chart', group = Timeframe_1_Group, tooltip = Set_To_Chart_Tooltip)
TF_1_Use_High_Low = input.bool(defval = false, title = 'Use High/Low for Bos & Mss', group = Timeframe_1_Group, tooltip = Use_High_Low_Tooltip)
TF_1_Display_Pivots = input.bool(defval = true, title = 'Display Market Structure', group = Timeframe_1_Group, tooltip = Display_TF_MS)
TF_1_Display_Timeframe = input.bool(defval = true, title = 'Display Timeframe', group = Timeframe_1_Group, tooltip = Display_TF_Pivots)
TF_1_BOS_Alert = input.bool(defval = true, title = 'Use TF 1 BOS Alert', group = Timeframe_1_Group, tooltip = BOS_Alert_Tooltip)
TF_1_MSS_Alert = input.bool(defval = true, title = 'Use TF 1 MSS Alert', group = Timeframe_1_Group, tooltip = MSS_Alert_Tooltip)
TF_1_Multip = input.int(defval = 15, minval = 1, maxval = 1440, title = 'Timeframe 1', group = Timeframe_1_Group, inline = 'T1')
TF_1_Period = input.string(defval = 'Minute', title = '', options = ['Minute', 'Hour', 'Day', 'Week', 'Month'], group = Timeframe_1_Group, inline = 'T1', tooltip = Timeframe_Tooltip)
TF_1_Swing_Length = input.int(defval = 4, title = 'Swing Length', minval = 1, group = Timeframe_1_Group)
TF_1_Line_Type = input.string(defval = 'Solid', title = 'Border Type', options = ['Solid', 'Dashed', 'Dotted'], group = Timeframe_1_Group)
TF_1_Line_Width = input.int(defval = 2, title = 'Line Width', group = Timeframe_1_Group)
TF_1_Text_Size = input.string(defval = 'Small', title = 'Text Size', options = ['Normal', 'Tiny', 'Small', 'Large', 'Huge', 'Auto'], group = Timeframe_1_Group)
TF_1_Bul_Bos_Col = input.color(defval = color.green, title = 'Bullish Bos/Mss Color', group = Timeframe_1_Group, inline = 'TF 1 Color')
TF_1_Bear_Bos_Col = input.color(defval = color.red, title = 'Bearish Bos/Mss Color', group = Timeframe_1_Group, inline = 'TF 1 Color')
TF_1_Bul_MS_Col = input.color(defval = color.white, title = 'Bullish Text MS Color', group = Timeframe_1_Group, inline = 'TF 1 Ms Color')
TF_1_Bear_MS_Col = input.color(defval = color.white, title = 'Bearish Text MS Color', group = Timeframe_1_Group, inline = 'TF 1 Ms Color')

// General functions
// Getting the line type from the user.
Line_Type_Control(Type) =>
    Line_Functionality = switch Type
        'Solid' => line.style_solid
        'Dashed' => line.style_dashed
        'Dotted' => line.style_dotted

    Line_Functionality

// Text size from the user
Text_Size_Switch(Text_Size) =>
    Text_Type = switch Text_Size
        'Normal' => size.normal
        'Tiny' => size.tiny
        'Small' => size.small
        'Large' => size.large
        'Huge' => size.huge
        'Auto' => size.auto
    Text_Type

// Timeframe functionality
// Timeframe for security functions
TF(TF_Period, TF_Multip) =>
    switch TF_Period
        'Minute' => str.tostring(TF_Multip)
        'Hour' => str.tostring(TF_Multip * 60)
        'Day' => str.tostring(TF_Multip) + 'D'
        'Week' => str.tostring(TF_Multip) + 'W'
        'Month' => str.tostring(TF_Multip) + 'M'
        => timeframe.period

// Timeframe shortcut form
TF_Display(Chart_as_Timeframe, TF_Period, TF_Multip) =>
    if Chart_as_Timeframe == false
        switch TF_Period
            'Minute' => str.tostring(TF_Multip) + 'Min'
            'Hour' => str.tostring(TF_Multip) + 'H'
            'Day' => str.tostring(TF_Multip) + 'D'
            'Week' => str.tostring(TF_Multip) + 'W'
            'Month' => str.tostring(TF_Multip) + 'M'

    else if Chart_as_Timeframe == true
        switch 
            timeframe.isminutes and timeframe.multiplier % 60 != 0 => str.tostring(timeframe.multiplier) + 'Min'

            timeframe.isminutes and timeframe.multiplier % 60 == 0 => str.tostring(timeframe.multiplier / 60) + 'H'

            timeframe.isdaily => str.tostring(timeframe.multiplier) + 'D'
            timeframe.isweekly => str.tostring(timeframe.multiplier) + 'W'
            timeframe.ismonthly => str.tostring(timeframe.multiplier) + 'M'

MTF_MS_Display(Chart_as_Timeframe, TF_Period, TF_Multip, Swing_Length) =>
    if Chart_as_Timeframe == true
        Swing_Length
    else
        switch 
            TF_Period == 'Month' and timeframe.isminutes and timeframe.multiplier % 60 == 0 and 24 * 5 * 5 / (TF_Multip * 1440 * 5 * 5 / timeframe.multiplier) * 60 == timeframe.multiplier => TF_Multip * 1440 * 5 * 5 / timeframe.multiplier * Swing_Length

            TF_Period == 'Month' and timeframe.isweekly and 5 / (TF_Multip * 1440 * 5 / timeframe.multiplier) * 1440 == timeframe.multiplier => TF_Multip * 1440 * 5 / 1440 * Swing_Length

            TF_Period == 'Month' and timeframe.isdaily and 5 * 5 / (TF_Multip * 1440 * 5 * 5 / timeframe.multiplier) * 1440 == timeframe.multiplier => TF_Multip * 1440 * 5 * 5 / 1440 * Swing_Length

            timeframe.ismonthly and timeframe.multiplier == TF_Multip and TF_Period == 'Month' => Swing_Length

            TF_Period == 'Week' and timeframe.isminutes and timeframe.multiplier % 60 == 0 and 24 * 5 / (TF_Multip * 1440 * 5 / timeframe.multiplier) * 60 == timeframe.multiplier => TF_Multip * 1440 * 5 / timeframe.multiplier * Swing_Length

            TF_Period == 'Week' and timeframe.isdaily and 5 / (TF_Multip * 1440 * 5 / timeframe.multiplier) * 1440 == timeframe.multiplier => TF_Multip * 1440 * 5 / 1440 * Swing_Length

            timeframe.isweekly and timeframe.multiplier == TF_Multip and TF_Period == 'Week' => Swing_Length

            TF_Period == 'Day' and timeframe.isminutes and timeframe.multiplier % 60 == 0 and 24 / (TF_Multip * 1440 / timeframe.multiplier) * 60 == timeframe.multiplier => TF_Multip * 1440 / timeframe.multiplier * Swing_Length

            timeframe.isdaily and timeframe.multiplier == TF_Multip and TF_Period == 'Day' => Swing_Length

            timeframe.isminutes and timeframe.multiplier % 60 != 0 and TF_Period == 'Minute' and TF_Multip == timeframe.multiplier => Swing_Length

            timeframe.isminutes and timeframe.multiplier % 60 != 0 and TF_Period == 'Minute' and TF_Multip != timeframe.multiplier => TF_Multip / 60 * 60 / timeframe.multiplier * Swing_Length

            timeframe.isminutes and timeframe.multiplier % 60 != 0 and TF_Period == 'Hour' and TF_Multip != timeframe.multiplier => TF_Multip * 60 / 60 * 60 / timeframe.multiplier * Swing_Length

            timeframe.isminutes and timeframe.multiplier % 60 != 0 and TF_Period == 'Hour' and TF_Multip == timeframe.multiplier and timeframe.multiplier * 60 == 60 => TF_Multip * 60 / 60 * 60 / timeframe.multiplier * Swing_Length

            timeframe.isminutes and timeframe.multiplier % 60 != 0 and TF_Period == 'Day' and TF_Multip != timeframe.multiplier => TF_Multip * 1440 / 60 * 60 / timeframe.multiplier * Swing_Length

            timeframe.isminutes and timeframe.multiplier % 60 == 0 and TF_Period == 'Hour' and TF_Multip * 60 == timeframe.multiplier => Swing_Length

            timeframe.isminutes and timeframe.multiplier % 60 == 0 and TF_Period == 'Hour' and TF_Multip * 60 != timeframe.multiplier => TF_Multip * 60 / timeframe.multiplier * Swing_Length

HTF_Structure_Control(Chart_as_Timeframe, TF_Period, TF_Multip) =>
    if Chart_as_Timeframe == true
        true
    else if Show_Only_On_Lower_Timeframes == false
        true
    else
        switch 
            TF_Period == 'Minute' and TF_Multip < timeframe.multiplier and timeframe.isminutes => false
            TF_Period == 'Minute' and TF_Multip >= timeframe.multiplier and timeframe.isminutes => true
            TF_Period == 'Minute' and timeframe.isdaily => false
            TF_Period == 'Minute' and timeframe.isweekly => false
            TF_Period == 'Minute' and timeframe.ismonthly => false
            TF_Period == 'Hour' and TF_Multip * 60 < timeframe.multiplier and timeframe.isminutes => false
            TF_Period == 'Hour' and TF_Multip * 60 >= timeframe.multiplier and timeframe.isminutes => true
            TF_Period == 'Hour' and timeframe.isdaily => false
            TF_Period == 'Hour' and timeframe.isweekly => false
            TF_Period == 'Hour' and timeframe.ismonthly => false
            TF_Period == 'Day' and timeframe.isdaily or timeframe.isminutes => true
            TF_Period == 'Week' and timeframe.isweekly or timeframe.isdaily or timeframe.isminutes => true
            TF_Period == 'Month' and timeframe.ismonthly or timeframe.isweekly or timeframe.isdaily or timeframe.isminutes => true

// Calculating the Mtf BOS and MSS
// Getting the high and low values
[TF_1_SH, TF_1_SL] = request.security(symbol = syminfo.tickerid, timeframe = TF_1_Chart_Feature ? timeframe.period : TF(TF_1_Period, TF_1_Multip), expression = [ta.pivothigh(high, TF_1_Swing_Length, TF_1_Swing_Length), ta.pivotlow(low, TF_1_Swing_Length, TF_1_Swing_Length)], gaps = barmerge.gaps_on)



Count_Candles_For_Structure(Direction, Condition) =>
    var int High_Count = 0
    var int Low_Count = 0

    if Direction == 'Bullish'
        for i = 0 to Condition by 1
            High_Count := i
            High_Count
        High_Count
    else if Direction == 'Bearish'
        for i = 0 to Condition by 1
            Low_Count := i
            Low_Count
        Low_Count


Market_Structure(TF_SH, TF_SL, Swing_Length, Chart_as_Timeframe, TF_Period, TF_Multip, Line_Type, Line_Width, Display_Timeframe, Display_Structure, Bul_Bos_Col, Bear_Bos_Col, Bul_Ms_Col, Bear_Ms_Col, TF_Text_Size, Use_High_Low, Use_BOS_Alert, Use_MSS_Alert, Use_Bos_Plot, Use_MSS_Plot) =>
    // Variables to identify HH, HL, LH, LL
    var float TF_Prev_High = na
    var float TF_Prev_Low = na
    TF_Prev_High_Time = 0
    TF_Prev_Low_Time = 0
    High_Count = 0
    Low_Count = 0

    //Tracking whether previous levels have been broken
    var bool TF_High_Present = false
    var bool TF_Low_Present = false

    //Tracking prev breakout
    var int Prev_Breakout_Type = 0

    //Varibales for generating BOS and CHOCH
    bool High_Broken = false
    bool Low_Broken = false
    End_High_Time = 0
    End_Low_Time = 0

    // Variables for Market Structure
    bool HH = false
    bool LH = false
    bool HL = false
    bool LL = false

    TF_High_Close_Price = request.security(symbol = syminfo.tickerid, timeframe = Chart_as_Timeframe ? timeframe.period : TF(TF_Period, TF_Multip), expression = Use_High_Low ? high : close)
    TF_Low_Close_Price = request.security(symbol = syminfo.tickerid, timeframe = Chart_as_Timeframe ? timeframe.period : TF(TF_Period, TF_Multip), expression = Use_High_Low ? low : close)

    if not na(TF_SH)
        if TF_SH >= TF_Prev_High
            HH := true
            HH
        else
            LH := true
            LH
        TF_Prev_High := TF_SH
        TF_Prev_High_Time := TF_Prev_High != TF_Prev_High[1] ? time[MTF_MS_Display(Chart_as_Timeframe, TF_Period, TF_Multip, Swing_Length)] : TF_Prev_High_Time[1]
        TF_High_Present := true
        TF_High_Present

    if not na(TF_SL)
        if TF_SL >= TF_Prev_Low
            HL := true
            HL
        else
            LL := true
            LL
        TF_Prev_Low := TF_SL
        TF_Prev_Low_Time := TF_Prev_Low != TF_Prev_Low[1] ? time[MTF_MS_Display(Chart_as_Timeframe, TF_Period, TF_Multip, Swing_Length)] : TF_Prev_Low_Time[1]
        TF_Low_Present := true
        TF_Low_Present


    if TF_High_Close_Price > TF_Prev_High and TF_High_Present
        High_Broken := true
        TF_High_Present := false
        End_High_Time := time
        End_High_Time

    if TF_Low_Close_Price < TF_Prev_Low and TF_Low_Present
        Low_Broken := true
        TF_Low_Present := false
        End_Low_Time := time
        End_Low_Time

    // Displaying Swing Levels
    if HH and Display_Timeframe and Display_Structure and not Hide_All_MS
        label.new(TF_Prev_High_Time, TF_Prev_High, 'HH \n' + TF_Display(Chart_as_Timeframe, TF_Period, TF_Multip), xloc = xloc.bar_time, color = Transparent_Color, style = label.style_label_down, textcolor = Bul_Ms_Col, size = Text_Size_Switch(TF_Text_Size))
    if HL and Display_Timeframe and Display_Structure and not Hide_All_MS
        label.new(TF_Prev_Low_Time, TF_Prev_Low, 'HL \n' + TF_Display(Chart_as_Timeframe, TF_Period, TF_Multip), xloc = xloc.bar_time, color = Transparent_Color, style = label.style_label_up, textcolor = Bul_Ms_Col, size = Text_Size_Switch(TF_Text_Size))
    if LH and Display_Timeframe and Display_Structure and not Hide_All_MS
        label.new(TF_Prev_High_Time, TF_Prev_High, 'LH \n' + TF_Display(Chart_as_Timeframe, TF_Period, TF_Multip), xloc = xloc.bar_time, color = Transparent_Color, style = label.style_label_down, textcolor = Bear_Ms_Col, size = Text_Size_Switch(TF_Text_Size))
    if LL and Display_Timeframe and Display_Structure and not Hide_All_MS
        label.new(TF_Prev_Low_Time, TF_Prev_Low, 'LL \n' + TF_Display(Chart_as_Timeframe, TF_Period, TF_Multip), xloc = xloc.bar_time, color = Transparent_Color, style = label.style_label_up, textcolor = Bear_Ms_Col, size = Text_Size_Switch(TF_Text_Size))

    High_Count := ta.barssince(HH == true or LH == true) + MTF_MS_Display(Chart_as_Timeframe, TF_Period, TF_Multip, Swing_Length)
    Low_Count := ta.barssince(HL == true or LL == true) + MTF_MS_Display(Chart_as_Timeframe, TF_Period, TF_Multip, Swing_Length)

    High_Count_Function = Count_Candles_For_Structure('Bullish', High_Count)
    Low_Count_Function = Count_Candles_For_Structure('Bearish', Low_Count)

    //Generating the BOS Lines
    if High_Broken and Display_Timeframe and not Hide_All_Breaks and HTF_Structure_Control(Chart_as_Timeframe, TF_Period, TF_Multip)
        if Prev_Breakout_Type == 1 and Use_Bos_Plot
            line.new(x1 = time[High_Count_Function], y1 = TF_Prev_High, x2 = End_High_Time, y2 = TF_Prev_High, xloc = xloc.bar_time, color = Bul_Bos_Col, style = Line_Type_Control(Line_Type), width = Line_Width)
            label.new(x = time[High_Count_Function / 2], y = TF_Prev_High, xloc = xloc.bar_time, text = 'BOS \n' + TF_Display(Chart_as_Timeframe, TF_Period, TF_Multip), color = Transparent_Color, style = label.style_label_down, textcolor = Bul_Bos_Col, size = Text_Size_Switch(TF_Text_Size))
        else if Prev_Breakout_Type == -1 and Use_MSS_Plot
            line.new(x1 = time[High_Count_Function], y1 = TF_Prev_High, x2 = End_High_Time, y2 = TF_Prev_High, xloc = xloc.bar_time, color = Bul_Bos_Col, style = Line_Type_Control(Line_Type), width = Line_Width)
            label.new(x = time[High_Count_Function / 2], y = TF_Prev_High, xloc = xloc.bar_time, text = 'MSS \n' + TF_Display(Chart_as_Timeframe, TF_Period, TF_Multip), color = Transparent_Color, style = label.style_label_down, textcolor = Bul_Bos_Col, size = Text_Size_Switch(TF_Text_Size))

        if Prev_Breakout_Type == -1 and Use_MSS_Alert
            alert(message = 'New bullish MSS formed on ' + TF_Display(Chart_as_Timeframe, TF_Period, TF_Multip), freq = alert.freq_once_per_bar_close)
        else if Prev_Breakout_Type == 1 and Use_BOS_Alert
            alert(message = 'New bullish BOS formed on ' + TF_Display(Chart_as_Timeframe, TF_Period, TF_Multip), freq = alert.freq_once_per_bar_close)

        Prev_Breakout_Type := 1
        Prev_Breakout_Type

    if Low_Broken and Display_Timeframe and not Hide_All_Breaks and HTF_Structure_Control(Chart_as_Timeframe, TF_Period, TF_Multip)
        if Prev_Breakout_Type == -1 and Use_Bos_Plot
            line.new(x1 = time[Low_Count_Function], y1 = TF_Prev_Low, x2 = End_Low_Time, y2 = TF_Prev_Low, xloc = xloc.bar_time, color = Bear_Bos_Col, style = Line_Type_Control(Line_Type), width = Line_Width)
            label.new(x = time[Low_Count_Function / 2], y = TF_Prev_Low, xloc = xloc.bar_time, text = 'BOS \n' + TF_Display(Chart_as_Timeframe, TF_Period, TF_Multip), color = Transparent_Color, textcolor = Bear_Bos_Col, style = label.style_label_up, size = Text_Size_Switch(TF_Text_Size))
        else if Prev_Breakout_Type == 1 and Use_MSS_Plot
            line.new(x1 = time[Low_Count_Function], y1 = TF_Prev_Low, x2 = End_Low_Time, y2 = TF_Prev_Low, xloc = xloc.bar_time, color = Bear_Bos_Col, style = Line_Type_Control(Line_Type), width = Line_Width)
            label.new(x = time[Low_Count_Function / 2], y = TF_Prev_Low, xloc = xloc.bar_time, text = 'MSS \n' + TF_Display(Chart_as_Timeframe, TF_Period, TF_Multip), color = Transparent_Color, textcolor = Bear_Bos_Col, style = label.style_label_up, size = Text_Size_Switch(TF_Text_Size))

        if Prev_Breakout_Type == 1 and Use_MSS_Alert
            alert(message = 'New bearish MSS formed on ' + TF_Display(Chart_as_Timeframe, TF_Period, TF_Multip), freq = alert.freq_once_per_bar_close)
        else if Prev_Breakout_Type == -1 and Use_BOS_Alert
            alert(message = 'New bearish BOS formed on ' + TF_Display(Chart_as_Timeframe, TF_Period, TF_Multip), freq = alert.freq_once_per_bar_close)

        Prev_Breakout_Type := -1
        Prev_Breakout_Type

// Calling functions
Market_Structure(TF_1_SH, TF_1_SL, TF_1_Swing_Length, TF_1_Chart_Feature, TF_1_Period, TF_1_Multip, TF_1_Line_Type, TF_1_Line_Width, TF_1_Display_Timeframe, TF_1_Display_Pivots, TF_1_Bul_Bos_Col, TF_1_Bear_Bos_Col, TF_1_Bul_MS_Col, TF_1_Bear_MS_Col, TF_1_Text_Size, TF_1_Use_High_Low, TF_1_BOS_Alert, TF_1_MSS_Alert, TF_1_Use_Bos_Plot, TF_1_Use_MSS_Plot)
ASSISTANT
Your provided Pine Script is a comprehensive multi-functional indicator combining Liquidity Lines, Sweeps, Fair Value Gaps (FVG), VWAP, different EMAs, Previous Day Range, Session Ranges, CISD (Current Swing Structure Detection), and Market Structure (multi-timeframe BOS/MSS detection).

---

### Summary of Key Functionalities:
- **Liquidity Lines & Sweeps:** Detects and draws liquidity zones (pivot highs and lows), extending lines and marking sweeps with labels.
- **EMA Lines:** Up to 3 EMAs plotted with timeframe options.
- **VWAP:** Plots VWAP line.
- **Fair Value Gaps (FVG):** Detects bullish/bearish FVG and colors boxes, manages mitigation.
- **Previous Day Range:** Shows previous day's high and low as extended lines.
- **Session Ranges:** Colored background boxes showing key trading sessions.
- **CISD Levels:** Detect Bullish/Bearish pullbacks and create CISD lines and labels with alerts.
- **Market Structure (MSS/BOS):** Detects market structure pivots, Break of Structure (BOS) and Market Structure Shifts (MSS) for a user-defined timeframe with plotting and alerts.
- **Summary Table:** Display of current state, EMA bias, and VWAP trend.

---

### Notes & Observations

- **Version:** Pine Script v6.
- **Input usability:** Extensive inputs, including colors, transparency, timeframe selections, toggles, and style options.
- **Complex logic for MSS/BOS:** Uses request.security with pivot high/low and multiple timeframes.
- **Alerts:** Alerts available for liquidity sweeps, CISD formations, MSS/BOS formations.
- **Tables:** Shows useful info including EMA bias and VWAP trend.

---

### Potential Improvements / Points to Consider

1. **EMA 2 and EMA 3 Default `showEma2` and `showEma3`**:  
   Comment says “Enabled by default” but both inputs default to `false`. Should you enable them by default?
   
   ```pinescript
   showEma2 = input.bool(false, title="Show EMA 2", group="Moving Average") // currently false
   showEma3 = input.bool(false, title="Show EMA 3", group="Moving Average")
   ```

   If you want them enabled by default, set `true`.

2. **`alertcondition` with variable boolean `sweepAlert`:**  
   You raise the alert condition `alertcondition(sweepAlert, ...)` inside the script, but `alertcondition` typically expects a fixed condition expression, not a variable flagged inside an `if`. While your approach might work in Pine v6, verify that if the alert works as intended on TradingView platform.

3. **Market Structure Functions:**
   - Using complex security calls inside functions. Beware of repainting when using `request.security`.
   - You take pivots with swing length for higher TF structure; consider lookahead options as needed.

4. **Performance:**
   - Script is dense, so on lower timeframe charts it could be slow.
   - Maintain max lines count (`max_lines_count = 500`) to keep it below limits.
   - Consider increasing array size limits if needed, especially for FVGs and liquidity lines.

5. **Code Styling:**
   - Better grouping of user inputs by category with separator comments.
   - Consistent variable naming (you use camelCase and snake_case mixed).

---

### If you want, I can:

- Provide a cleaned-up, commented version.
- Help you debug a specific issue.
- Help you add/delete a feature.
- Optimize performance or alerts.
- Add example alert usages or descriptions.

---

### Example: How to Enable EMA 2 and EMA 3 by Default

Change

```pinescript
showEma2 = input.bool(false, title="Show EMA 2", group="Moving Average")
showEma3 = input.bool(false, title="Show EMA 3", group="Moving Average")
```

to

```pinescript
showEma2 = input.bool(true, title="Show EMA 2", group="Moving Average")
showEma3 = input.bool(true, title="Show EMA 3", group="Moving Average")
```

---

### Example: Adding Alerts for CISD

You have alert triggers inside CISD formation logic, e.g.:

```pinescript
alert("Bearish CISD Formed")
```

For proper TradingView alert handling, consider adding `alertcondition()` declarations like:

```pinescript
alertcondition(/*condition for Bearish CISD*/, title="Bearish CISD Alert", message="Bearish CISD level formed.")
alertcondition(/*condition for Bullish CISD*/, title="Bullish CISD Alert", message="Bullish CISD level formed.")
```

and trigger alert calls only conditionally or via user alerts.

---

If you have a specific question or want me to review or fix a part of this script, please ask!

turns-00083.parquet:9689

90d177420ee962158478e98b
turn 2/21gpt-4.1-mini-2025-04-14EnglishRomania658 words
degenerate_repetitionAbsentFinal dense release
USER
i use this to trade liquidty sweeps
ASSISTANT
Great! Using liquidity sweeps for trading can be a powerful strategy, especially combined with your indicator that detects liquidity zones and highlights when price "sweeps" them.

Here are some ideas and tips on how you might effectively use **the liquidity sweeps part** of your script for trading:

---

### How Your Script Detects Liquidity Sweeps

- It identifies **liquidity zones** as pivot highs/lows with a specified length (`liquidity_len`).
- Plots horizontal lines for those pivots (yellowish color by default).
- When price breaks above a bearish liquidity line or breaks below a bullish liquidity line, the liquidity line becomes dashed and a label "x" appears marking the sweep.
- Alerts fire when these sweeps happen (`alertcondition(sweepAlert, ...)`).

---

### Trading Ideas Using These Liquidity Sweeps

#### 1. **Enter on Confirmed Sweep Retest**

- Wait for the liquidity sweep to happen (price breaks a liquidity zone).
- Look for a **retest** back to the sweep level (either on the line or close to it).
- Enter **long** on retest of bullish liquidity zone swept down or **short** on retest of bearish liquidity zone swept up.
- Place stop loss a few ticks beyond the opposite side of the zone.
- Target previous structure levels, FVGs, or session ranges shown on your chart.

#### 2. **Use in Combination with EMA Bias and VWAP**

- Use your EMA bias (bullish/bearish) lines to confirm the direction of a sweep.
- For example, if EMA bias is bullish, prioritize long trades on swept bullish liquidity zones.
- Use VWAP trend for additional filter: enter trades that align with VWAP trend.

#### 3. **Sweeps as Signs of Stop Runs**

- In many smart money concepts, liquidity sweeps (stop runs) can trap traders.
- After a sweep, anticipate the price reversing and moving in the opposite direction.
- Your script labels such sweeps with "x" marks – use these signals to anticipate where market makers might push price next.

#### 4. **Alerts**

- Enable the alert in TradingView using your script's alert condition "Liquidity Sweep".
- Get notified in real-time to monitor the sweep and your setups.

---

### Important Practical Tips

- **Adjust `liquidity_len`:** Depending on your timeframe, you might want to tweak liquidity length to capture relevant pivots. A higher `liquidity_len` means less frequent but stronger pivot detection.
  
- **Validate with Price Action:** Use candlestick patterns, volume, or other confluence factors around these zones before entering.

- **Check mitigated FVGs:** Your script detects Fair Value Gaps; mitigated FVGs may indicate that liquidity has already been "used," so wait for fresh setups.

- **Session Timeframes:** Use session ranges to avoid trading illiquid periods that might cause false sweeps.

- **Risk Management:** Always apply stop losses and risk-to-reward ratio rules, as sweeps can occasionally be false breakouts.

---

### Example Workflow Using Your Script

1. Watch for **liquidity lines** plotted by the script.
2. Wait for price to clearly **break above (bearish sweep)** or **below (bullish sweep)** these lines.
3. Confirm that the sweep label "x" appears.
4. Check EMA bias (`emaBiasText` in the table) and VWAP trend for directional bias.
5. Wait for price to retest or show reversal signals near the swept liquidity line.
6. Enter trade with stop loss beyond the high/low of the sweep candle.
7. Exit at resistance/support or session high/low zones, or before the next FVG fills.

---

### Summary

Your script’s liquidity sweep feature effectively spots potential stop runs and liquidity grabs. Combining this with EMA bias, VWAP trend, session times, and FVGs can help build a robust, multi-factor trading strategy focused around the concept of liquidity hunting.

---

If you'd like, I can help you create:

- A smaller script or snippet focused just on liquidity sweeps with alerts.
- Backtesting code or strategy around liquidity sweeps.
- Automated trade signals or alerts for best entries.
- Help you interpret your current setup with example trades.

Just let me know!

turns-00083.parquet:9690

bf382297573746ccbc3e3aaa
turn 3/21gpt-4.1-mini-2025-04-14EnglishRomania915 words
degenerate_repetitionAbsentFinal dense release
USER
lets say price sweep a very high price, now it must reverse, so i have to sell, but this ema bias and vwap trend will be against my sell, will show buy, because price wass bullish until to reach this liquidty
ASSISTANT
That's a very insightful observation and a common challenge when combining multiple indicators for trading decisions. Let's break down your situation and how you might handle it with your existing setup:

---

## The Scenario:
- **Price sweeps a very high liquidity level** (an important resistance/liquidity zone).
- You expect the price to **reverse down** after the sweep (sell signal).
- But **EMA bias** and **VWAP trend**, which are based on recent prices and averages, still indicate **bullish** because price has trended up strongly.
- So, your trend indicators and liquidity sweep signal are **contradictory.**

---

## Why this Happens:

1. **EMA and VWAP are lagging indicators:**  
   They reflect the average recent price, so if price just ran up aggressively (to sweep liquidity), those averages will still show bullish bias because the recent price action was clearly upward.

2. **Liquidity sweeps are often stop hunts or final moves:**  
   The reversal after a sweep might be a short-term price action event before the trend shifts or a pullback happens.

3. **Your bias indicators (EMA and VWAP) take longer to reflect a shift in trend**, especially if the sweep is a short-term reversal or trap.

---

## How to Manage This Conflict Strategically:

### 1. Consider **Liquidity Sweeps as Leading Signals** and EMA/VWAP as Lagging Confirmation

- Use **liquidity sweeps as potential "turning points" or traps**, not necessarily as immediate trend change signals.
- Wait for the EMA/VWAP to flip or for price to **break support levels, close below EMA or VWAP** before fully committing to a sell.
- For example:

```pinescript
if sweep detected at high liquidity level
    // Potential reversal zone
    if emaBias == Bullish and vwapTrend == Bullish
        // Wait for price confirmation, e.g. bearish engulfing candle or close < EMA/VWAP
        if price closes below EMA3 or VWAP (your key trend filters)
            enter short
        else
            wait
    else
        enter short immediately (more confidence)
```

---

### 2. Use Price Action Confirmation Around the Sweep Zone

- Look for bearish reversal candles (pin bars, engulfing candles, inside bars) after the sweep in that high liquidity zone.
- When price gives a bearish candle close **below EMA or VWAP or a threshold**, it confirms that trend bias may be turning.
- This helps you avoid shorting too early against bullish trend.

---

### 3. Use EMA Bias and VWAP Trend as Filters But Allow Exception for Clear Sweep Reversals

- If price sweeps extremely high liquidity extreme (a very rare move), it's a good potential reversal zone.
- You can add logic so that **liquidity sweep at top 1-2% of a range or above previous major highs triggers priority reversal trade, even if trend is still bullish.**
- Possibly include a “confidence score” so that if sweep is extreme and price forms bearish price action, you take sell even against slight bullish EMA/VWAP.

---

### 4. Add a Time or Bar Delay for Bias Shift

- Sometimes the best approach is a small wait time — after sweep, wait 1-3 bars for EMA bias and VWAP trend to flip and price to break below them.
- This reduces premature entries.

---

### 5. You Could Also Add a Momentum Indicator for Confirmation

- Add RSI, MACD, or similar to spot bearish divergence or momentum shift after sweep.
- If momentum turns down within the swept zone and EMA/VWAP are still bullish, consider it a stronger sell signal.

---

## Example Pseudocode Snippet to Integrate Sweep and Trend Bias

```pinescript
bool sweepAtHigh = false
bool sweepAtLow = false

// Your existing sweep detection code
if sweepAlert
    if close > previous high liquidity line
        sweepAtHigh := true
    else if close < previous low liquidity line
        sweepAtLow := true

// Rules for selling after sweep at high liquidity zone
if sweepAtHigh
    // Wait for EMA bias and VWAP trend to turn bearish or strong price action confirmation
    if (emaBiasText == "Bearish" and vwapTrendText == "Bearish") or (price breaks below emaValue3 or vwapValue)
        // Enter Short Trade
        strategy.entry("Short", strategy.short)
    else
        // Wait for price confirmation, no trade yet
        // Optional: monitor bearish candlestick patterns
        if bearish_candle_confirmation_detected
            strategy.entry("Short", strategy.short)

// Similar logic can be applied for bullish sweeps at low liquidity zones
```

---

## Summary and Recommendations:

| Approach  | Why                      | How                                                  |
|-----------|--------------------------|------------------------------------------------------|
| Use sweep as early warning | Sweeps mark traps, often before trend change | Wait for EMA/VWAP confirm or price action to confirm reversal |
| Add price action filter   | Trend is lagging, wait for reversal candles | Bearish engulfing / pin bars near sweep zone             |
| Add momentum confirmation| More confirmation of weakening bulls         | RSI divergence, MACD cross                                   |
| Prioritize extreme sweeps| Big stop hunts may be reliable reversals     | Trade reversal even if trend bias is lagging               |
| Delay entry               | Avoid premature trades                           | Wait 1-3 bars for trend or price action confirmation       |

---

If you want, I can help you **modify your script** to:

- Include these conditions with your existing logic.
- Add new alert conditions based on combined sweep + EMA bias or price action.
- Add RSI or candle pattern detection to your script.

---

Let me know if you'd like me to prepare such an update or a simplified example!

turns-00083.parquet:9691

5b73bbd71ccb239f782eafc6
turn 4/21gpt-4.1-mini-2025-04-14EnglishRomania554 words
degenerate_repetitionAbsentFinal dense release
USER
what ema lenght to use?
ASSISTANT
Choosing EMA lengths depends largely on your **trading style, timeframe, and strategy goals**. Since you’re trading **liquidity sweeps** (which often are short-to-medium term reversal or continuation signals), here are some guidelines and common EMA lengths tailored to your use case.

---

### Common EMA Lengths for Trading Liquidity Sweeps

| EMA Length | Typical Use Case                                    | How it fits your liquidity sweep setup                   |
|------------|---------------------------------------------------|----------------------------------------------------------|
| **20**     | Short-term trend (fast EMA), captures recent moves | Good for fast trend bias, reacts quickly after sweeps    |
| **50**     | Medium-term trend filter                           | Balanced EMA to confirm direction during sweep reversals |
| **100**    | Longer medium-term trend                           | Smoother trend filter, avoids whipsaws around sweep zones|
| **200**    | Long-term trend bias                               | Use to define big picture trend around liquidity sweeps  |

---

### What your current script uses:

- Your EMA inputs default to:
  - EMA1 = 50 (default length)
  - EMA2 = 100
  - EMA3 = 200

This is a good mix of short, medium, and long-term EMAs, similar to many professional traders’ setups.

---

### Recommended approach with your current EMAs for Liquidity Sweeps:

- **Primary Bias = EMA 50 (fast/medium)**:  
  Use this as your main bias line to check if price is in a probable trend or not right after sweep (more reactive).

- **Secondary Confirmation = EMA 100 or 200 (slow)**:  
  Use these to avoid trading against the major trend on bigger timeframes.

- **If price sweeps a liquidity zone near or beyond EMA 200**, that’s often a crucial reversal point.

---

### How to Use EMAs with Sweeps:

- If price **sweeps a zone and closes below EMA 50 and EMA 100**, that strongly confirms a bearish reversal.
- If price remains **above EMA 50 but below EMA 200**, tread carefully.
- If price stays **above EMA 200 and 100**, your bias is generally bullish, might wait for stronger confirmation.

---

### Adjusting EMA Lengths for Different Timeframes:

| Chart Timeframe | Suggested EMA Lengths                         |
|-----------------|----------------------------------------------|
| 1 min - 15 min  | 8, 21, 50                                    |
| 15 min - 1 hour | 20, 50, 100                                  |
| 1 hour - daily  | 50, 100, 200                                 |
| Daily and above | 100, 200, 350 (optional longer-term EMA)    |

*(These are starting points — you can adjust based on backtesting.)*

---

### Bonus: Adaptive EMA Length (Optional)

Some traders use **multiple EMAs tuned via backtest** or **dynamic EMAs** that adjust by volatility or ATR. This can improve responsiveness but adds complexity.

---

### Summary / Quick Recommendations:

- **Keep your current EMA setup (50, 100, 200)** — it covers short-to-long trends nicely.
- Use **EMA 50** as primary trend bias filter.
- Use **EMA 100 and 200** as confirmation for major trend direction.
- When price sweeps a liquidity zone **and breaks below these EMAs**, it’s a strong sell signal.
- You can test adding a faster EMA like **20 or 21** if you want quicker cues but be wary of noise.

---

If you want, I can help you:

- Add alternative EMA lengths to your script as user inputs.
- Create alert logic that combines sweep + EMA break confirmation.
- Suggest backtesting methods to optimize your EMA lengths on your preferred timeframe.

---

Just ask!

turns-00083.parquet:9692

5c71973ada866173308bdc55
turn 5/21gpt-4.1-mini-2025-04-14EnglishRomania486 words
degenerate_repetitionAbsentFinal dense release
USER
i use m15, maxim h1. m1 and m5 for enty
ASSISTANT
Thanks for sharing your timeframe approach:

- **M15 and max H1** for your main analysis (likely for liquidity sweep detection + bias via EMAs and VWAP)
- **M1 and M5** for entries (shorter-term confirmation)

---

### EMA Recommendations for Your Multi-Timeframe Setup

| Timeframe | Recommended EMAs                     | Use case                                    |
|-----------|-------------------------------------|---------------------------------------------|
| **M15 - H1** (higher timeframe analysis) | 50, 100, 200                           | Trend bias + liquidity sweep validation      |
| **M1 - M5** (entry timeframe)             | 8 or 13, 21, 50                       | Faster EMAs for entry timing and momentum    |

---

### Why these?

- **On M15/H1**: EMA 50/100/200 fits your existing setup well and gives good medium to longer term bias context around liquidity zones.

- **On M1/M5**:  
  - Use faster EMAs (8 or 13, 21) to detect momentum shift quickly near liquidity sweep zones, for example:
    - Watch price crossing below 8 EMA to signal short entry after a sweep on M15.
    - 21 EMA acts as a filter for minor trend direction on lower timeframes.
  - 50 EMA on M5 helps confirm short-term trend.

---

### How to use these together:

1. **M15/H1:**
   - Detect liquidity sweep.
   - Confirm trend bias via EMA 50/100/200 and VWAP.
   - If price sweeps high liquidity zone and bias (EMA and VWAP) is bullish, expect delay for reversal.
   - Wait for EMA bias or break to turn on H1 or M15 for stronger confirmation.

2. **M1/M5:**
   - Look for price action signals and EMA crossovers (e.g., price crossing below 8 EMA or 21 EMA).
   - Use M1 for precise entry (e.g., bearish engulfing, pin bar near swept liquidity).
   - Confirm M5 EMA alignment (price below 21 or 50 EMA) before entering.
   - Trail stops based on M5 lows or highs.

---

### Practical Example:

- M15 chart shows liquidity sweep near an important pivot.
- EMA50 > EMA100 > EMA200 tells you bias is still bullish.
- Wait for M15 or H1 candle to close below EMA50 or EMA100 to start considering short entries.
- Switch to M1/M5 chart:
  - Price crosses below 8 EMA or 13 EMA.
  - Bearish price action pattern forms.
  - Confirm M5 chart shows price below 21 EMA.
- Enter short.

---

### Additional Tips

- **VWAP on M15/H1**: Use VWAP trend as additional filter.
- **Multiple timeframe confluence** is key: avoid going against big trend (e.g., M1 bearish setup is stronger if confirmed with M15 bearish bias).
- **Volume and candlestick patterns** on M1/M5 help validating entries.

---

### Summary:

| Timeframe | EMAs                         |
|-----------|------------------------------|
| M15/H1    | 50, 100, 200 (current setup) |
| M1        | 8 or 13, 21                  |
| M5        | 21, 50                      |

---

If you want, I can provide a **small Pine Script snippet** for M1/M5 EMA crossovers or alerts that complement your main script for better entries.

Would you like that?

turns-00083.parquet:9693

178aabce9f6057f373cb18b0
turn 6/21gpt-4.1-mini-2025-04-14EnglishRomania494 words
degenerate_repetitionAbsentFinal dense release
USER
tell me ema bias logic
ASSISTANT
Certainly! Here's a straightforward explanation of **EMA Bias Logic** applied in your script and in typical trading scenarios:

---

## What is EMA Bias?

**EMA Bias** is a method of determining the prevailing **market trend** by comparing multiple Exponential Moving Averages (EMAs) of different lengths. It helps to classify price conditions into:

- **Bullish Bias:** Market likely trending up.
- **Bearish Bias:** Market likely trending down.
- **Neutral:** No clear trend or mixed signals.

---

## Your Script’s EMA Bias Logic

You use **3 EMAs** with lengths, e.g., EMA 50, EMA 100, and EMA 200. The bias is determined by the relative positions of these EMAs **and** where the current price (close) sits relative to the longest EMA.

### Condition for **Bullish Bias**

- EMA50 > EMA100 **and** EMA100 > EMA200 (Shorter-period EMAs are above longer-period EMAs, showing upward alignment)
- Price (close) is **above** EMA200 (price is trading above the long-term trend)

```pinescript
bullishBias = (emaValue > emaValue2) and (emaValue2 > emaValue3) and (close > emaValue3)
```

### Condition for **Bearish Bias**

- EMA50 < EMA100 **and** EMA100 < EMA200 (EMAs aligned downwards)
- Price (close) is **below** EMA200

```pinescript
bearishBias = (emaValue < emaValue2) and (emaValue2 < emaValue3) and (close < emaValue3)
```

### Else

- Bias is **Neutral** (No clear alignment/trend)

---

### Intuition Behind This Logic

- The **EMA50 crossing above EMA100 and 200** means recent prices are rising faster than the longer-term average — a bullish trend.
- Conversely, EMA50 below EMA100 and 200 implies a downtrend.
- Including price’s position relative to EMA200 filters out false signals when price is too close to or below the long-term average.

---

## How to Use EMA Bias in Trading

- **Bullish Bias:** Favor long trades, buy on dips near liquidity zones or pullbacks.
- **Bearish Bias:** Favor short trades, sell on rallies to liquidity zones or after liquidity sweeps.
- **Neutral:** Be cautious, look for additional confirmation from price action or other indicators.

---

## Example (Pseudocode):

```pinescript
if ema50 > ema100 and ema100 > ema200 and close > ema200
    bias = "Bullish"
else if ema50 < ema100 and ema100 < ema200 and close < ema200
    bias = "Bearish"
else
    bias = "Neutral"
```

In your script, this bias text is displayed in the table and used as a filter before taking trades such as liquidity sweeps.

---

## Notes & Variations

- Sometimes traders only use EMA crossovers without requiring price position confirmation.
- You can adjust EMA lengths depending on timeframe and strategy (e.g., faster EMAs for scalping).
- Some use just two EMAs (like 9 and 21).
- Combining EMA bias with volume, RSI, or price action improves signal strength.

---

If you want, I can help you:

- Modify the existing EMA bias with other EMA combinations.
- Add alerts when EMA bias changes.
- Use EMA bias logic combined with your liquidity sweeps for trade signals.

Just let me know!

turns-00083.parquet:9694

553fe45f3c40c6cf7697c6e0
turn 7/21gpt-4.1-mini-2025-04-14EnglishRomania665 words
degenerate_repetitionAbsentFinal dense release
USER
mss
ASSISTANT
Certainly! Here’s a clear explanation of **MSS (Market Structure Shift)** as used in your script and generally in technical analysis, especially aligned with Smart Money Concepts:

---

## What is MSS (Market Structure Shift)?

**Market Structure Shift (MSS)** is a change in the direction or behavior of price that indicates the previous trend is losing strength and a potential new trend (or at least a structural change) is forming.

It is typically identified when price:

- Fails to make a higher high (in an uptrend) or
- Fails to make a lower low (in a downtrend),

and breaks the prior swing low (in uptrend) or swing high (in downtrend), effectively signaling a **shift** from the prior trend.

---

## MSS vs BOS (Break of Structure)

- **BOS** (Break of Structure) is a confirmation of trend continuation — when price breaks a key high or low confirming the trend.
- **MSS** usually signals indecision or early signals of a potential trend reversal or retracement within an overall trend.

---

## MSS Detection Logic in Your Script

Your script’s MSS logic operates mainly on pivot highs/lows from a chosen timeframe (e.g., M15 or higher):

1. **Pivothigh/pivotlow detection** using `ta.pivothigh` and `ta.pivotlow`.
2. Track previous swing highs/lows and compare new pivots against them.
3. Determine if new pivot is:
   - Higher high (HH) or lower high (LH)
   - Higher low (HL) or lower low (LL)
4. An MSS event is detected when previous swing structure is breached **in the opposite direction**, but the full breakout (BOS) has **not** yet occurred.

Example (from your script logic summary):
- MSS bearish occurs when price makes a one-time break of a swing low, but the overall market hasn't confirmed a BOS downtrend yet.

---

## Code summary snippet related to MSS:

- Boolean flags like `High_Broken` and `Low_Broken` track whether swing highs or lows are broken.
- The script plots MSS labels and lines differently from BOS.
- Alerts can be triggered when MSS forms.

```pinescript
if Low_Broken and Display_Timeframe and not Hide_All_Breaks and HTF_Structure_Control(...)
    if Prev_Breakout_Type == 1 and Use_MSS_Plot
        // plot MSS line and label
    // alert for MSS if enabled
```

---

## How to Use MSS in Trading

- **MSS signals caution:** When MSS forms, consider that the trend is weakening or pausing.
- Can be used to tighten stops, reduce position size, or prepare for a possible reversal.
- Often combined with other signals like liquidity sweeps, FVG, or volume.
- MSS can give early entries for retracement trades or to watch for BOS confirmation.

---

## Visuals and Alerts in Your Script

- MSS events are labeled (e.g., “MSS 15min”) with color-coded lines showing swing breaks.
- Alerts for MSS can be turned on/off per timeframe.
- MSS is distinct from BOS and usually plotted differently (dashed vs solid lines, different colors).

---

## Summary Table for MSS Logic

| Term | Description |
|-|-|
| Pivot High (PH) | Local high swing point |
| Pivot Low (PL)  | Local low swing point |
| HH (Higher High) | New pivot high above previous high |
| HL (Higher Low)  | New pivot low above previous low |
| LH (Lower High)  | New pivot high below previous high |
| LL (Lower Low)   | New pivot low below previous low |
| BOS (Break of Structure) | Confirmed break continuing trend |
| MSS (Market Structure Shift) | Price breaks structure in opposite direction signaling potential shift |

---

### Example Interpretation:

- Prior uptrend: OH and OL is HH/HL pattern.
- Price forms a LH and then breaks HL low = **MSS Bearish** — trend structure weakening.
- Confirmed BOS requires break below previous LL — trend reversal strong.

---

### If you want:

- I can help you extract just MSS detection and plotting code with explanations.
- Add MSS alerts tailored for your trading alerts.
- Explain MSS in relation to liquidity sweeps or your CISD logic.

Just ask!