OPEN-SOURCE SCRIPT
☸Gap Detector [NHP]

🔶This is a Pine Script code for a “Gap Detector” study in TradingView. The script scans for gaps in the price chart and labels them as either ‘🟢Bull gap’ or ‘🔴Bear gap’. Here’s a brief explanation of the code:
🔶Length and Width are user inputs that define the number of bars to look back and the width of the lines drawn, respectively.
➡️Gap_start and gap_end are variables that store the start and end of a gap.
➡️Gap_bull and gap_bear are boolean variables that indicate whether a bull or bear gap has been detected.
🔶Inf_gap and sup_gap are variables that store the lower and upper bounds of a gap.
The script then iterates over the specified length of bars. If a gap is detected (a high price that is lower than the previous bar’s low price for a bull gap, or a low price that is higher than the previous bar’s high price for a bear gap), it calculates the size of the gap and draws lines and labels on the chart if the gap is larger than 5 pips. ( pips meaning percentage in point)
🔶All content provided is for informational & educational purposes only. Past performance does not guarantee future results.
🔶Length and Width are user inputs that define the number of bars to look back and the width of the lines drawn, respectively.
➡️Gap_start and gap_end are variables that store the start and end of a gap.
➡️Gap_bull and gap_bear are boolean variables that indicate whether a bull or bear gap has been detected.
🔶Inf_gap and sup_gap are variables that store the lower and upper bounds of a gap.
The script then iterates over the specified length of bars. If a gap is detected (a high price that is lower than the previous bar’s low price for a bull gap, or a low price that is higher than the previous bar’s high price for a bear gap), it calculates the size of the gap and draws lines and labels on the chart if the gap is larger than 5 pips. ( pips meaning percentage in point)
🔶All content provided is for informational & educational purposes only. Past performance does not guarantee future results.
סקריפט קוד פתוח
ברוח TradingView אמיתית, היוצר של הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יכולים לבדוק ולאמת את הפונקציונליות שלו. כל הכבוד למחבר! למרות שאתה יכול להשתמש בו בחינם, זכור שפרסום מחדש של הקוד כפוף לכללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.
סקריפט קוד פתוח
ברוח TradingView אמיתית, היוצר של הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יכולים לבדוק ולאמת את הפונקציונליות שלו. כל הכבוד למחבר! למרות שאתה יכול להשתמש בו בחינם, זכור שפרסום מחדש של הקוד כפוף לכללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.