Skip to content

Instantly share code, notes, and snippets.

@kaigouthro
Last active January 30, 2023 03:25
Show Gist options
  • Save kaigouthro/1e596c0c12afe10e0745e81479412fa5 to your computer and use it in GitHub Desktop.
Save kaigouthro/1e596c0c12afe10e0745e81479412fa5 to your computer and use it in GitHub Desktop.
[{
"0": [
"\\b(\\w\\+.all)\\b"
]
},
{
"1": [
"(color)(\\.)(aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow)"
]
},
{
"2": [
"(currency)(\\.)(AUD|CAD|CHF|EUR|GBP|HKD|JPY|NOK|NONE|NZD|RUB|SEK|SGD|TRY|USD|ZAR)"
]
},
{
"3": [
"(dayofweek)(\\.)(friday|monday|saturday|sunday|thursday|tuesday|wednesday)"
]
},
{
"4": [
"(display)(\\.)(all|none)"
]
},
{
"5": [
"(dividends)(\\.)(gross|net)"
]
},
{
"6": [
"(earnings)(\\.)(actual|estimate|standardized)"
]
},
{
"7": [
"(extend)(\\.)(both|left|none|right)"
]
},
{
"8": [
"(format)(\\.)(inherit|mintick|percent|price|volume)"
]
},
{
"9": [
"(hline)(\\.)(style_dashed|style_dotted|style_solid)"
]
},
{
"10": [
"(label)(\\.)(all|style_arrowdown|style_arrowup|style_circle|style_cross|style_diamond|style_flag|style_label_center|style_label_down|style_label_left|style_label_lower_left|style_label_lower_right|style_label_right|style_label_upper_left|style_label_upper_right|style_label_up|style_none|style_square|style_triangledown|style_triangleup|style_xcross)"
]
},
{
"11": [
"(line)(\\.)(all|style_arrow_both|style_arrow_left|style_arrow_right|style_dashed|style_dotted|style_solid|style_solidline|style_dottedline|style_dashedline|style_arrow_leftline|style_arrow_rightline|style_arrow_bothline)"
]
},
{
"12": [
"(location)(\\.)(abovebar|absolute|belowbar|bottom|top)"
]
},
{
"13": [
"\\b(order)\\b(\\.)\\b(ascending|descending)\\b"
]
},
{
"14": [
"\\b(plot)\\b(\\.)\\b(style_areabr|style_area|style_circles|style_columns|style_cross|style_histogram|style_line|style_linebr|style_stepline|style_stepline_diamond)\\b"
]
},
{
"15": [
"\\b(position)\\b(\\.)\\b(bottom_center|bottom_left|bottom_right|middle_center|middle_left|middle_right|top_center|top_left|top_right)\\b"
]
},
{
"16": [
"\\b(scale)\\b(\\.)\\b(left|none|right)\\b"
]
},
{
"17": [
"\\b(session)\\b(\\.)\\b(extended|ismarket|ispostmarket|ispremarket|regular)\\b"
]
},
{
"18": [
"\\b(shape)\\b(\\.)\\b(arrowdown|arrowup|circle|cross|diamond|flag|labeldown|labelup|square|triangledown|triangleup|xcross)\\b"
]
},
{
"19": [
"\\b(size)\\b(\\.)\\b(auto|huge|large|normal|small|tiny)\\b"
]
},
{
"20": [
"\\b(splits)\\b(\\.)\\b(denominator|numerator)\\b"
]
},
{
"21": [
"(strategy\\.(account_currency|cash|commission(cash_per_contract|cash_per_order|percent)|direction\\.(all|long|short)|equity|eventrades|fixed|grossloss|grossprofit|initial_capital|losstrades|max_contracts_held_all|max_contracts_held_long|max_contracts_held_short|max_drawdown|max_runup|netprofit|oca\\.(cancel|none|reduce)|openprofit|closedtrades|opentrades|percent_of_equity|position_avg_price|position_entry_name|position_size|long|short|wintrades))[^A-Za-z_.(]"
]
},
{
"22": [
"(strategy)(\\.)(commission)(\\.)(cash_per_contract|cash_per_order|percent)"
]
},
{
"23": [
"(strategy)(\\.)(direction)(\\.)(all|long|short)"
]
},
{
"24": [
"(strategy)(\\.)(oca)(\\.)(cancel|none|reduce)"
]
},
{
"25": [
"\\b(syminfo)\\b(\\.)\\b(basecurrency|currency|description|mintick|pointvalue|prefix|root|session|ticker|tickerid|timezone|type)\\b"
]
},
{
"26": [
"\\b(table)\\b(\\.)\\b(all)\\b"
]
},
{
"27": [
"\\b(text)\\b(\\.)\\b(align_bottom|align_center|align_left|align_right|align_top)\\b"
]
},
{
"28": [
"\\b(timeframe)\\b(\\.)\\b(isdaily|isdwm|isintraday|isminutes|ismonthly|isseconds|isweekly|multiplier|period)\\b"
]
},
{
"29": [
"\\b(xloc)\\b(\\.)\\b(bar_index|bar_time)\\b"
]
},
{
"30": [
"\\b(yloc)\\b(\\.)\\b(abovebar|belowbar|price)\\b"
]
},
{
"31": [
"\\b(true|false)\\b"
]
},
{
"32": [
"\\b([0-9]+)\\b"
]
},
{
"33": [
"#[a-fA-F0-9]{ 6 }"
]
},
{
"34": [
"\\bfor\\b"
]
},
{
"35": [
"^(export *)?(\\w+) *\\(.*(\\n*.+,)*\\)( *=>)(.*(\\n+ {4}.+)+\\n)"
]
},
{
"36": [
"alert|alertcondition|barcolor|bgcolor|dayofmonth|dayofweek|fill|fixnan|hline|hour|input|max_bars_back|minute|month|nz|plot|plotarrow|plotbar|plotcandle|plotchar|plotshape|second|time|time_close|timestamp|weekofyear|year"
]
},
{
"37": [
"\\binput.(bool|color|float|int|price|session|source|string|symbol|text_area|time|timeframe)"
]
},
{
"38": [
"\\blabel.(copy|delete|get_text|get_x|get_y|new|set_color|set_size|set_style|set_text|set_textalign|set_textcolor|set_tooltip|set_x|set_xloc|set_xy|set_y|set_yloc)"
]
},
{
"39": [
"\\bsyminfo.(prefix|ticker)"
]
},
{
"40": [
"\\bta.(alma|atr|barssince|bb|bbw|cci|change|cmo|cog|correlation|cross|crossover|crossunder|cum|dev|dmi|ema|falling|highest|highestbars|hma|kc|kcw|linreg|lowest|lowestbars|macd|median|mfi|mode|mom|percentile_linear_interpolation|percentile_nearest_rank|percentrank|pivot_point_levels|pivothigh|pivotlow|range|rising|rma|roc|rsi|sar|sma|stdev|stoch|supertrend|swma|tr|tsi|valuewhen|variance|vwap|vwma|wma|wpr) ? "
]
},
{
"41": [
"\\barray.(abs|avg|binary_search|binary_searchl|binary_searchr|clear|concat|copy|covariance|fill|from|get|includes|indexof|insert|join|lastindexof|max|median|min|mode|new<TypeAny>|new_bool|new_box|new_color|new_float|new_int|new_label|new_line|new_linefill|new_string|new_table|percentile_linear_interpolation|percentile_nearest_rank|percentrank|pop|push|range|remove|reverse|set|shift|size|slice|sort|sort_indices|standardize|stdev|sum|unshift|variance)"
]
},
{
"42": [
"\\btimeframe.(change|in_seconds)"
]
},
{
"43": [
"\\btable.(cell|cell_set_bgcolor|cell_set_height|cell_set_text|cell_set_text_color|cell_set_text_halign|cell_set_text_size|cell_set_text_valign|cell_set_tooltip|cell_set_width|clear|delete|merge_cells|new|set_bgcolor|set_border_color|set_border_width|set_frame_color|set_frame_width|set_position)"
]
},
{
"44": [
"\\bticker.(heikinashi|kagi|linebreak|modify|new|pointfigure|renko)"
]
},
{
"45": [
"\\bline.(copy|delete|get_price|get_x1|get_x2|get_y1|get_y2|new|set_color|set_extend|set_style|set_width|set_x1|set_x2|set_xloc|set_xy1|set_xy2|set_y1|set_y2)"
]
},
{
"46": [
"\\blinefill.(delete|get_line1|get_line2|new|set_color)"
]
},
{
"47": [
"\\brequest.(dividends|earnings|economic|financial|quandl|security|security_lower_tf|splits)"
]
},
{
"48": [
"\\bruntime.error"
]
},
{
"49": [
"\\bbox.(copy|delete|get_bottom|get_left|get_right|get_top|new|set_bgcolor|set_border_color|set_border_style|set_border_width|set_bottom|set_extend|set_left|set_lefttop|set_right|set_rightbottom|set_text|set_text_color|set_text_halign|set_text_size|set_text_valign|set_text_wrap|set_top)"
]
},
{
"50": [
"\\bcolor.(b|from_gradient|g|new|r|rgb|t)"
]
},
{
"51": [
"\\bmath.(abs|acos|asin|atan|avg|ceil|cos|exp|floor|log|log10|max|min|pow|random|round|round_to_mintick|sign|sin|sqrt|sum|tan|todegrees|toradians)"
]
},
{
"52": [
"\\bmatrix.(add_col|add_row|avg|col|columns|concat|copy|det|diff|eigenvalues|eigenvectors|elements_count|fill|get|inv|is_antidiagonal|is_antisymmetric|is_binary|is_diagonal|is_identity|is_square|is_stochastic|is_symmetric|is_triangular|is_zero|kron|max|median|min|mode|mult|new<TypeAny>|pinv|pow|rank|remove_col|remove_row|reshape|reverse|row|rows|set|sort|submatrix|sum|swap_columns|swap_rows|trace|transpose)"
]
},
{
"53": [
"\\bstr.(contains|endswith|format|length|lower|match|pos|replace|replace_all|split|startswith|substring|tonumber|tostring|upper)"
]
},
{
"54": [
"\\bstrategy.(cancel|cancel_all|close|close_all|closedtrades.(commission|entry_bar_index|entry_id|entry_price|entry_time|exit_bar_index|exit_id|exit_price|exit_time|max_drawdown|max_runup|profit|size)|opentrades.(commission|entry_bar_index|entry_id|entry_price|entry_time|max_drawdown|max_runup|profit|size)|order|risk.(allow_entry_in|max_cons_loss_days|max_drawdown|max_intraday_filled_orders|max_intraday_loss|max_position_size)|convert_to_account|convert_to_symbol|entry|exit)"
]
},
{
"55": [
"\\b(indicator|library|strategy)+?(?=\\()"
]
},
{
"56": [
"(array)(\\.)(avg|clear|concat|copy|covariance|fill|from|get|includes|indexof|insert|join|lastindexof|max|median|min|mode|new_bool|new_box|new_color|new_float|new_int|new_label|new_line|new_string|new_table|pop|push|range|remove|reverse|set|shift|size|slice|sort|standardize|stdev|sum|unshift|variance)(?=\\()"
]
},
{
"57": [
"(box)(\\.)(delete|get_bottom|get_left|get_right|get_top|new|set_bgcolor|set_border_color|set_border_style|set_border_width|set_bottom|set_extend|set_left|set_lefttop|set_right|set_rightbottom|set_top)(?=\\()"
]
},
{
"58": [
"(color)(\\.)(rgb|b|from_gradient|g|new|r|t)(?=\\()"
]
},
{
"59": [
"(input)(\\.)(bool|color|float|int|price|session|source|string|symbol|time|timeframe)(?=\\()"
]
},
{
"60": [
"(label)(\\.)(delete|get_text|get_x|get_y|new|set_color|set_size|set_style|set_text|set_textalign|set_textcolor|set_tooltip|set_x|set_xloc|set_xy|set_y|set_yloc)(?=\\()"
]
},
{
"61": [
"(line)(\\.)(delete|get_price|get_x1|get_x2|get_y1|get_y2|new|set_color|set_extend|set_style|set_width|set_x1|set_x2|set_xloc|set_xy1|set_xy2|set_y1|set_y2)(?=\\()"
]
},
{
"62": [
"(math)(\\.)(abs|acos|asin|atan|avg|ceil|cos|exp|floor|log|log10|max|min|pow|random|round|round_to_mintick|sign|sin|sqrt|sum|tan|todegrees|toradians)(?=\\()"
]
},
{
"63": [
"(ta)(\\.)(tr|alma|atr|barssince|bb|bbw|cci|change|cagr|cmo|cog|correlation|cross|crossover|crossunder|cum|dev|dmi|ema|falling|highest|highestbars|hma|kc|kcw|linreg|lowest|lowestbars|macd|median|mfi|mode|mom|percentile_linear_interpolation|percentile_nearest_rank|percentrank|pivothigh|pivotlow|range|rising|rma|roc|rsi|sar|sma|stdev|stoch|supertrend|swma|tsi|valuewhen|variance|vwap|vwma|wma|wpr)(?=\\()"
]
},
{
"64": [
"(ta)(\\.)(wad|tr|vwap|obv|accdist|iii|nvi|pvi|pvt|wvad)"
]
},
{
"65": [
"(request)(\\.)(dividends|earnings|financial|quandl|security|splits|error)(?=\\()"
]
},
{
"66": [
"(strategy)(\\.)(closedtrades)(\\.)(commission|entry_bar_index|entry_price|entry_time|exit_bar_index|exit_price|exit_time|max_drawdown|max_runup|profit|size)(?=\\()"
]
},
{
"67": [
"(strategy)(\\.)(opentrades)(\\.)(commission|entry_bar_index|entry_price|entry_time|max_drawdown|max_runup|profit|size)(?=\\()"
]
},
{
"68": [
"(strategy)(\\.)(risk)(\\.)(allow_entry_in|max_cons_loss_days|max_drawdown|max_intraday_filled_orders|max_intraday_loss|max_position_size)(?=\\()"
]
},
{
"69": [
"(strategy)(\\.)(cancel|cancel_all|close|close_all|convert_to_account|convert_to_symbol|entry|exit|order|allow_entry_in|max_cons_loss_days|max_drawdown|max_intraday_filled_orders|max_intraday_loss|max_position_size)(?=\\()"
]
},
{
"70": [
"(str)(\\.)(format|length|replace_all|split|tonumber|tostring)(?=\\()"
]
},
{
"71": [
"(table)(\\.)(cell|cell_set_bgcolor|cell_set_height|cell_set_text|cell_set_text_color|cell_set_text_halign|cell_set_text_size|cell_set_text_valign|cell_set_width|clear|delete|new|set_bgcolor|set_border_color|set_border_width|set_frame_color|set_frame_width|set_position)(?=\\()"
]
},
{
"72": [
"(ticker)(\\.)(heikinashi|kagi|linebreak|modify|new|pointfigure|renko)(?=\\()"
]
},
{
"73": [
"(runtime)(\\.)(error)(?=\\()"
]
},
{
"74": [
"\\b(abovebar|belowbar|bar_index|close|high|hl2|hlc3|low|ohlc4|open|timenow|time_tradingday|volume)\\b"
]
},
{
"75": [
"\\b(alert|alertcondition|barcolor|bgcolor|bool|box|color|dayofmonth|dayofweek|fill|fixnan|float|hline|hour|input|int|label|line|max_bars_back|minute|month|na|nz|plot|plotarrow|plotbar|plotcandle|plotchar|plotshape|second|string|table|time|time_close|timestamp|weekofyear|year)(?=\\()"
]
},
{
"76": [
"(\\w+)(\\.)(\\w+)\\("
]
},
{
"77": [
"(?!=export)(\\s)(\\w+*)\\s(?=\\()"
]
},
{
"78": [
"(\\w+*)\\("
]
},
{
"79": [
"(=>)"
]
},
{
"80": [
"(\\))\\s*(=>)\\s*"
]
},
{
"81": [
"\\b(strategy.opentrades)\\b"
]
},
{
"82": [
"\\b(strategy.closedtrades)\\b"
]
},
{
"83": [
"\\b(dayofmonth|dayofweek|second|hour|minute|month|na|time|time_close|weekofyear|year)\\b"
]
},
{
"84": [
"(math)(\\.)(e|phi|pi|rphi)"
]
},
{
"85": [
"\\b(?<![: _\\.])(?: function|mutable\\s+struct|struct|macro|quote|abstract\\s+type|primitive\\s+type|module|baremodule|where)\\b"
]
},
{
"86": [
"\\bouter\\b"
]
},
{
"87": [
"\\b(?<![: _])(?: if|else|elseif|while|begin|let|do|try|catch|finally|return|break|continue)\\b"
]
},
{
"88": [
"\\b(?<![: _])end\\b"
]
},
{
"89": [
"(^export )"
]
},
{
"90": [
"(^import )"
]
},
{
"91": [
"\\b(box|by|if|in|else|elseif|line|table|continue|break|for|return|var|varip|not|while|switch|series)\\b"
]
},
{
"92": [
"\\b(?<![: _])(?: export)\\b"
]
},
{
"93": [
"\\b(?<![: _])(?: import)\\b"
]
},
{
"94": [
"[0-9]*([0-9]+\\.|\\.[0-9])[0-9]*((e|E)(-|+))?[0-9]*"
]
},
{
"95": [
"\\btrue\\b|\\bfalse\\b|\\bna\\b"
]
},
{
"96": [
"(-=|+=|*=|/=|%=)"
]
},
{
"97": [
"(-|+|*|/|%)"
]
},
{
"98": [
"(={2}|!=|<=|>=|<|>|: =)"
]
},
{
"99": [
"(\\?|\\:)"
]
},
{
"100": [
"\\b(and|or|not)\\b"
]
},
{
"101": [
"="
]
},
{
"102": [
"(^ //)\\s*(©)\\s*(\\w+)(.*)"
]
},
{
"103": [
"(^ //)(@)(version)(=)(5)(.*)"
]
},
{
"104": [
"(^ //)\\s*(ⓘ)\\s*(https://www\\.tradingview\\.com)([\\w.,@?^=%&:/~+#-\\{]*[\\}\\w@?^=%&/~+#-])(\\w+)(.*)"
]
},
{
"105": [
"^(?:import)\\s*(\\w+)(?:/)(\\w+)(?:/)(\\w+)\\s*(?:as)\\s*(?<name>\\w+)"
]
},
{
"106": [
"(^ //)(@)(version)(=)(5)(.*)"
]
},
{
"107": [
"(^ //).*(\\d{10})(.*)(#)"
]
},
{
"108": [
"(^ //)\\s(@)(description|function|param|returns|type|field|method)(.*)"
]
},
{
"109": [
"(^ //).*(\\d{4}\\s\\w{3,10}\\s\\w{3,10}).*(\\|)\\s(\\d{2}:\\d{2}:\\d{2})(.*)(#)"
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment