Skip to content

Instantly share code, notes, and snippets.

@kaigouthro
Created January 12, 2023 04:15
Show Gist options
  • Save kaigouthro/c16fd73a93bc517d9f00bfaa6b40f1da to your computer and use it in GitHub Desktop.
Save kaigouthro/c16fd73a93bc517d9f00bfaa6b40f1da to your computer and use it in GitHub Desktop.
pinescript5 tmlanguage
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>comment</key>
<string>Pinescript</string>
<key>fileTypes</key>
<array>
<string>pine</string>
<string>pinescript</string>
</array>
<key>firstLineMatch</key>
<string>tradingview</string>
<key>foldingStartMarker</key>
<string>^\/\/.*\{</string>
<key>foldingStopMarker</key>
<string>^\/\/.*\}</string>
<key>name</key>
<string>PineScript</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>(^//)(\s*)(©)\s*(\w+)(.*)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>comment.line.double-slash.ps</string>
</dict>
<dict>
<key>name</key>
<string>comment.line.double-slash.ps</string>
</dict>
<dict>
<key>name</key>
<string>constant.numeric.ps</string>
</dict>
<dict>
<key>name</key>
<string>constant</string>
</dict>
<dict>
<key>name</key>
<string>comment.line.double-slash.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(//)(@)(version)(=)(5)(.*)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>comment.line.double-slash.ps</string>
</dict>
<dict>
<key>name</key>
<string>constant.character.ps</string>
</dict>
<dict>
<key>name</key>
<string>entity.name.tag.ps</string>
</dict>
<dict>
<key>name</key>
<string>constant.numeric.ps</string>
</dict>
<dict>
<key>name</key>
<string>keyword.operator.logical.js.ps</string>
</dict>
<dict>
<key>name</key>
<string>comment.block.documentation.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(^//)\s*(ⓘ)\s*(https://www\.tradingview\.com)([\w.,@?^=%&amp;:/~+#-\{]*[\}\w@?^=%&amp;/~+#-])(\w+)(.*)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>comment.line.double-slash.ps</string>
</dict>
<dict>
<key>name</key>
<string>constant.numeric.ps</string>
</dict>
<dict>
<key>name</key>
<string> markup.underline.link ps</string>
</dict>
<dict>
<key>name</key>
<string>keyword.operator.logical.js.ps</string>
</dict>
<dict>
<key>name</key>
<string>keyword.operator.logical.js.ps</string>
</dict>
<dict>
<key>name</key>
<string>comment.line.double-slash.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>^(?:import)\s*(\w+)(?:/)(\w+)(?:/)(\w+)\s*(?:as)\s*(?&lt;name&gt;\w+)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>storage.type.cs.ps</string>
</dict>
<dict>
<key>name</key>
<string>entity.name.tag.ps</string>
</dict>
<dict>
<key>name</key>
<string>token.package.ps</string>
</dict>
<dict>
<key>name</key>
<string>constant.numeric.ps</string>
</dict>
<dict>
<key>name</key>
<string>keyword.operator.logical.js.ps</string>
</dict>
<dict>
<key>name</key>
<string>punctuation.definition.list.markdown.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(^//)(@)(version)(=)(5)(.*)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>comment.line.double-slash.ps</string>
</dict>
<dict>
<key>name</key>
<string>constant.numeric.ps</string>
</dict>
<dict>
<key>name</key>
<string>comment.line.ps</string>
</dict>
<dict>
<key>name</key>
<string>keyword.operator.logical.ps</string>
</dict>
<dict>
<key>name</key>
<string>keyword.operator.logical.ps</string>
</dict>
<dict>
<key>name</key>
<string>invalid.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(^//).*(@)(description|function|param|returns)(.*)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>comment.line.double-slash.ps</string>
</dict>
<dict>
<key>name</key>
<string>punctuation.section.embedded.begin.ps</string>
</dict>
<dict>
<key>name</key>
<string>entity.name.tag.ps.ps</string>
</dict>
<dict>
<key>name</key>
<string>markup.ps</string>
</dict>
<dict>
<key>name</key>
<string>comment.line.double-slash.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b(export|import)\b</string>
<key>name</key>
<string>punctuation.section.embedded.begin.ps</string>
</dict>
<dict>
<key>match</key>
<string>//.*</string>
<key>name</key>
<string>comment.line.double-slash.ps</string>
</dict>
<dict>
<key>match</key>
<string>[]\[]</string>
<key>name</key>
<string>parameter.ps</string>
</dict>
<dict>
<key>include</key>
<string>#strings</string>
</dict>
<dict>
<key>include</key>
<string>#constants</string>
</dict>
<dict>
<key>include</key>
<string>#functions</string>
</dict>
<dict>
<key>include</key>
<string>#keywords</string>
</dict>
<dict>
<key>include</key>
<string>#variables</string>
</dict>
<dict>
<key>include</key>
<string>#operators</string>
</dict>
</array>
<key>repository</key>
<dict>
<key>strings</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>"</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.ps</string>
</dict>
</dict>
<key>end</key>
<string>"</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.ps</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.double.ps</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>constant.character.escaped.ps</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>'</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.ps</string>
</dict>
</dict>
<key>end</key>
<string>'</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.ps</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.single.ps</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>constant.character.escaped.ps</string>
</dict>
</array>
</dict>
</array>
</dict>
<key>constants</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>\b(adjustment)\b(?!\()(?=\.)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</dict>
<key>end</key>
<string>\b(dividends|none|splits)\b</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</dict>
</dict>
<dict>
<key>begin</key>
<string>\b(alert)\b(?!\()(?=\.)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</dict>
<key>end</key>
<string>\b(freq_all|freq_once_per_bar|freq_once_per_bar_close)\b</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</dict>
</dict>
<dict>
<key>begin</key>
<string>\b(barmerge)\b(?!\()(?=\.)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</dict>
<key>end</key>
<string>\b(gaps_off|gaps_on|lookahead_off|lookahead_on)\b</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</dict>
</dict>
<dict>
<key>begin</key>
<string>\b(barstate)\b(?!\()(?=\.)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</dict>
<key>end</key>
<string>\b(isconfirmed|isfirst|ishistory|islast|islastconfirmedhistory|isnew|isrealtime)\b</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</dict>
</dict>
<dict>
<key>match</key>
<string>\b(box.all)\b</string>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>begin</key>
<string>\b(chart)\b(?!\()(?=\.)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</dict>
<key>end</key>
<string>\b(bg_color|fg_color|is_heikinashi|is_kagi|is_linebreak|is_pnf|is_range|is_renko|is_standard|left_visible_bar_time|right_visible_bar_time)\b</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</dict>
</dict>
<dict>
<key>match</key>
<string>(color)(\.)(aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(currency)(\.)(BTC|ETH|KRW|MYR|USDT|AUD|CAD|CHF|EUR|GBP|HKD|JPY|NOK|NONE|NZD|RUB|SEK|SGD|TRY|USD|ZAR)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(dayofweek)(\.)(friday|monday|saturday|sunday|thursday|tuesday|wednesday)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(display)(\.)(all|none)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(dividends)(\.)(gross|net)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(earnings)(\.)(actual|estimate|standardized)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(extend)(\.)(both|left|none|right)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(format)(\.)(inherit|mintick|percent|price|volume)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(hline)(\.)(style_dashed|style_dotted|style_solid)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(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)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(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)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(location)(\.)(abovebar|absolute|belowbar|bottom|top)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b(order)\b(\.)\b(ascending|descending)\b</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\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</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b(position)\b(\.)\b(bottom_center|bottom_left|bottom_right|middle_center|middle_left|middle_right|top_center|top_left|top_right)\b</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b(scale)\b(\.)\b(left|none|right)\b</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b(session)\b(\.)\b(extended|isfirstbar|isfirstbar_regular|islastbar|islastbar_regular|ismarket|ispostmarket|ispremarket|regular)\b</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b(shape)\b(\.)\b(arrowdown|arrowup|circle|cross|diamond|flag|labeldown|labelup|square|triangledown|triangleup|xcross)\b</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b(size)\b(\.)\b(auto|huge|large|normal|small|tiny)\b</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b(splits)\b(\.)\b(denominator|numerator)\b</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b(strategy)\b(\.)\b(account_currency|cash|equity|eventrades|fixed|grossloss|grossprofit|initial_capital|long|losstrades|max_contracts_held_all|max_contracts_held_long|max_contracts_held_short|max_drawdown|netprofit|openprofit|percent_of_equity|position_avg_price|position_entry_name|position_size|short|wintrades)\b</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(strategy)(\.)(commission)(\.)(cash_per_contract|cash_per_order|percent)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(strategy)(\.)(direction)(\.)(all|long|short)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(strategy)(\.)(oca)(\.)(cancel|none|reduce)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b(syminfo)\b(\.)\b(basecurrency|currency|description|mintick|pointvalue|prefix|root|session|ticker|tickerid|timezone|type|volumetype)\b</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b(table)\b(\.)\b(all)\b</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b(text)\b(\.)\b(align_bottom|align_center|align_left|align_right|align_top|wrap_auto|wrap_none)\b</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b(timeframe)\b(\.)\b(change|isdaily|isdwm|isintraday|isminutes|ismonthly|isseconds|isweekly|multiplier|period|.in_seconds)\b</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b(xloc)\b(\.)\b(bar_index|bar_time)\b</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b(yloc)\b(\.)\b(abovebar|belowbar|price)\b</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b(true|false)\b</string>
<key>name</key>
<string>constant.numeric.ps</string>
</dict>
<dict>
<key>match</key>
<string>\b([0-9]+)\b</string>
<key>name</key>
<string>constant.numeric.ps</string>
</dict>
<dict>
<key>match</key>
<string>#[a-fA-F0-9]{6}</string>
<key>name</key>
<string>contstant.other.ps</string>
</dict>
</array>
</dict>
<key>functions</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#strings</string>
</dict>
<dict>
<key>include</key>
<string>#constants</string>
</dict>
<dict>
<key>match</key>
<string>\b(indicator|library|strategy)+?(?=\()</string>
<key>name</key>
<string>entity.name.function.member.ps</string>
</dict>
<dict>
<key>match</key>
<string>(array)(\.)(abs|binary_search|binary_search_leftmost|binary_search_rightmost|new_linefill|percentile_linear_interpolation|percentile_nearest_rank|percentrank|sort_indicesavg|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)(\()</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(matrix)(\.)(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&lt;type&gt;|pinv|pow|rank|remove_col|remove_row|reshape|reverse|row|rows|set|sort|submatrix|sum|swap_columns|swap_rows|trace|transpose)(?=\()</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(box)(\.)(copy|set_text|set_text_color|set_text_halign|set_text_size|set_text_valign|set_text_wrap|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)(?=\()</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(color)(\.)(rgb|b|from_gradient|g|new|r|t)(?=\()</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(input)(\.)(bool|color|float|int|price|session|source|string|symbol|text_area|time|timeframe)(?=\()</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(label)(\.)(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)(?=\()</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(line)(\.)(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)(?=\()</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(linefill)(\.)(all|delete|new|get_line1|get_line2|get_y1|get_y2|set_color)(?=\()</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(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)(?=\()</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(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|pivot_point_levels|percentrank|pivothigh|pivotlow|range|rising|rma|roc|rsi|sar|sma|stdev|stoch|supertrend|swma|tsi|valuewhen|variance|vwap|vwma|wma|wpr)(?=\()</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(ta)(\.)(wad|tr|vwap|obv|accdist|iii|nvi|pvi|pvt|wvad)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(request)(\.)(dividends|earnings|financial|quandl|security|security_lower_tf|splits|economic|error)(?=\()</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(strategy)(\.)(closedtrades)(\.)(commission|closedtrades.entry_id|closedtrades.exit_id|opentradesntry_id|entry_bar_index|entry_price|en.etry_time|exit_bar_index|exit_price|exit_time|max_drawdown|max_runup|profit|size)(?=\()</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(strategy)(\.)(opentrades)(\.)(commission|entry_bar_index|entry_price|entry_time|max_drawdown|max_runup|profit|size)(?=\()</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(strategy)(\.)(risk)(\.)(allow_entry_in|max_cons_loss_days|max_drawdown|max_intraday_filled_orders|max_intraday_loss|max_position_size|max_run_up)(?=\()</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(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)(?=\()</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(str)(\.)(format|length|replace_all|split|tonumber|tostring|contains|endswith|lower|match|pos|replace|startswith|substring|upper)(?=\()</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(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)(?=\()</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(ticker)(\.)(heikinashi|kagi|linebreak|modify|new|pointfigure|renko)(?=\()</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(runtime)(\.)(error)(?=\()</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>support.function.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b(abovebar|belowbar|bar_index|close|high|hl2|hlc3|hlcc4|low|ohlc4|open|timenow|time_tradingday|volume)\b</string>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>match</key>
<string>\b(bar_index|last_bar_index|last_bar_time|alert|alertcondition|barcolor|bgcolor|bool|color|dayofmonth|dayofweek|fill|fixnan|float|hline|hour|input|int|max_bars_back|minute|month|na|nz|plot|plotarrow|plotbar|plotcandle|plotchar|plotshape|second|string|time|time_close|timestamp|weekofyear|year)(?=\()</string>
<key>name</key>
<string>support.function.ps</string>
</dict>
<dict>
<key>match</key>
<string>(\w+)(\.)(\w+)\(</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>parameter.ps</string>
</dict>
<dict>
<key>name</key>
<string>storage.type.cs.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter.ps</string>
</dict>
<dict>
<key>name</key>
<string>token.error-token.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(?!=export)(\s)(\w+*)\s(?=\()</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>token.error-token.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(\w+*)\(</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>parameter.ps</string>
</dict>
<dict>
<key>name</key>
<string>token.error-token.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(=&gt;)</string>
<key>name</key>
<string>parameter.non-null-typehinted.php.ps</string>
</dict>
<dict>
<key>match</key>
<string>(\))\s*(=&gt;)\s*</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>parameter.non-null-typehinted.php.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter.ps</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b(strategy.opentrades)\b</string>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>match</key>
<string>\b(strategy.closedtrades)\b</string>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>match</key>
<string>\b(dayofmonth|dayofweek|second|hour|minute|month|na|time|time_close|weekofyear|year)\b</string>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>match</key>
<string>(math)(\.)(e|phi|pi|rphi)</string>
<key>captures</key>
<array>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
<dict>
<key>name</key>
<string>parameter</string>
</dict>
<dict>
<key>name</key>
<string>variable.other.ps</string>
</dict>
</array>
</dict>
</array>
</dict>
<key>keywords</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\b(by|if|in|else|elseif|continue|break|for|return|var|varip|not|while|switch|series)\b</string>
<key>name</key>
<string>keyword.operator.logical.js.ps</string>
</dict>
</array>
</dict>
<key>variables</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>[a-zA-Z_][a-zA-Z0-9_]*\s*(?=\=|:=)</string>
<key>name</key>
<string>punctuation.separator.parameters.ps</string>
</dict>
</array>
</dict>
<key>operators</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>(\-\=|\+\=|\*\=|/=|%=)</string>
<key>name</key>
<string>keyword.operator.begin.ps</string>
</dict>
<dict>
<key>match</key>
<string>(\-|\+|\*|/|%)</string>
<key>name</key>
<string>punctuation.section.embedded.begin.ps</string>
</dict>
<dict>
<key>match</key>
<string>(={2}|!=|&lt;=|&gt;=|&lt;|&gt;|:=)</string>
<key>name</key>
<string>keyword.operator.ps</string>
</dict>
<dict>
<key>match</key>
<string>(\?|\:)</string>
<key>name</key>
<string>keyword.operator.ternary.ps</string>
</dict>
<dict>
<key>match</key>
<string>\b(and|or|not|bool|float|int|string|color|table|simple)\b</string>
<key>name</key>
<string>keyword.operator.logical.js.ps</string>
</dict>
<dict>
<key>match</key>
<string>\.</string>
<key>name</key>
<string>parameter.ps</string>
</dict>
<dict>
<key>match</key>
<string>\(</string>
<key>name</key>
<string>parameter.ps</string>
</dict>
<dict>
<key>match</key>
<string>\)</string>
<key>name</key>
<string>parameter.ps</string>
</dict>
<dict>
<key>match</key>
<string>\,</string>
<key>name</key>
<string>parameter.ps</string>
</dict>
<dict>
<key>match</key>
<string>=</string>
<key>name</key>
<string>keyword.operator.arithmetic.ps</string>
</dict>
<dict>
<key>match</key>
<string>[a-zA-Z_][a-zA-Z0-9_]*</string>
<key>name</key>
<string>punctuation.separator.parameters.ps</string>
</dict>
</array>
</dict>
</dict>
<key>scopeName</key>
<string>source.pine</string>
<key>uuid</key>
<string>93E017CC-6F27-11D9-90EB-000793589AF6</string>
</dict>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment