%s
From 2b124acb1583a79e6542d1d550592801466b3887 Mon Sep 17 00:00:00 2001
From: Andres Jakobson
Features:
+%s
%s
When a lead/high surrogate has been read from the input stream into the final + * {@link #zzBuffer} position, this will have a value of 1; otherwise, it will have a value of 0. + */ + private int zzFinalHighSurrogate = 0; + + /** Number of newlines encountered up to the start of the matched text. */ + @SuppressWarnings("unused") + private int yyline; + + /** Number of characters from the last newline up to the start of the matched text. */ + @SuppressWarnings("unused") + private int yycolumn; + + /** Number of characters up to the start of the matched text. */ + @SuppressWarnings("unused") + private long yychar; + + /** Whether the scanner is currently at the beginning of a line. */ + @SuppressWarnings("unused") + private boolean zzAtBOL = true; + + /** Whether the user-EOF-code has already been executed. */ + private boolean zzEOFDone; + + /* user code: */ + public void reset(CharSequence buffer, int start, int end, int initialState) { + this.zzBuffer = buffer.toString().toCharArray(); + this.zzCurrentPos = this.zzMarkedPos = this.zzStartRead = start; + this.zzEndRead = end; + this.zzAtEOF = false; + this.zzAtBOL = true; + yybegin(initialState); + } + + public int getTokenStart() { + return zzStartRead; + } + + public int getTokenEnd() { + return zzMarkedPos; + } + + + /** + * Creates a new scanner + * + * @param in the java.io.Reader to read input from. + */ + _PineScriptLexer(java.io.Reader in) { + this.zzReader = in; + } + + + /** Returns the maximum size of the scanner buffer, which limits the size of tokens. */ + private int zzMaxBufferLen() { + return Integer.MAX_VALUE; + } + + /** Whether the scanner buffer can grow to accommodate a larger token. */ + private boolean zzCanGrow() { + return true; + } + + /** + * Translates raw input code points to DFA table row + */ + private static int zzCMap(int input) { + int offset = input & 255; + return offset == input ? ZZ_CMAP_BLOCKS[offset] : ZZ_CMAP_BLOCKS[ZZ_CMAP_TOP[input >> 8] | offset]; + } + + /** + * Refills the input buffer. + * + * @return {@code false} iff there was new input. + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + zzEndRead += zzFinalHighSurrogate; + zzFinalHighSurrogate = 0; + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead - zzStartRead); + + /* translate stored positions */ + zzEndRead -= zzStartRead; + zzCurrentPos -= zzStartRead; + zzMarkedPos -= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length - zzFinalHighSurrogate && zzCanGrow()) { + /* if not, and it can grow: blow it up */ + char newBuffer[] = new char[Math.min(zzBuffer.length * 2, zzMaxBufferLen())]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + zzEndRead += zzFinalHighSurrogate; + zzFinalHighSurrogate = 0; + } + + /* fill the buffer with new input */ + int requested = zzBuffer.length - zzEndRead; + int numRead = zzReader.read(zzBuffer, zzEndRead, requested); + + /* not supposed to occur according to specification of java.io.Reader */ + if (numRead == 0) { + if (requested == 0) { + throw new java.io.EOFException("Scan buffer limit reached ["+zzBuffer.length+"]"); + } + else { + throw new java.io.IOException( + "Reader returned 0 characters. See JFlex examples/zero-reader for a workaround."); + } + } + if (numRead > 0) { + zzEndRead += numRead; + if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) { + if (numRead == requested) { // We requested too few chars to encode a full Unicode character + --zzEndRead; + zzFinalHighSurrogate = 1; + } else { // There is room in the buffer for at least one more char + int c = zzReader.read(); // Expecting to read a paired low surrogate char + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char)c; + } + } + } + /* potentially more input available */ + return false; + } + + /* numRead < 0 ==> end of stream */ + return true; + } + + + /** + * Closes the input reader. + * + * @throws java.io.IOException if the reader could not be closed. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; // indicate end of file + zzEndRead = zzStartRead; // invalidate buffer + + if (zzReader != null) { + zzReader.close(); + } + } + + + /** + * Resets the scanner to read from a new input stream. + * + *
Does not close the old reader. + * + *
All internal variables are reset, the old input stream cannot be reused (internal + * buffer is discarded and lost). Lexical state is set to {@code ZZ_INITIAL}. + * + *
Internal scan buffer is resized down to its initial length, if it has grown. + * + * @param reader The new input stream. + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzEOFDone = false; + yyResetPosition(); + zzLexicalState = YYINITIAL; + int initBufferSize = Math.min(ZZ_BUFFERSIZE, zzMaxBufferLen()); + if (zzBuffer.length > initBufferSize) { + zzBuffer = new char[initBufferSize]; + } + } + + /** + * Resets the input position. + */ + private final void yyResetPosition() { + zzAtBOL = true; + zzAtEOF = false; + zzCurrentPos = 0; + zzMarkedPos = 0; + zzStartRead = 0; + zzEndRead = 0; + zzFinalHighSurrogate = 0; + yyline = 0; + yycolumn = 0; + yychar = 0L; + } + + + /** + * Returns whether the scanner has reached the end of the reader it reads from. + * + * @return whether the scanner has reached EOF. + */ + public final boolean yyatEOF() { + return zzAtEOF; + } + + + /** + * Returns the current lexical state. + * + * @return the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state. + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + * + * @return the matched text. + */ + public final String yytext() { + return new String(zzBuffer, zzStartRead, zzMarkedPos-zzStartRead); + } + + + /** + * Returns the character at the given position from the matched text. + * + *
It is equivalent to {@code yytext().charAt(pos)}, but faster. + * + * @param position the position of the character to fetch. A value from 0 to {@code yylength()-1}. + * + * @return the character at {@code position}. + */ + public final char yycharat(int position) { + return zzBuffer[zzStartRead + position]; + } + + + /** + * How many characters were matched. + * + * @return the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occurred while scanning. + * + *
In a well-formed scanner (no or only correct usage of {@code yypushback(int)} and a + * match-all fallback rule) this method will only be called with things that + * "Can't Possibly Happen". + * + *
If this method is called, something is seriously wrong (e.g. a JFlex bug producing a faulty + * scanner etc.). + * + *
Usual syntax/scanner level error handling should be done in error fallback rules. + * + * @param errorCode the code of the error message to display. + */ + private static void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + *
They will be read again by then next call of the scanning method. + * + * @param number the number of characters to be read again. This number must not be greater than + * {@link #yylength()}. + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Contains user EOF-code, which will be executed exactly once, + * when the end of file is reached + */ + private void zzDoEOF() { + if (!zzEOFDone) { + zzEOFDone = true; + + } + } + + + + + /** + * Resumes scanning until the next regular expression is matched, the end of input is encountered + * or an I/O-Error occurs. + * + * @return the next token. + * @exception java.io.IOException if any I/O-Error occurs. + */ + public IElementType advance() throws java.io.IOException + { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char[] zzBufferL = zzBuffer; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + // set up zzAction for empty match case: + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + } + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) { + zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL); + zzCurrentPosL += Character.charCount(zzInput); + } + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL); + zzCurrentPosL += Character.charCount(zzInput); + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMap(zzInput) ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + zzDoEOF(); + return null; + } + else { + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 1: + { return TokenType.BAD_CHARACTER; + } + // fall through + case 22: break; + case 2: + { return TokenType.WHITE_SPACE; + } + // fall through + case 23: break; + case 3: + { return PineScriptTokenTypes.OPERATOR; + } + // fall through + case 24: break; + case 4: + { return PineScriptTokenTypes.LPAREN; + } + // fall through + case 25: break; + case 5: + { return PineScriptTokenTypes.RPAREN; + } + // fall through + case 26: break; + case 6: + { return PineScriptTokenTypes.COMMA; + } + // fall through + case 27: break; + case 7: + { return PineScriptTokenTypes.DOT; + } + // fall through + case 28: break; + case 8: + { return PineScriptTokenTypes.NUMBER; + } + // fall through + case 29: break; + case 9: + { return PineScriptTokenTypes.SEMICOLON; + } + // fall through + case 30: break; + case 10: + { return PineScriptTokenTypes.IDENTIFIER; + } + // fall through + case 31: break; + case 11: + { return PineScriptTokenTypes.LBRACKET; + } + // fall through + case 32: break; + case 12: + { return PineScriptTokenTypes.RBRACKET; + } + // fall through + case 33: break; + case 13: + { return PineScriptTokenTypes.LBRACE; + } + // fall through + case 34: break; + case 14: + { return PineScriptTokenTypes.RBRACE; + } + // fall through + case 35: break; + case 15: + { return PineScriptTokenTypes.STRING; + } + // fall through + case 36: break; + case 16: + { return PineScriptTokenTypes.COMMENT; + } + // fall through + case 37: break; + case 17: + { return PineScriptTokenTypes.FUNCTION; + } + // fall through + case 38: break; + case 18: + { return PineScriptTokenTypes.KEYWORD; + } + // fall through + case 39: break; + case 19: + { return PineScriptTokenTypes.NAMESPACE; + } + // fall through + case 40: break; + case 20: + { return PineScriptTokenTypes.TYPE; + } + // fall through + case 41: break; + case 21: + { return PineScriptTokenTypes.BUILT_IN_VARIABLE; + } + // fall through + case 42: break; + default: + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/pine-script-intellij-plugin/src/main/java/com/pinescript/plugin/language/_PineScriptLexer.java~ b/pine-script-intellij-plugin/src/main/java/com/pinescript/plugin/language/_PineScriptLexer.java~ new file mode 100644 index 0000000..12c6d0f --- /dev/null +++ b/pine-script-intellij-plugin/src/main/java/com/pinescript/plugin/language/_PineScriptLexer.java~ @@ -0,0 +1,974 @@ +// DO NOT EDIT +// Generated by JFlex 1.9.1 http://jflex.de/ +// source: src/main/java/com/pinescript/plugin/language/_PineScriptLexer.flex + +package com.pinescript.plugin.language; + +import com.intellij.lexer.FlexLexer; +import com.intellij.psi.tree.IElementType; +import com.intellij.psi.TokenType; +import com.pinescript.plugin.psi.PineScriptTokenTypes; + + +@SuppressWarnings("fallthrough") +class _PineScriptLexer implements FlexLexer { + + /** This character denotes the end of file. */ + public static final int YYEOF = -1; + + /** Initial size of the lookahead buffer. */ + private static final int ZZ_BUFFERSIZE = 16384; + + // Lexical states. + public static final int YYINITIAL = 0; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0 + }; + + /** + * Top-level table for translating characters to character classes + */ + private static final int [] ZZ_CMAP_TOP = zzUnpackcmap_top(); + + private static final String ZZ_CMAP_TOP_PACKED_0 = + "\1\0\37\u0100\1\u0200\267\u0100\10\u0300\u1020\u0100"; + + private static int [] zzUnpackcmap_top() { + int [] result = new int[4352]; + int offset = 0; + offset = zzUnpackcmap_top(ZZ_CMAP_TOP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackcmap_top(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Second-level tables for translating characters to character classes + */ + private static final int [] ZZ_CMAP_BLOCKS = zzUnpackcmap_blocks(); + + private static final String ZZ_CMAP_BLOCKS_PACKED_0 = + "\11\0\1\1\1\2\1\3\1\4\1\5\22\0\1\1"+ + "\1\6\1\7\1\10\1\0\1\11\1\12\1\13\1\14"+ + "\1\15\2\11\1\16\1\17\1\20\1\21\12\22\1\6"+ + "\1\23\1\6\1\24\1\25\1\11\1\0\6\26\24\27"+ + "\1\30\1\31\1\32\1\0\1\27\1\0\1\33\1\34"+ + "\1\35\1\36\1\37\1\40\1\41\1\42\1\43\1\27"+ + "\1\44\1\45\1\46\1\47\1\50\1\51\1\52\1\53"+ + "\1\54\1\55\1\56\1\57\1\60\1\61\1\62\1\27"+ + "\1\63\1\64\1\65\7\0\1\3\u01a2\0\2\3\326\0"+ + "\u0100\3"; + + private static int [] zzUnpackcmap_blocks() { + int [] result = new int[1024]; + int offset = 0; + offset = zzUnpackcmap_blocks(ZZ_CMAP_BLOCKS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackcmap_blocks(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\1\0\1\1\1\2\1\3\2\1\1\3\2\1\1\4"+ + "\1\5\1\6\1\3\1\7\1\3\1\10\1\11\1\12"+ + "\1\13\1\14\17\12\1\15\1\1\1\16\1\0\1\17"+ + "\4\0\1\20\1\10\1\21\15\12\1\22\13\12\1\23"+ + "\5\12\1\0\2\12\1\24\25\12\1\23\4\12\1\22"+ + "\1\12\1\0\14\12\1\23\14\12\1\0\16\12\1\0"+ + "\5\12\1\25\1\12"; + + private static int [] zzUnpackAction() { + int [] result = new int[159]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\66\0\154\0\242\0\330\0\u010e\0\66\0\u0144"+ + "\0\u017a\0\66\0\66\0\66\0\u01b0\0\66\0\u01e6\0\u021c"+ + "\0\66\0\u0252\0\66\0\66\0\u0288\0\u02be\0\u02f4\0\u032a"+ + "\0\u0360\0\u0396\0\u03cc\0\u0402\0\u0438\0\u046e\0\u04a4\0\u04da"+ + "\0\u0510\0\u0546\0\u057c\0\66\0\u05b2\0\66\0\330\0\66"+ + "\0\u05e8\0\u061e\0\u017a\0\u0654\0\u068a\0\u06c0\0\66\0\u06f6"+ + "\0\u072c\0\u0762\0\u0798\0\u07ce\0\u0804\0\u083a\0\u0870\0\u08a6"+ + "\0\u08dc\0\u0912\0\u0948\0\u097e\0\u0252\0\u09b4\0\u09ea\0\u0a20"+ + "\0\u0a56\0\u0a8c\0\u0ac2\0\u0af8\0\u0b2e\0\u0b64\0\u0b9a\0\u0bd0"+ + "\0\u0c06\0\u0c3c\0\u0c72\0\u0ca8\0\u0cde\0\u0d14\0\u0d4a\0\u0d80"+ + "\0\u0db6\0\u0252\0\u0dec\0\u0e22\0\u0e58\0\u0e8e\0\u0ec4\0\u0efa"+ + "\0\u0f30\0\u0f66\0\u0f9c\0\u0fd2\0\u1008\0\u103e\0\u1074\0\u10aa"+ + "\0\u10e0\0\u1116\0\u114c\0\u1182\0\u11b8\0\u11ee\0\u1224\0\u125a"+ + "\0\u1290\0\u12c6\0\u12fc\0\u1332\0\u1368\0\u139e\0\u13d4\0\u140a"+ + "\0\u1440\0\u1476\0\u14ac\0\u14e2\0\u1518\0\u154e\0\u1584\0\u15ba"+ + "\0\u15f0\0\u1626\0\u165c\0\u0252\0\u1692\0\u16c8\0\u16fe\0\u1734"+ + "\0\u176a\0\u17a0\0\u17d6\0\u180c\0\u1842\0\u1878\0\u18ae\0\u18e4"+ + "\0\u191a\0\u1950\0\u1986\0\u19bc\0\u19f2\0\u1a28\0\u1a5e\0\u1a94"+ + "\0\u1aca\0\u1b00\0\u1b36\0\u1b6c\0\u1ba2\0\u1bd8\0\u1c0e\0\u1c44"+ + "\0\u1c7a\0\u1cb0\0\u1ce6\0\u1d1c\0\u1d52\0\66\0\u1d88"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[159]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length() - 1; + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpacktrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\2\2\3\1\2\1\3\1\2\1\4\1\5\1\6"+ + "\1\7\1\10\1\11\1\12\1\13\1\14\1\15\1\16"+ + "\1\17\1\20\1\21\2\4\2\22\1\23\1\2\1\24"+ + "\1\25\1\26\1\27\1\30\1\31\1\32\2\22\1\33"+ + "\1\22\1\34\1\35\1\36\3\22\1\37\1\40\1\41"+ + "\1\22\1\42\1\43\2\22\1\44\1\45\1\46\67\0"+ + "\2\3\1\0\1\3\105\0\1\7\41\0\7\47\1\50"+ + "\21\47\1\51\34\47\22\0\1\52\3\0\1\52\4\0"+ + "\6\52\37\0\1\7\53\0\13\53\1\50\15\53\1\54"+ + "\34\53\25\0\1\7\61\0\1\55\64\0\1\56\1\0"+ + "\1\20\57\0\1\57\5\0\1\22\3\0\2\22\3\0"+ + "\30\22\17\0\1\57\5\0\1\22\3\0\2\22\3\0"+ + "\20\22\1\60\7\22\17\0\1\57\5\0\1\22\3\0"+ + "\2\22\3\0\15\22\1\61\2\22\1\62\7\22\17\0"+ + "\1\57\5\0\1\22\3\0\2\22\3\0\1\63\6\22"+ + "\1\64\5\22\1\65\12\22\17\0\1\57\5\0\1\22"+ + "\3\0\2\22\3\0\4\22\1\66\23\22\17\0\1\57"+ + "\5\0\1\22\3\0\2\22\3\0\12\22\1\63\1\22"+ + "\1\67\11\22\1\70\1\22\17\0\1\57\5\0\1\22"+ + "\3\0\2\22\3\0\1\71\11\22\1\72\2\22\1\73"+ + "\5\22\1\74\4\22\17\0\1\57\5\0\1\22\3\0"+ + "\2\22\3\0\5\22\1\75\5\22\1\70\1\76\13\22"+ + "\17\0\1\57\5\0\1\22\3\0\2\22\3\0\1\77"+ + "\7\22\1\100\17\22\17\0\1\57\5\0\1\22\3\0"+ + "\2\22\3\0\1\101\3\22\1\102\23\22\17\0\1\57"+ + "\5\0\1\22\3\0\2\22\3\0\1\75\27\22\17\0"+ + "\1\57\5\0\1\22\3\0\2\22\3\0\4\22\1\103"+ + "\23\22\17\0\1\57\5\0\1\22\3\0\2\22\3\0"+ + "\4\22\1\104\3\22\1\105\11\22\1\106\2\22\1\107"+ + "\1\22\1\110\17\0\1\57\5\0\1\22\3\0\2\22"+ + "\3\0\1\111\7\22\1\112\4\22\1\75\2\22\1\113"+ + "\6\22\1\114\17\0\1\57\5\0\1\22\3\0\2\22"+ + "\3\0\1\115\27\22\17\0\1\57\5\0\1\22\3\0"+ + "\2\22\3\0\7\22\1\116\20\22\67\0\1\7\1\0"+ + "\2\47\4\0\60\47\22\0\1\117\3\0\1\117\4\0"+ + "\6\117\25\0\2\53\4\0\60\53\2\55\1\0\2\55"+ + "\1\0\60\55\22\0\1\56\57\0\1\57\5\0\1\22"+ + "\3\0\2\22\3\0\20\22\1\120\7\22\17\0\1\57"+ + "\5\0\1\22\3\0\2\22\3\0\15\22\1\121\10\22"+ + "\1\122\1\22\17\0\1\57\5\0\1\22\3\0\2\22"+ + "\3\0\4\22\1\123\23\22\17\0\1\57\5\0\1\22"+ + "\3\0\2\22\3\0\21\22\1\124\6\22\17\0\1\57"+ + "\5\0\1\22\3\0\2\22\3\0\1\125\27\22\17\0"+ + "\1\57\5\0\1\22\3\0\2\22\3\0\12\22\1\126"+ + "\1\22\1\127\13\22\17\0\1\57\5\0\1\22\3\0"+ + "\2\22\3\0\5\22\1\130\22\22\17\0\1\57\5\0"+ + "\1\22\3\0\2\22\3\0\23\22\1\131\4\22\17\0"+ + "\1\57\5\0\1\22\3\0\2\22\3\0\16\22\1\132"+ + "\11\22\17\0\1\57\5\0\1\22\3\0\2\22\3\0"+ + "\12\22\1\63\15\22\17\0\1\57\5\0\1\22\3\0"+ + "\2\22\3\0\15\22\1\133\12\22\17\0\1\57\5\0"+ + "\1\22\3\0\2\22\3\0\20\22\1\75\7\22\17\0"+ + "\1\57\5\0\1\22\3\0\2\22\3\0\14\22\1\134"+ + "\13\22\17\0\1\57\5\0\1\22\3\0\2\22\3\0"+ + "\3\22\1\135\12\22\1\136\3\22\1\122\5\22\17\0"+ + "\1\57\5\0\1\22\3\0\2\22\3\0\1\22\1\137"+ + "\26\22\17\0\1\57\5\0\1\22\3\0\2\22\3\0"+ + "\1\22\1\140\12\22\1\141\13\22\17\0\1\57\5\0"+ + "\1\22\3\0\2\22\3\0\22\22\1\142\5\22\17\0"+ + "\1\57\5\0\1\22\3\0\2\22\3\0\22\22\1\143"+ + "\5\22\17\0\1\57\5\0\1\22\3\0\2\22\3\0"+ + "\17\22\1\144\2\22\1\145\5\22\17\0\1\57\5\0"+ + "\1\22\3\0\2\22\3\0\20\22\1\146\7\22\17\0"+ + "\1\57\5\0\1\22\3\0\2\22\3\0\13\22\1\147"+ + "\14\22\17\0\1\57\5\0\1\22\3\0\2\22\3\0"+ + "\20\22\1\150\7\22\17\0\1\57\5\0\1\22\3\0"+ + "\2\22\3\0\10\22\1\151\17\22\17\0\1\57\5\0"+ + "\1\22\3\0\2\22\3\0\13\22\1\152\14\22\17\0"+ + "\1\57\5\0\1\22\3\0\2\22\3\0\1\22\1\153"+ + "\26\22\17\0\1\57\5\0\1\22\3\0\2\22\3\0"+ + "\2\22\1\154\25\22\17\0\1\57\5\0\1\22\3\0"+ + "\2\22\3\0\23\22\1\124\4\22\17\0\1\57\5\0"+ + "\1\22\3\0\2\22\3\0\16\22\1\124\11\22\17\0"+ + "\1\57\5\0\1\22\3\0\2\22\3\0\20\22\1\155"+ + "\7\22\17\0\1\57\5\0\1\22\3\0\2\22\3\0"+ + "\10\22\1\156\17\22\25\0\1\157\3\0\1\157\4\0"+ + "\6\157\41\0\1\57\5\0\1\22\3\0\2\22\3\0"+ + "\1\160\27\22\17\0\1\57\5\0\1\22\3\0\2\22"+ + "\3\0\12\22\1\122\15\22\17\0\1\57\5\0\1\22"+ + "\3\0\2\22\3\0\1\161\27\22\17\0\1\57\5\0"+ + "\1\22\3\0\2\22\3\0\4\22\1\75\23\22\17\0"+ + "\1\57\5\0\1\22\3\0\2\22\3\0\20\22\1\162"+ + "\7\22\17\0\1\57\5\0\1\22\3\0\2\22\3\0"+ + "\15\22\1\163\12\22\17\0\1\57\5\0\1\22\3\0"+ + "\2\22\3\0\21\22\1\164\1\165\5\22\17\0\1\57"+ + "\5\0\1\22\3\0\2\22\3\0\1\166\27\22\17\0"+ + "\1\57\5\0\1\22\3\0\2\22\3\0\13\22\1\75"+ + "\14\22\17\0\1\57\5\0\1\22\3\0\2\22\3\0"+ + "\15\22\1\167\12\22\17\0\1\57\5\0\1\22\3\0"+ + "\2\22\3\0\1\170\27\22\17\0\1\57\5\0\1\22"+ + "\3\0\2\22\3\0\2\22\1\171\25\22\17\0\1\57"+ + "\5\0\1\22\3\0\2\22\3\0\10\22\1\172\17\22"+ + "\17\0\1\57\5\0\1\22\3\0\2\22\3\0\23\22"+ + "\1\164\4\22\17\0\1\57\5\0\1\22\3\0\2\22"+ + "\3\0\4\22\1\121\23\22\17\0\1\57\5\0\1\22"+ + "\3\0\2\22\3\0\20\22\1\173\7\22\17\0\1\57"+ + "\5\0\1\22\3\0\2\22\3\0\4\22\1\122\23\22"+ + "\17\0\1\57\5\0\1\22\3\0\2\22\3\0\7\22"+ + "\1\174\10\22\1\175\7\22\17\0\1\57\5\0\1\22"+ + "\3\0\2\22\3\0\7\22\1\176\20\22\17\0\1\57"+ + "\5\0\1\22\3\0\2\22\3\0\23\22\1\177\4\22"+ + "\17\0\1\57\5\0\1\22\3\0\2\22\3\0\23\22"+ + "\1\200\4\22\17\0\1\57\5\0\1\22\3\0\2\22"+ + "\3\0\10\22\1\201\17\22\17\0\1\57\5\0\1\22"+ + "\3\0\2\22\3\0\16\22\1\156\11\22\17\0\1\57"+ + "\5\0\1\22\3\0\2\22\3\0\1\202\7\22\1\203"+ + "\17\22\17\0\1\57\5\0\1\22\3\0\2\22\3\0"+ + "\22\22\1\204\5\22\17\0\1\57\5\0\1\22\3\0"+ + "\2\22\3\0\10\22\1\205\17\22\17\0\1\57\5\0"+ + "\1\22\3\0\2\22\3\0\12\22\1\206\15\22\17\0"+ + "\1\57\5\0\1\22\3\0\2\22\3\0\11\22\1\207"+ + "\16\22\17\0\1\57\5\0\1\22\3\0\2\22\3\0"+ + "\10\22\1\210\17\22\17\0\1\57\5\0\1\22\3\0"+ + "\2\22\3\0\12\22\1\124\15\22\25\0\1\211\3\0"+ + "\1\211\4\0\6\211\41\0\1\57\5\0\1\22\3\0"+ + "\2\22\3\0\27\22\1\174\17\0\1\57\5\0\1\22"+ + "\3\0\2\22\3\0\11\22\1\75\16\22\17\0\1\57"+ + "\5\0\1\22\3\0\2\22\3\0\22\22\1\174\5\22"+ + "\17\0\1\57\5\0\1\22\3\0\2\22\3\0\20\22"+ + "\1\174\7\22\17\0\1\57\5\0\1\22\3\0\2\22"+ + "\3\0\22\22\1\75\5\22\17\0\1\57\5\0\1\22"+ + "\3\0\2\22\3\0\10\22\1\212\17\22\17\0\1\57"+ + "\5\0\1\22\3\0\2\22\3\0\23\22\1\213\4\22"+ + "\17\0\1\57\5\0\1\22\3\0\2\22\3\0\20\22"+ + "\1\164\7\22\17\0\1\57\5\0\1\22\3\0\2\22"+ + "\3\0\22\22\1\122\5\22\17\0\1\57\5\0\1\22"+ + "\3\0\2\22\3\0\22\22\1\214\5\22\17\0\1\57"+ + "\5\0\1\22\3\0\2\22\3\0\2\22\1\215\25\22"+ + "\17\0\1\57\5\0\1\22\3\0\2\22\3\0\1\216"+ + "\27\22\17\0\1\57\5\0\1\22\3\0\2\22\3\0"+ + "\10\22\1\217\17\22\17\0\1\57\5\0\1\22\3\0"+ + "\2\22\3\0\15\22\1\220\12\22\17\0\1\57\5\0"+ + "\1\22\3\0\2\22\3\0\4\22\1\221\23\22\17\0"+ + "\1\57\5\0\1\22\3\0\2\22\3\0\20\22\1\222"+ + "\7\22\17\0\1\57\5\0\1\22\3\0\2\22\3\0"+ + "\4\22\1\223\23\22\17\0\1\57\5\0\1\22\3\0"+ + "\2\22\3\0\22\22\1\224\5\22\17\0\1\57\5\0"+ + "\1\22\3\0\2\22\3\0\14\22\1\225\13\22\17\0"+ + "\1\57\5\0\1\22\3\0\2\22\3\0\2\22\1\226"+ + "\25\22\17\0\1\57\5\0\1\22\3\0\2\22\3\0"+ + "\14\22\1\227\13\22\17\0\1\57\5\0\1\22\3\0"+ + "\2\22\3\0\4\22\1\174\23\22\17\0\1\57\5\0"+ + "\1\22\3\0\2\22\3\0\4\22\1\163\23\22\17\0"+ + "\1\57\5\0\1\22\3\0\2\22\3\0\16\22\1\75"+ + "\11\22\25\0\1\230\3\0\1\230\4\0\6\230\41\0"+ + "\1\57\5\0\1\22\3\0\2\22\3\0\14\22\1\113"+ + "\13\22\17\0\1\57\5\0\1\22\3\0\2\22\3\0"+ + "\12\22\1\164\15\22\17\0\1\57\5\0\1\22\3\0"+ + "\2\22\3\0\10\22\1\231\17\22\17\0\1\57\5\0"+ + "\1\22\3\0\2\22\3\0\1\232\27\22\17\0\1\57"+ + "\5\0\1\22\3\0\2\22\3\0\20\22\1\233\7\22"+ + "\17\0\1\57\5\0\1\22\3\0\2\22\3\0\26\22"+ + "\1\174\1\22\17\0\1\57\5\0\1\22\3\0\2\22"+ + "\3\0\3\22\1\75\24\22\17\0\1\57\5\0\1\22"+ + "\3\0\2\22\3\0\21\22\1\162\6\22\17\0\1\57"+ + "\5\0\1\22\3\0\2\22\3\0\14\22\1\75\13\22"+ + "\17\0\1\57\5\0\1\22\3\0\2\22\3\0\21\22"+ + "\1\75\6\22\17\0\1\57\5\0\1\22\3\0\2\22"+ + "\3\0\4\22\1\234\23\22\17\0\1\57\5\0\1\22"+ + "\3\0\2\22\3\0\6\22\1\122\21\22\17\0\1\57"+ + "\5\0\1\22\3\0\2\22\3\0\7\22\1\75\20\22"+ + "\17\0\1\57\5\0\1\22\3\0\2\22\3\0\5\22"+ + "\1\235\22\22\25\0\1\236\3\0\1\236\4\0\6\236"+ + "\41\0\1\57\5\0\1\22\3\0\2\22\3\0\15\22"+ + "\1\222\12\22\17\0\1\57\5\0\1\22\3\0\2\22"+ + "\3\0\22\22\1\237\5\22\17\0\1\57\5\0\1\22"+ + "\3\0\2\22\3\0\27\22\1\75\17\0\1\57\5\0"+ + "\1\22\3\0\2\22\3\0\6\22\1\233\21\22\17\0"+ + "\1\57\5\0\1\22\3\0\2\22\3\0\15\22\1\174"+ + "\12\22\17\0\1\57\5\0\1\22\3\0\2\22\3\0"+ + "\15\22\1\73\12\22\3\0"; + + private static int [] zzUnpacktrans() { + int [] result = new int[7614]; + int offset = 0; + offset = zzUnpacktrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpacktrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** Error code for "Unknown internal scanner error". */ + private static final int ZZ_UNKNOWN_ERROR = 0; + /** Error code for "could not match input". */ + private static final int ZZ_NO_MATCH = 1; + /** Error code for "pushback value was too large". */ + private static final int ZZ_PUSHBACK_2BIG = 2; + + /** + * Error messages for {@link #ZZ_UNKNOWN_ERROR}, {@link #ZZ_NO_MATCH}, and + * {@link #ZZ_PUSHBACK_2BIG} respectively. + */ + private static final String ZZ_ERROR_MSG[] = { + "Unknown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state {@code aState} + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\1\0\1\11\4\1\1\11\2\1\3\11\1\1\1\11"+ + "\2\1\1\11\1\1\2\11\17\1\1\11\1\1\1\11"+ + "\1\0\1\11\4\0\2\1\1\11\37\1\1\0\37\1"+ + "\1\0\31\1\1\0\16\1\1\0\5\1\1\11\1\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[159]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** Input device. */ + private java.io.Reader zzReader; + + /** Current state of the DFA. */ + private int zzState; + + /** Current lexical state. */ + private int zzLexicalState = YYINITIAL; + + /** + * This buffer contains the current text to be matched and is the source of the {@link #yytext()} + * string. + */ + private char zzBuffer[] = new char[Math.min(ZZ_BUFFERSIZE, zzMaxBufferLen())]; + + /** Text position at the last accepting state. */ + private int zzMarkedPos; + + /** Current text position in the buffer. */ + private int zzCurrentPos; + + /** Marks the beginning of the {@link #yytext()} string in the buffer. */ + private int zzStartRead; + + /** Marks the last character in the buffer, that has been read from input. */ + private int zzEndRead; + + /** + * Whether the scanner is at the end of file. + * @see #yyatEOF + */ + private boolean zzAtEOF; + + /** + * The number of occupied positions in {@link #zzBuffer} beyond {@link #zzEndRead}. + * + *
When a lead/high surrogate has been read from the input stream into the final + * {@link #zzBuffer} position, this will have a value of 1; otherwise, it will have a value of 0. + */ + private int zzFinalHighSurrogate = 0; + + /** Number of newlines encountered up to the start of the matched text. */ + @SuppressWarnings("unused") + private int yyline; + + /** Number of characters from the last newline up to the start of the matched text. */ + @SuppressWarnings("unused") + private int yycolumn; + + /** Number of characters up to the start of the matched text. */ + @SuppressWarnings("unused") + private long yychar; + + /** Whether the scanner is currently at the beginning of a line. */ + @SuppressWarnings("unused") + private boolean zzAtBOL = true; + + /** Whether the user-EOF-code has already been executed. */ + private boolean zzEOFDone; + + /* user code: */ + public void reset(CharSequence buffer, int start, int end, int initialState) { + this.zzBuffer = buffer.toString().toCharArray(); + this.zzCurrentPos = this.zzMarkedPos = this.zzStartRead = start; + this.zzEndRead = end; + this.zzAtEOF = false; + this.zzAtBOL = true; + yybegin(initialState); + } + + + /** + * Creates a new scanner + * + * @param in the java.io.Reader to read input from. + */ + _PineScriptLexer(java.io.Reader in) { + this.zzReader = in; + } + + + /** Returns the maximum size of the scanner buffer, which limits the size of tokens. */ + private int zzMaxBufferLen() { + return Integer.MAX_VALUE; + } + + /** Whether the scanner buffer can grow to accommodate a larger token. */ + private boolean zzCanGrow() { + return true; + } + + /** + * Translates raw input code points to DFA table row + */ + private static int zzCMap(int input) { + int offset = input & 255; + return offset == input ? ZZ_CMAP_BLOCKS[offset] : ZZ_CMAP_BLOCKS[ZZ_CMAP_TOP[input >> 8] | offset]; + } + + /** + * Refills the input buffer. + * + * @return {@code false} iff there was new input. + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + zzEndRead += zzFinalHighSurrogate; + zzFinalHighSurrogate = 0; + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead - zzStartRead); + + /* translate stored positions */ + zzEndRead -= zzStartRead; + zzCurrentPos -= zzStartRead; + zzMarkedPos -= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length - zzFinalHighSurrogate && zzCanGrow()) { + /* if not, and it can grow: blow it up */ + char newBuffer[] = new char[Math.min(zzBuffer.length * 2, zzMaxBufferLen())]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + zzEndRead += zzFinalHighSurrogate; + zzFinalHighSurrogate = 0; + } + + /* fill the buffer with new input */ + int requested = zzBuffer.length - zzEndRead; + int numRead = zzReader.read(zzBuffer, zzEndRead, requested); + + /* not supposed to occur according to specification of java.io.Reader */ + if (numRead == 0) { + if (requested == 0) { + throw new java.io.EOFException("Scan buffer limit reached ["+zzBuffer.length+"]"); + } + else { + throw new java.io.IOException( + "Reader returned 0 characters. See JFlex examples/zero-reader for a workaround."); + } + } + if (numRead > 0) { + zzEndRead += numRead; + if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) { + if (numRead == requested) { // We requested too few chars to encode a full Unicode character + --zzEndRead; + zzFinalHighSurrogate = 1; + } else { // There is room in the buffer for at least one more char + int c = zzReader.read(); // Expecting to read a paired low surrogate char + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char)c; + } + } + } + /* potentially more input available */ + return false; + } + + /* numRead < 0 ==> end of stream */ + return true; + } + + + /** + * Closes the input reader. + * + * @throws java.io.IOException if the reader could not be closed. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; // indicate end of file + zzEndRead = zzStartRead; // invalidate buffer + + if (zzReader != null) { + zzReader.close(); + } + } + + + /** + * Resets the scanner to read from a new input stream. + * + *
Does not close the old reader. + * + *
All internal variables are reset, the old input stream cannot be reused (internal + * buffer is discarded and lost). Lexical state is set to {@code ZZ_INITIAL}. + * + *
Internal scan buffer is resized down to its initial length, if it has grown. + * + * @param reader The new input stream. + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzEOFDone = false; + yyResetPosition(); + zzLexicalState = YYINITIAL; + int initBufferSize = Math.min(ZZ_BUFFERSIZE, zzMaxBufferLen()); + if (zzBuffer.length > initBufferSize) { + zzBuffer = new char[initBufferSize]; + } + } + + /** + * Resets the input position. + */ + private final void yyResetPosition() { + zzAtBOL = true; + zzAtEOF = false; + zzCurrentPos = 0; + zzMarkedPos = 0; + zzStartRead = 0; + zzEndRead = 0; + zzFinalHighSurrogate = 0; + yyline = 0; + yycolumn = 0; + yychar = 0L; + } + + + /** + * Returns whether the scanner has reached the end of the reader it reads from. + * + * @return whether the scanner has reached EOF. + */ + public final boolean yyatEOF() { + return zzAtEOF; + } + + + /** + * Returns the current lexical state. + * + * @return the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state. + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + * + * @return the matched text. + */ + public final String yytext() { + return new String(zzBuffer, zzStartRead, zzMarkedPos-zzStartRead); + } + + + /** + * Returns the character at the given position from the matched text. + * + *
It is equivalent to {@code yytext().charAt(pos)}, but faster. + * + * @param position the position of the character to fetch. A value from 0 to {@code yylength()-1}. + * + * @return the character at {@code position}. + */ + public final char yycharat(int position) { + return zzBuffer[zzStartRead + position]; + } + + + /** + * How many characters were matched. + * + * @return the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occurred while scanning. + * + *
In a well-formed scanner (no or only correct usage of {@code yypushback(int)} and a + * match-all fallback rule) this method will only be called with things that + * "Can't Possibly Happen". + * + *
If this method is called, something is seriously wrong (e.g. a JFlex bug producing a faulty + * scanner etc.). + * + *
Usual syntax/scanner level error handling should be done in error fallback rules. + * + * @param errorCode the code of the error message to display. + */ + private static void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + *
They will be read again by then next call of the scanning method.
+ *
+ * @param number the number of characters to be read again. This number must not be greater than
+ * {@link #yylength()}.
+ */
+ public void yypushback(int number) {
+ if ( number > yylength() )
+ zzScanError(ZZ_PUSHBACK_2BIG);
+
+ zzMarkedPos -= number;
+ }
+
+
+ /**
+ * Contains user EOF-code, which will be executed exactly once,
+ * when the end of file is reached
+ */
+ private void zzDoEOF() {
+ if (!zzEOFDone) {
+ zzEOFDone = true;
+
+ }
+ }
+
+
+
+
+ /**
+ * Resumes scanning until the next regular expression is matched, the end of input is encountered
+ * or an I/O-Error occurs.
+ *
+ * @return the next token.
+ * @exception java.io.IOException if any I/O-Error occurs.
+ */
+ public IElementType advance() throws java.io.IOException
+ {
+ int zzInput;
+ int zzAction;
+
+ // cached fields:
+ int zzCurrentPosL;
+ int zzMarkedPosL;
+ int zzEndReadL = zzEndRead;
+ char[] zzBufferL = zzBuffer;
+
+ int [] zzTransL = ZZ_TRANS;
+ int [] zzRowMapL = ZZ_ROWMAP;
+ int [] zzAttrL = ZZ_ATTRIBUTE;
+
+ while (true) {
+ zzMarkedPosL = zzMarkedPos;
+
+ zzAction = -1;
+
+ zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
+
+ zzState = ZZ_LEXSTATE[zzLexicalState];
+
+ // set up zzAction for empty match case:
+ int zzAttributes = zzAttrL[zzState];
+ if ( (zzAttributes & 1) == 1 ) {
+ zzAction = zzState;
+ }
+
+
+ zzForAction: {
+ while (true) {
+
+ if (zzCurrentPosL < zzEndReadL) {
+ zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL);
+ zzCurrentPosL += Character.charCount(zzInput);
+ }
+ else if (zzAtEOF) {
+ zzInput = YYEOF;
+ break zzForAction;
+ }
+ else {
+ // store back cached positions
+ zzCurrentPos = zzCurrentPosL;
+ zzMarkedPos = zzMarkedPosL;
+ boolean eof = zzRefill();
+ // get translated positions and possibly new buffer
+ zzCurrentPosL = zzCurrentPos;
+ zzMarkedPosL = zzMarkedPos;
+ zzBufferL = zzBuffer;
+ zzEndReadL = zzEndRead;
+ if (eof) {
+ zzInput = YYEOF;
+ break zzForAction;
+ }
+ else {
+ zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL);
+ zzCurrentPosL += Character.charCount(zzInput);
+ }
+ }
+ int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMap(zzInput) ];
+ if (zzNext == -1) break zzForAction;
+ zzState = zzNext;
+
+ zzAttributes = zzAttrL[zzState];
+ if ( (zzAttributes & 1) == 1 ) {
+ zzAction = zzState;
+ zzMarkedPosL = zzCurrentPosL;
+ if ( (zzAttributes & 8) == 8 ) break zzForAction;
+ }
+
+ }
+ }
+
+ // store back cached position
+ zzMarkedPos = zzMarkedPosL;
+
+ if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
+ zzAtEOF = true;
+ zzDoEOF();
+ return null;
+ }
+ else {
+ switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
+ case 1:
+ { return TokenType.BAD_CHARACTER;
+ }
+ // fall through
+ case 22: break;
+ case 2:
+ { return TokenType.WHITE_SPACE;
+ }
+ // fall through
+ case 23: break;
+ case 3:
+ { return PineScriptTokenTypes.OPERATOR;
+ }
+ // fall through
+ case 24: break;
+ case 4:
+ { return PineScriptTokenTypes.LPAREN;
+ }
+ // fall through
+ case 25: break;
+ case 5:
+ { return PineScriptTokenTypes.RPAREN;
+ }
+ // fall through
+ case 26: break;
+ case 6:
+ { return PineScriptTokenTypes.COMMA;
+ }
+ // fall through
+ case 27: break;
+ case 7:
+ { return PineScriptTokenTypes.DOT;
+ }
+ // fall through
+ case 28: break;
+ case 8:
+ { return PineScriptTokenTypes.NUMBER;
+ }
+ // fall through
+ case 29: break;
+ case 9:
+ { return PineScriptTokenTypes.SEMICOLON;
+ }
+ // fall through
+ case 30: break;
+ case 10:
+ { return PineScriptTokenTypes.IDENTIFIER;
+ }
+ // fall through
+ case 31: break;
+ case 11:
+ { return PineScriptTokenTypes.LBRACKET;
+ }
+ // fall through
+ case 32: break;
+ case 12:
+ { return PineScriptTokenTypes.RBRACKET;
+ }
+ // fall through
+ case 33: break;
+ case 13:
+ { return PineScriptTokenTypes.LBRACE;
+ }
+ // fall through
+ case 34: break;
+ case 14:
+ { return PineScriptTokenTypes.RBRACE;
+ }
+ // fall through
+ case 35: break;
+ case 15:
+ { return PineScriptTokenTypes.STRING;
+ }
+ // fall through
+ case 36: break;
+ case 16:
+ { return PineScriptTokenTypes.COMMENT;
+ }
+ // fall through
+ case 37: break;
+ case 17:
+ { return PineScriptTokenTypes.FUNCTION;
+ }
+ // fall through
+ case 38: break;
+ case 18:
+ { return PineScriptTokenTypes.KEYWORD;
+ }
+ // fall through
+ case 39: break;
+ case 19:
+ { return PineScriptTokenTypes.NAMESPACE;
+ }
+ // fall through
+ case 40: break;
+ case 20:
+ { return PineScriptTokenTypes.TYPE;
+ }
+ // fall through
+ case 41: break;
+ case 21:
+ { return PineScriptTokenTypes.BUILT_IN_VARIABLE;
+ }
+ // fall through
+ case 42: break;
+ default:
+ zzScanError(ZZ_NO_MATCH);
+ }
+ }
+ }
+ }
+
+
+}
diff --git a/pine-script-intellij-plugin/src/main/java/com/pinescript/plugin/parser/PineScriptParser.java b/pine-script-intellij-plugin/src/main/java/com/pinescript/plugin/parser/PineScriptParser.java
new file mode 100644
index 0000000..2461f08
--- /dev/null
+++ b/pine-script-intellij-plugin/src/main/java/com/pinescript/plugin/parser/PineScriptParser.java
@@ -0,0 +1,29 @@
+package com.pinescript.plugin.parser;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.LightPsiParser;
+import com.intellij.lang.PsiBuilder;
+import com.intellij.lang.PsiParser;
+import com.intellij.psi.tree.IElementType;
+import org.jetbrains.annotations.NotNull;
+
+public class PineScriptParser implements PsiParser, LightPsiParser {
+ @NotNull
+ @Override
+ public ASTNode parse(@NotNull IElementType root, @NotNull PsiBuilder builder) {
+ parseLight(root, builder);
+ return builder.getTreeBuilt();
+ }
+
+ @Override
+ public void parseLight(IElementType root, PsiBuilder builder) {
+ PsiBuilder.Marker rootMarker = builder.mark();
+
+ // Simple implementation: consume all tokens as-is
+ while (!builder.eof()) {
+ builder.advanceLexer();
+ }
+
+ rootMarker.done(root);
+ }
+}
\ No newline at end of file
diff --git a/pine-script-intellij-plugin/src/main/java/com/pinescript/plugin/psi/PineScriptFile.java b/pine-script-intellij-plugin/src/main/java/com/pinescript/plugin/psi/PineScriptFile.java
new file mode 100644
index 0000000..5df27d5
--- /dev/null
+++ b/pine-script-intellij-plugin/src/main/java/com/pinescript/plugin/psi/PineScriptFile.java
@@ -0,0 +1,25 @@
+package com.pinescript.plugin.psi;
+
+import com.intellij.extapi.psi.PsiFileBase;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.psi.FileViewProvider;
+import com.pinescript.plugin.language.PineScriptFileType;
+import com.pinescript.plugin.language.PineScriptLanguage;
+import org.jetbrains.annotations.NotNull;
+
+public class PineScriptFile extends PsiFileBase {
+ public PineScriptFile(@NotNull FileViewProvider viewProvider) {
+ super(viewProvider, PineScriptLanguage.INSTANCE);
+ }
+
+ @NotNull
+ @Override
+ public FileType getFileType() {
+ return PineScriptFileType.INSTANCE;
+ }
+
+ @Override
+ public String toString() {
+ return "Pine Script File";
+ }
+}
\ No newline at end of file
diff --git a/pine-script-intellij-plugin/src/main/java/com/pinescript/plugin/psi/PineScriptPsiElement.java b/pine-script-intellij-plugin/src/main/java/com/pinescript/plugin/psi/PineScriptPsiElement.java
new file mode 100644
index 0000000..f6af9d6
--- /dev/null
+++ b/pine-script-intellij-plugin/src/main/java/com/pinescript/plugin/psi/PineScriptPsiElement.java
@@ -0,0 +1,11 @@
+package com.pinescript.plugin.psi;
+
+import com.intellij.extapi.psi.ASTWrapperPsiElement;
+import com.intellij.lang.ASTNode;
+import org.jetbrains.annotations.NotNull;
+
+public class PineScriptPsiElement extends ASTWrapperPsiElement {
+ public PineScriptPsiElement(@NotNull ASTNode node) {
+ super(node);
+ }
+}
\ No newline at end of file
diff --git a/pine-script-intellij-plugin/src/main/java/com/pinescript/plugin/psi/PineScriptTokenTypes.java b/pine-script-intellij-plugin/src/main/java/com/pinescript/plugin/psi/PineScriptTokenTypes.java
new file mode 100644
index 0000000..0c5f1e5
--- /dev/null
+++ b/pine-script-intellij-plugin/src/main/java/com/pinescript/plugin/psi/PineScriptTokenTypes.java
@@ -0,0 +1,55 @@
+package com.pinescript.plugin.psi;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.tree.IElementType;
+import com.pinescript.plugin.language.PineScriptLanguage;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+public interface PineScriptTokenTypes {
+ // Token types for Pine Script
+ IElementType COMMENT = new PineScriptTokenType("COMMENT");
+ IElementType STRING = new PineScriptTokenType("STRING");
+ IElementType NUMBER = new PineScriptTokenType("NUMBER");
+ IElementType IDENTIFIER = new PineScriptTokenType("IDENTIFIER");
+
+ // Keywords
+ IElementType KEYWORD = new PineScriptTokenType("KEYWORD");
+ IElementType FUNCTION = new PineScriptTokenType("FUNCTION");
+ IElementType BUILT_IN_VARIABLE = new PineScriptTokenType("BUILT_IN_VARIABLE");
+ IElementType OPERATOR = new PineScriptTokenType("OPERATOR");
+ IElementType TYPE = new PineScriptTokenType("TYPE");
+ IElementType METHOD = new PineScriptTokenType("METHOD");
+ IElementType NAMESPACE = new PineScriptTokenType("NAMESPACE");
+ IElementType ANNOTATION = new PineScriptTokenType("ANNOTATION");
+
+ // Punctuation
+ IElementType DOT = new PineScriptTokenType("DOT");
+ IElementType COMMA = new PineScriptTokenType("COMMA");
+ IElementType SEMICOLON = new PineScriptTokenType("SEMICOLON");
+ IElementType LPAREN = new PineScriptTokenType("LPAREN");
+ IElementType RPAREN = new PineScriptTokenType("RPAREN");
+ IElementType LBRACKET = new PineScriptTokenType("LBRACKET");
+ IElementType RBRACKET = new PineScriptTokenType("RBRACKET");
+ IElementType LBRACE = new PineScriptTokenType("LBRACE");
+ IElementType RBRACE = new PineScriptTokenType("RBRACE");
+
+ class Factory {
+ public static PsiElement createElement(ASTNode node) {
+ return new PineScriptPsiElement(node);
+ }
+ }
+}
+
+class PineScriptTokenType extends IElementType {
+ public PineScriptTokenType(@NotNull @NonNls String debugName) {
+ super(debugName, PineScriptLanguage.INSTANCE);
+ }
+}
+
+class PineScriptElementType extends IElementType {
+ public PineScriptElementType(@NotNull @NonNls String debugName) {
+ super(debugName, PineScriptLanguage.INSTANCE);
+ }
+}
\ No newline at end of file
diff --git a/pine-script-intellij-plugin/src/main/resources/META-INF/filewatcher.xml b/pine-script-intellij-plugin/src/main/resources/META-INF/filewatcher.xml
new file mode 100644
index 0000000..16651ad
--- /dev/null
+++ b/pine-script-intellij-plugin/src/main/resources/META-INF/filewatcher.xml
@@ -0,0 +1,7 @@
+
Features:
+Features:
+Features:
+Features:
+Features:
+When a lead/high surrogate has been read from the input stream into the final + * {@link #zzBuffer} position, this will have a value of 1; otherwise, it will have a value of 0. + */ + private int zzFinalHighSurrogate = 0; + + /** Number of newlines encountered up to the start of the matched text. */ + @SuppressWarnings("unused") + private int yyline; + + /** Number of characters from the last newline up to the start of the matched text. */ + @SuppressWarnings("unused") + private int yycolumn; + + /** Number of characters up to the start of the matched text. */ + @SuppressWarnings("unused") + private long yychar; + + /** Whether the scanner is currently at the beginning of a line. */ + @SuppressWarnings("unused") + private boolean zzAtBOL = true; + + /** Whether the user-EOF-code has already been executed. */ + private boolean zzEOFDone; + + /* user code: */ + public void reset(CharSequence buffer, int start, int end, int initialState) { + this.zzBuffer = buffer.toString().toCharArray(); + this.zzCurrentPos = this.zzMarkedPos = this.zzStartRead = start; + this.zzEndRead = end; + this.zzAtEOF = false; + this.zzAtBOL = true; + yybegin(initialState); + } + + + /** + * Creates a new scanner + * + * @param in the java.io.Reader to read input from. + */ + _PineScriptLexer(java.io.Reader in) { + this.zzReader = in; + } + + + /** Returns the maximum size of the scanner buffer, which limits the size of tokens. */ + private int zzMaxBufferLen() { + return Integer.MAX_VALUE; + } + + /** Whether the scanner buffer can grow to accommodate a larger token. */ + private boolean zzCanGrow() { + return true; + } + + /** + * Translates raw input code points to DFA table row + */ + private static int zzCMap(int input) { + int offset = input & 255; + return offset == input ? ZZ_CMAP_BLOCKS[offset] : ZZ_CMAP_BLOCKS[ZZ_CMAP_TOP[input >> 8] | offset]; + } + + /** + * Refills the input buffer. + * + * @return {@code false} iff there was new input. + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + zzEndRead += zzFinalHighSurrogate; + zzFinalHighSurrogate = 0; + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead - zzStartRead); + + /* translate stored positions */ + zzEndRead -= zzStartRead; + zzCurrentPos -= zzStartRead; + zzMarkedPos -= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length - zzFinalHighSurrogate && zzCanGrow()) { + /* if not, and it can grow: blow it up */ + char newBuffer[] = new char[Math.min(zzBuffer.length * 2, zzMaxBufferLen())]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + zzEndRead += zzFinalHighSurrogate; + zzFinalHighSurrogate = 0; + } + + /* fill the buffer with new input */ + int requested = zzBuffer.length - zzEndRead; + int numRead = zzReader.read(zzBuffer, zzEndRead, requested); + + /* not supposed to occur according to specification of java.io.Reader */ + if (numRead == 0) { + if (requested == 0) { + throw new java.io.EOFException("Scan buffer limit reached ["+zzBuffer.length+"]"); + } + else { + throw new java.io.IOException( + "Reader returned 0 characters. See JFlex examples/zero-reader for a workaround."); + } + } + if (numRead > 0) { + zzEndRead += numRead; + if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) { + if (numRead == requested) { // We requested too few chars to encode a full Unicode character + --zzEndRead; + zzFinalHighSurrogate = 1; + } else { // There is room in the buffer for at least one more char + int c = zzReader.read(); // Expecting to read a paired low surrogate char + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char)c; + } + } + } + /* potentially more input available */ + return false; + } + + /* numRead < 0 ==> end of stream */ + return true; + } + + + /** + * Closes the input reader. + * + * @throws java.io.IOException if the reader could not be closed. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; // indicate end of file + zzEndRead = zzStartRead; // invalidate buffer + + if (zzReader != null) { + zzReader.close(); + } + } + + + /** + * Resets the scanner to read from a new input stream. + * + *
Does not close the old reader. + * + *
All internal variables are reset, the old input stream cannot be reused (internal + * buffer is discarded and lost). Lexical state is set to {@code ZZ_INITIAL}. + * + *
Internal scan buffer is resized down to its initial length, if it has grown. + * + * @param reader The new input stream. + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzEOFDone = false; + yyResetPosition(); + zzLexicalState = YYINITIAL; + int initBufferSize = Math.min(ZZ_BUFFERSIZE, zzMaxBufferLen()); + if (zzBuffer.length > initBufferSize) { + zzBuffer = new char[initBufferSize]; + } + } + + /** + * Resets the input position. + */ + private final void yyResetPosition() { + zzAtBOL = true; + zzAtEOF = false; + zzCurrentPos = 0; + zzMarkedPos = 0; + zzStartRead = 0; + zzEndRead = 0; + zzFinalHighSurrogate = 0; + yyline = 0; + yycolumn = 0; + yychar = 0L; + } + + + /** + * Returns whether the scanner has reached the end of the reader it reads from. + * + * @return whether the scanner has reached EOF. + */ + public final boolean yyatEOF() { + return zzAtEOF; + } + + + /** + * Returns the current lexical state. + * + * @return the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state. + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + * + * @return the matched text. + */ + public final String yytext() { + return new String(zzBuffer, zzStartRead, zzMarkedPos-zzStartRead); + } + + + /** + * Returns the character at the given position from the matched text. + * + *
It is equivalent to {@code yytext().charAt(pos)}, but faster. + * + * @param position the position of the character to fetch. A value from 0 to {@code yylength()-1}. + * + * @return the character at {@code position}. + */ + public final char yycharat(int position) { + return zzBuffer[zzStartRead + position]; + } + + + /** + * How many characters were matched. + * + * @return the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occurred while scanning. + * + *
In a well-formed scanner (no or only correct usage of {@code yypushback(int)} and a + * match-all fallback rule) this method will only be called with things that + * "Can't Possibly Happen". + * + *
If this method is called, something is seriously wrong (e.g. a JFlex bug producing a faulty + * scanner etc.). + * + *
Usual syntax/scanner level error handling should be done in error fallback rules. + * + * @param errorCode the code of the error message to display. + */ + private static void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + *
They will be read again by then next call of the scanning method.
+ *
+ * @param number the number of characters to be read again. This number must not be greater than
+ * {@link #yylength()}.
+ */
+ public void yypushback(int number) {
+ if ( number > yylength() )
+ zzScanError(ZZ_PUSHBACK_2BIG);
+
+ zzMarkedPos -= number;
+ }
+
+
+ /**
+ * Contains user EOF-code, which will be executed exactly once,
+ * when the end of file is reached
+ */
+ private void zzDoEOF() {
+ if (!zzEOFDone) {
+ zzEOFDone = true;
+
+ }
+ }
+
+
+
+
+ /**
+ * Resumes scanning until the next regular expression is matched, the end of input is encountered
+ * or an I/O-Error occurs.
+ *
+ * @return the next token.
+ * @exception java.io.IOException if any I/O-Error occurs.
+ */
+ public IElementType advance() throws java.io.IOException
+ {
+ int zzInput;
+ int zzAction;
+
+ // cached fields:
+ int zzCurrentPosL;
+ int zzMarkedPosL;
+ int zzEndReadL = zzEndRead;
+ char[] zzBufferL = zzBuffer;
+
+ int [] zzTransL = ZZ_TRANS;
+ int [] zzRowMapL = ZZ_ROWMAP;
+ int [] zzAttrL = ZZ_ATTRIBUTE;
+
+ while (true) {
+ zzMarkedPosL = zzMarkedPos;
+
+ zzAction = -1;
+
+ zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
+
+ zzState = ZZ_LEXSTATE[zzLexicalState];
+
+ // set up zzAction for empty match case:
+ int zzAttributes = zzAttrL[zzState];
+ if ( (zzAttributes & 1) == 1 ) {
+ zzAction = zzState;
+ }
+
+
+ zzForAction: {
+ while (true) {
+
+ if (zzCurrentPosL < zzEndReadL) {
+ zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL);
+ zzCurrentPosL += Character.charCount(zzInput);
+ }
+ else if (zzAtEOF) {
+ zzInput = YYEOF;
+ break zzForAction;
+ }
+ else {
+ // store back cached positions
+ zzCurrentPos = zzCurrentPosL;
+ zzMarkedPos = zzMarkedPosL;
+ boolean eof = zzRefill();
+ // get translated positions and possibly new buffer
+ zzCurrentPosL = zzCurrentPos;
+ zzMarkedPosL = zzMarkedPos;
+ zzBufferL = zzBuffer;
+ zzEndReadL = zzEndRead;
+ if (eof) {
+ zzInput = YYEOF;
+ break zzForAction;
+ }
+ else {
+ zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL);
+ zzCurrentPosL += Character.charCount(zzInput);
+ }
+ }
+ int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMap(zzInput) ];
+ if (zzNext == -1) break zzForAction;
+ zzState = zzNext;
+
+ zzAttributes = zzAttrL[zzState];
+ if ( (zzAttributes & 1) == 1 ) {
+ zzAction = zzState;
+ zzMarkedPosL = zzCurrentPosL;
+ if ( (zzAttributes & 8) == 8 ) break zzForAction;
+ }
+
+ }
+ }
+
+ // store back cached position
+ zzMarkedPos = zzMarkedPosL;
+
+ if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
+ zzAtEOF = true;
+ zzDoEOF();
+ return null;
+ }
+ else {
+ switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
+ case 1:
+ { return TokenType.BAD_CHARACTER;
+ }
+ // fall through
+ case 22: break;
+ case 2:
+ { return TokenType.WHITE_SPACE;
+ }
+ // fall through
+ case 23: break;
+ case 3:
+ { return PineScriptTokenTypes.OPERATOR;
+ }
+ // fall through
+ case 24: break;
+ case 4:
+ { return PineScriptTokenTypes.LPAREN;
+ }
+ // fall through
+ case 25: break;
+ case 5:
+ { return PineScriptTokenTypes.RPAREN;
+ }
+ // fall through
+ case 26: break;
+ case 6:
+ { return PineScriptTokenTypes.COMMA;
+ }
+ // fall through
+ case 27: break;
+ case 7:
+ { return PineScriptTokenTypes.DOT;
+ }
+ // fall through
+ case 28: break;
+ case 8:
+ { return PineScriptTokenTypes.NUMBER;
+ }
+ // fall through
+ case 29: break;
+ case 9:
+ { return PineScriptTokenTypes.SEMICOLON;
+ }
+ // fall through
+ case 30: break;
+ case 10:
+ { return PineScriptTokenTypes.IDENTIFIER;
+ }
+ // fall through
+ case 31: break;
+ case 11:
+ { return PineScriptTokenTypes.LBRACKET;
+ }
+ // fall through
+ case 32: break;
+ case 12:
+ { return PineScriptTokenTypes.RBRACKET;
+ }
+ // fall through
+ case 33: break;
+ case 13:
+ { return PineScriptTokenTypes.LBRACE;
+ }
+ // fall through
+ case 34: break;
+ case 14:
+ { return PineScriptTokenTypes.RBRACE;
+ }
+ // fall through
+ case 35: break;
+ case 15:
+ { return PineScriptTokenTypes.STRING;
+ }
+ // fall through
+ case 36: break;
+ case 16:
+ { return PineScriptTokenTypes.COMMENT;
+ }
+ // fall through
+ case 37: break;
+ case 17:
+ { return PineScriptTokenTypes.FUNCTION;
+ }
+ // fall through
+ case 38: break;
+ case 18:
+ { return PineScriptTokenTypes.KEYWORD;
+ }
+ // fall through
+ case 39: break;
+ case 19:
+ { return PineScriptTokenTypes.NAMESPACE;
+ }
+ // fall through
+ case 40: break;
+ case 20:
+ { return PineScriptTokenTypes.TYPE;
+ }
+ // fall through
+ case 41: break;
+ case 21:
+ { return PineScriptTokenTypes.BUILT_IN_VARIABLE;
+ }
+ // fall through
+ case 42: break;
+ default:
+ zzScanError(ZZ_NO_MATCH);
+ }
+ }
+ }
+ }
+
+
+}
diff --git a/pine-script-intellij-plugin/bin/main/com/pinescript/resources/schemes/PineScriptScheme.xml b/pine-script-intellij-plugin/bin/main/com/pinescript/resources/schemes/PineScriptScheme.xml
new file mode 100644
index 0000000..f2cc47b
--- /dev/null
+++ b/pine-script-intellij-plugin/bin/main/com/pinescript/resources/schemes/PineScriptScheme.xml
@@ -0,0 +1,5 @@
+accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
accdist
bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)bar_index
//@version=5
indicator(\"bar_index\")
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
ask
with class 'tv-pine-reference-item__syntax with-overloads selected' first
+ syntax_div = info_div.find('pre', class_='tv-pine-reference-item__syntax with-overloads selected')
+ if not syntax_div:
+ syntax_div = info_div.find('pre', class_='tv-pine-reference-item__syntax selected')
+ if syntax_div:
+ syntax_text = syntax_div.get_text(strip=True)
+ details["syntax"] = syntax_text
+ if '→' in syntax_text:
+ details["returnType"] = syntax_text.split('→')[-1].strip()
+
+ # Extract arguments: find all elements with class 'tv-pine-reference-item__arg-type'
+ arg_spans = info_div.find_all('span', class_='tv-pine-reference-item__arg-type')
+ for span in arg_spans:
+ text = span.get_text(strip=True)
+ if '(' in text:
+ arg_name, arg_type = text.split('(', 1)
+ arg_name = arg_name.strip()
+ arg_type = arg_type.replace(')', '').strip()
+ else:
+ arg_name = text
+ arg_type = ""
+ details["arguments"].append({"argument": arg_name, "type": arg_type})
+
+ # Extract returns: find the with class 'tv-pine-reference-item__syntax with-overloads selected' first
syntax_div = info_div.find('pre', class_='tv-pine-reference-item__syntax with-overloads selected')
@@ -97,14 +97,14 @@ def extract_variable_details(html: str, fragment: str) -> dict:
# Extract description: first adjustment.dividends
adjustment.none
adjustment.splits
style parameter in the plot function.",
+ "type": "const integer",
+ "remarks": ""
+ },
+ {
+ "name": "areabr",
+ "url": "https://www.tradingview.com/pine-script-reference/v3/#const_areabr",
+ "fragment": "const_areabr",
+ "info": "style parameter in the plot function. Similar to area, except the gaps in the data are not filled.",
+ "type": "const integer",
+ "remarks": ""
+ },
+ {
+ "name": "barmerge.gaps_off",
+ "url": "https://www.tradingview.com/pine-script-reference/v3/#const_barmerge.gaps_off",
+ "fragment": "const_barmerge.gaps_off",
+ "info": "barmerge.gaps_off
barmerge.gaps_on
barmerge.lookahead_off
barmerge.lookahead_on
style parameter in the plot function.",
+ "type": "const integer",
+ "remarks": ""
+ },
+ {
+ "name": "columns",
+ "url": "https://www.tradingview.com/pine-script-reference/v3/#const_columns",
+ "fragment": "const_columns",
+ "info": "style parameter in the plot function.",
+ "type": "const integer",
+ "remarks": ""
+ },
+ {
+ "name": "cross",
+ "url": "https://www.tradingview.com/pine-script-reference/v3/#const_cross",
+ "fragment": "const_cross",
+ "info": "style parameter in the plot function.",
+ "type": "const integer",
+ "remarks": ""
+ },
+ {
+ "name": "currency.AUD",
+ "url": "https://www.tradingview.com/pine-script-reference/v3/#const_currency.AUD",
+ "fragment": "const_currency.AUD",
+ "info": "style parameter in the plot function.",
+ "type": "const integer",
+ "remarks": ""
+ },
+ {
+ "name": "integer",
+ "url": "https://www.tradingview.com/pine-script-reference/v3/#const_integer",
+ "fragment": "const_integer",
+ "info": "style parameter in the plot function.",
+ "type": "const integer",
+ "remarks": ""
+ },
+ {
+ "name": "linebr",
+ "url": "https://www.tradingview.com/pine-script-reference/v3/#const_linebr",
+ "fragment": "const_linebr",
+ "info": "style parameter in the plot function. Similar to line, except the gaps in the data are not filled.",
+ "type": "const integer",
+ "remarks": ""
+ },
+ {
+ "name": "location.abovebar",
+ "url": "https://www.tradingview.com/pine-script-reference/v3/#const_location.abovebar",
+ "fragment": "const_location.abovebar",
+ "info": "location.abovebar
location.belowbar
location.bottom
location.top
session.extended
session.regular
size.huge
size.large
size.normal
size.small
size.tiny
style parameter in the plot function.",
+ "type": "const integer",
+ "remarks": ""
+ },
+ {
+ "name": "strategy.cash",
+ "url": "https://www.tradingview.com/pine-script-reference/v3/#const_strategy.cash",
+ "fragment": "const_strategy.cash",
+ "info": "strategy.cash
strategy.commission.cash_per_contract
strategy.commission.cash_per_order
strategy.commission.percent
strategy.direction.all
strategy.direction.long
strategy.direction.short
strategy.fixed
strategy.oca.cancel
strategy.oca.none
strategy.oca.reduce
strategy.percent_of_equity
abs()
abs(x) \u2192 integer
abs(x) \u2192 const integer
abs(x) \u2192 float
abs(x) \u2192 const float
abs(x) \u2192 series
acos()
acos(x) \u2192 float
acos(x) \u2192 const float
acos(x) \u2192 series
alertcondition()
alertcondition(condition, title, message) \u2192 void
alertcondition(close\u00a0>=\u00a0open,\u00a0title='Alert\u00a0on\u00a0Green\u00a0Bar',\u00a0message='Green\u00a0Bar!')alma()
alma(series, length, offset, sigma) \u2192 series
plot(alma(close,\u00a09,\u00a00.85,\u00a06))
//\u00a0same\u00a0on\u00a0pine,\u00a0but\u00a0much\u00a0less\u00a0efficient
pine_alma(series,\u00a0windowsize,\u00a0offset,\u00a0sigma)\u00a0=>
\u00a0\u00a0\u00a0\u00a0m\u00a0=\u00a0floor(offset\u00a0*\u00a0(windowsize\u00a0-\u00a01))
\u00a0\u00a0\u00a0\u00a0s\u00a0=\u00a0windowsize\u00a0/\u00a0sigma
\u00a0\u00a0\u00a0\u00a0norm\u00a0=\u00a00.0
\u00a0\u00a0\u00a0\u00a0sum\u00a0=\u00a00.0
\u00a0\u00a0\u00a0\u00a0for\u00a0i\u00a0=\u00a00\u00a0to\u00a0windowsize\u00a0-\u00a01
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0weight\u00a0=\u00a0exp(-1\u00a0*\u00a0pow(i\u00a0-\u00a0m,\u00a02)\u00a0/\u00a0(2\u00a0*\u00a0pow(s,\u00a02)))
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0norm\u00a0:=\u00a0norm\u00a0+\u00a0weight
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0sum\u00a0:=\u00a0sum\u00a0+\u00a0series[windowsize\u00a0-\u00a0i\u00a0-\u00a01]\u00a0*\u00a0weight
\u00a0\u00a0\u00a0\u00a0sum\u00a0/\u00a0norm
plot(pine_alma(close,\u00a09,\u00a00.85,\u00a06))asin()
asin(x) \u2192 float
asin(x) \u2192 const float
asin(x) \u2192 series
atan()
atan(x) \u2192 float
atan(x) \u2192 const float
atan(x) \u2192 series
atr()
atr(length) \u2192 series
plot(atr(14))
//the\u00a0same\u00a0on\u00a0pine
pine_atr(length)\u00a0=>
\u00a0\u00a0\u00a0\u00a0trueRange\u00a0=\u00a0na(high[1])?\u00a0high-low\u00a0:\u00a0max(max(high\u00a0-\u00a0low,\u00a0abs(high\u00a0-\u00a0close[1])),\u00a0abs(low\u00a0-\u00a0close[1]))
\u00a0\u00a0\u00a0\u00a0//true\u00a0range\u00a0can\u00a0be\u00a0also\u00a0calculated\u00a0with\u00a0tr(true)
\u00a0\u00a0\u00a0\u00a0rma(trueRange,\u00a0length)
plot(pine_atr(14))barcolor()
barcolor(color, offset, editable, show_last, title) \u2192 void
barcolor(close\u00a0<\u00a0open\u00a0?\u00a0black\u00a0:\u00a0white)barssince()
barssince(condition) \u2192 series[integer]
//\u00a0get\u00a0number\u00a0of\u00a0bars\u00a0since\u00a0last\u00a0green\u00a0bar
barssince(close\u00a0>=\u00a0open)bgcolor()
bgcolor(color, transp, offset, editable, show_last, title) \u2192 void
bgcolor(close\u00a0<\u00a0open\u00a0?\u00a0red\u00a0:\u00a0green,\u00a0transp=70)cci()
cci(source, length) \u2192 series
cog()
cog(source, length) \u2192 series
plot(cog(close,\u00a010))
//\u00a0the\u00a0same\u00a0on\u00a0pine
pine_cog(source,\u00a0length)\u00a0=>
\u00a0\u00a0\u00a0\u00a0sum\u00a0=\u00a0sum(source,\u00a0length)
\u00a0\u00a0\u00a0\u00a0num\u00a0=\u00a00.0
\u00a0\u00a0\u00a0\u00a0for\u00a0i\u00a0=\u00a00\u00a0to\u00a0length\u00a0-\u00a01
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0price\u00a0=\u00a0source[i]
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0num\u00a0:=\u00a0num\u00a0+\u00a0price\u00a0*\u00a0(i\u00a0+\u00a01)
\u00a0\u00a0\u00a0\u00a0-num\u00a0/\u00a0sum
plot(pine_cog(close,\u00a010))color()
color(color, transp) \u2192 color
color(red,\u00a050)correlation()
correlation(source_a, source_b, length) \u2192 series
cos()
cos(x) \u2192 float
cos(x) \u2192 const float
cos(x) \u2192 series
crossover()
x-series is defined as having crossed over y-series if the value of x is greater than the value of y and the value of x was less than the value of y on the bar immediately preceding the current bar.crossover(x, y) \u2192 series[bool]
x.y.x-series is defined as having crossed over y-series if the value of x is greater than the value of y and the value of x was less than the value of y on the bar immediately preceding the current bar.",
+ "arguments": [
+ {
+ "argument": "x",
+ "type": "float"
+ },
+ {
+ "argument": "y",
+ "type": "float"
+ }
+ ],
+ "syntax": "crossover(x, y) \u2192 series[bool]",
+ "returnType": "series[bool]",
+ "returns": ""
+ },
+ {
+ "name": "crossunder()",
+ "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_crossunder",
+ "fragment": "fun_crossunder",
+ "info": "crossunder()
x-series is defined as having crossed under y-series if the value of x is less than the value of y and the value of x was greater than the value of y on the bar immediately preceding the current bar.crossunder(x, y) \u2192 series[bool]
x.y.x-series is defined as having crossed under y-series if the value of x is less than the value of y and the value of x was greater than the value of y on the bar immediately preceding the current bar.",
+ "arguments": [
+ {
+ "argument": "x",
+ "type": "float"
+ },
+ {
+ "argument": "y",
+ "type": "float"
+ }
+ ],
+ "syntax": "crossunder(x, y) \u2192 series[bool]",
+ "returnType": "series[bool]",
+ "returns": ""
+ },
+ {
+ "name": "cum()",
+ "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_cum",
+ "fragment": "fun_cum",
+ "info": "cum()
cum(x) \u2192 series
dev()
dev(source, length) \u2192 series
plot(dev(close,\u00a010))
//\u00a0the\u00a0same\u00a0on\u00a0pine
pine_dev(source,\u00a0length)\u00a0=>
\u00a0\u00a0\u00a0\u00a0mean\u00a0=\u00a0sma(source,\u00a0length)
\u00a0\u00a0\u00a0\u00a0sum\u00a0=\u00a00.0
\u00a0\u00a0\u00a0\u00a0for\u00a0i\u00a0=\u00a00\u00a0to\u00a0length\u00a0-\u00a01
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val\u00a0=\u00a0source[i]
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0sum\u00a0:=\u00a0sum\u00a0+\u00a0abs(val\u00a0-\u00a0mean)
\u00a0\u00a0\u00a0\u00a0dev\u00a0=\u00a0sum/length
plot(pine_dev(close,\u00a010))ema()
ema(source, length) \u2192 series
plot(ema(close,\u00a015))
//the\u00a0same\u00a0on\u00a0pine
pine_ema(src,\u00a0length)\u00a0=>
\u00a0\u00a0\u00a0\u00a0alpha\u00a0=\u00a02\u00a0/\u00a0(length\u00a0+\u00a01)
\u00a0\u00a0\u00a0\u00a0sum\u00a0=\u00a00.0
\u00a0\u00a0\u00a0\u00a0sum\u00a0:=\u00a0na(sum[1])\u00a0?\u00a0sma(src,\u00a0length)\u00a0:\u00a0alpha\u00a0*\u00a0src\u00a0+\u00a0(1\u00a0-\u00a0alpha)\u00a0*\u00a0nz(sum[1])
plot(pine_ema(close,15))exp()
exp(x) \u2192 float
exp(x) \u2192 const float
exp(x) \u2192 series
falling()
falling(source, length) \u2192 series[bool]
fill()
fill(hline1, hline2, color, transp, title, editable) \u2192 void
fill(plot1, plot2, color, transp, title, editable, show_last) \u2192 void
h1\u00a0=\u00a0hline(20)
h2\u00a0=\u00a0hline(10)
fill(h1,\u00a0h2)
p1\u00a0=\u00a0plot(open)
p2\u00a0=\u00a0plot(close)
fill(p1,\u00a0p2,\u00a0color=green)heikinashi()
heikinashi(symbol) \u2192 string
heikinashi_close\u00a0=\u00a0security(heikinashi(tickerid),\u00a0period,\u00a0close)
heikinashi_aapl_60_close\u00a0=\u00a0security(heikinashi(\"AAPL\"),\u00a0\"60\",\u00a0close)highest()
highest(source, length) \u2192 series
highest(length) \u2192 series
highestbars()
highestbars(source, length) \u2192 series[integer]
highestbars(length) \u2192 series[integer]
hline()
hline(price, title, color, linestyle, linewidth, editable) \u2192 hline
hline(3.14,\u00a0title='Pi',\u00a0color=blue,\u00a0linestyle=dotted,\u00a0linewidth=2)
//\u00a0You\u00a0may\u00a0fill\u00a0the\u00a0background\u00a0between\u00a0any\u00a0two\u00a0hlines\u00a0with\u00a0a\u00a0fill()\u00a0function:
h1\u00a0=\u00a0hline(20)
h2\u00a0=\u00a0hline(10)
fill(h1,\u00a0h2)iff()
iff(condition, then, _else) \u2192 bool
iff(condition, then, _else) \u2192 integer
iff(condition, then, _else) \u2192 float
iff(condition, then, _else) \u2192 color
iff(condition, then, _else) \u2192 series
iff(condition, then, _else) \u2192 series[integer]
iff(condition, then, _else) \u2192 series[color]
iff(condition, then, _else) \u2192 string
iff(condition, then, _else) \u2192 const bool
iff(condition, then, _else) \u2192 const integer
iff(condition, then, _else) \u2192 const float
iff(condition, then, _else) \u2192 const string
iff(condition, then, _else) \u2192 const color
iff(condition, then, _else) \u2192 series[bool]
_else argument if you do not need 'else' branch.//\u00a0Draw\u00a0circles\u00a0at\u00a0the\u00a0bars\u00a0where\u00a0open\u00a0crosses\u00a0close
s1\u00a0=\u00a0iff(cross(open,\u00a0close),\u00a0avg(open,close),\u00a0na)
plot(s1,\u00a0style=circles,\u00a0linewidth=4,\u00a0color=green)input()
input(defval, title, type, confirm) \u2192 bool
input(defval, title, type, minval, maxval, confirm, step, options) \u2192 integer
input(defval, title, type, minval, maxval, confirm, step, options) \u2192 float
input(defval, title, type, confirm, options) \u2192 string
input(defval, title, type) \u2192 series
b\u00a0=\u00a0input(title=\"On/Off\",\u00a0type=bool,\u00a0defval=true)
plot(b\u00a0?\u00a0open\u00a0:\u00a0na)
i\u00a0=\u00a0input(title=\"Offset\",\u00a0type=integer,\u00a0defval=7,\u00a0minval=-10,\u00a0maxval=10)
plot(offset(close,\u00a0i))
f\u00a0=\u00a0input(title=\"Angle\",\u00a0type=float,\u00a0defval=-0.5,\u00a0minval=-3.14,\u00a0maxval=3.14,\u00a0step=0.02)
plot(sin(f)\u00a0>\u00a00\u00a0?\u00a0close\u00a0:\u00a0open)
sym\u00a0=\u00a0input(title=\"Symbol\",\u00a0type=symbol,\u00a0defval=\"DELL\")
res\u00a0=\u00a0input(title=\"Resolution\",\u00a0type=resolution,\u00a0defval=\"60\")
plot(close,\u00a0color=red)
plot(security(sym,\u00a0res,\u00a0close),\u00a0color=green)
s\u00a0=\u00a0input(title=\"Session\",\u00a0defval=\"24x7\",\u00a0options=[\"24x7\",\u00a0\"0900-1300\",\u00a0\"1300-1700\",\u00a0\"1700-2100\"])
plot(time(period,\u00a0s))
src\u00a0=\u00a0input(title=\"Source\",\u00a0type=source,\u00a0defval=close)
plot(src)kagi()
kagi(symbol, source, reversal) \u2192 string
kagi(symbol, reversal) \u2192 string
kagi_tickerid\u00a0=\u00a0kagi(tickerid,\u00a03)
kagi_close\u00a0=\u00a0security(kagi_tickerid,\u00a0period,\u00a0close)
plot(kagi_close)linebreak()
linebreak(symbol, source, number_of_lines) \u2192 string
linebreak(symbol, number_of_lines) \u2192 string
linebreak_tickerid\u00a0=\u00a0linebreak(tickerid,\u00a03)
linebreak_close\u00a0=\u00a0security(linebreak_tickerid,\u00a0period,\u00a0close)
plot(linebreak_close)linreg()
linreg(source, length, offset) \u2192 series
log()
y such that e^y = xlog(x) \u2192 float
log(x) \u2192 const float
log(x) \u2192 series
y such that e^y = x",
+ "arguments": [],
+ "syntax": "log(x) \u2192 float",
+ "returnType": "float",
+ "returns": ""
+ },
+ {
+ "name": "log10()",
+ "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_log10",
+ "fragment": "fun_log10",
+ "info": "log10()
y such that 10^y = xlog10(x) \u2192 float
log10(x) \u2192 const float
log10(x) \u2192 series
y such that 10^y = x",
+ "arguments": [],
+ "syntax": "log10(x) \u2192 float",
+ "returnType": "float",
+ "returns": ""
+ },
+ {
+ "name": "lowest()",
+ "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_lowest",
+ "fragment": "fun_lowest",
+ "info": "lowest()
lowest(source, length) \u2192 series
lowest(length) \u2192 series
lowestbars()
lowestbars(source, length) \u2192 series[integer]
lowestbars(length) \u2192 series[integer]
macd()
macd(source, fastlen, slowlen, siglen) \u2192 [series, series, series]
//\u00a0Example\u00a01
study('MACD')
[macdLine,\u00a0signalLine,\u00a0histLine]\u00a0=\u00a0macd(close,\u00a012,\u00a026,\u00a09)
plot(macdLine,\u00a0color=blue)
plot(signalLine,\u00a0color=orange)
plot(histLine,\u00a0color=red,\u00a0style=histogram)
//\u00a0Example\u00a02
//\u00a0If\u00a0you\u00a0need\u00a0only\u00a0one\u00a0value,\u00a0use\u00a0placeholders\u00a0'_'\u00a0like\u00a0this:
study('MACD')
[_,\u00a0signalLine,\u00a0_]\u00a0=\u00a0macd(close,\u00a012,\u00a026,\u00a09)
plot(signalLine,\u00a0color=orange)max()
max(x, y) \u2192 const integer
max(x, y) \u2192 integer
max(x, y) \u2192 series[integer]
max(x, y) \u2192 const float
max(x, y) \u2192 float
max(x, y) \u2192 series
max(close,\u00a0open)
max(close,\u00a0max(open,\u00a042))min()
min(x, y) \u2192 const integer
min(x, y) \u2192 integer
min(x, y) \u2192 series[integer]
min(x, y) \u2192 const float
min(x, y) \u2192 float
min(x, y) \u2192 series
min(close,\u00a0open)
min(close,\u00a0min(open,\u00a042))mom()
mom(source, length) \u2192 series
nz()
nz(x, y) \u2192 integer
nz(x, y) \u2192 float
nz(x, y) \u2192 color
nz(x, y) \u2192 bool
nz(x, y) \u2192 series[integer]
nz(x, y) \u2192 series[bool]
nz(x, y) \u2192 series[color]
nz(x, y) \u2192 series
nz(x) \u2192 color
nz(x) \u2192 bool
nz(x) \u2192 integer
nz(x) \u2192 float
nz(x) \u2192 series[integer]
nz(x) \u2192 series[bool]
nz(x) \u2192 series[color]
nz(x) \u2192 series
nz(sma(close,\u00a0100))offset()
offset(source, offset) \u2192 series[bool]
offset(source, offset) \u2192 series[color]
offset(source, offset) \u2192 series[integer]
offset(source, offset) \u2192 series
percentile_linear_interpolation()
percentile_linear_interpolation(source, length, percentage) \u2192 series
percentile_nearest_rank()
percentile_nearest_rank(source, length, percentage) \u2192 series
percentrank()
percentrank(source, length) \u2192 series
pivothigh()
pivothigh(source, leftbars, rightbars) \u2192 series
pivothigh(leftbars, rightbars) \u2192 series
study(\"PivotHigh\",\u00a0overlay=true)
leftBars\u00a0=\u00a0input(2)
rightBars=input(2)
ph\u00a0=\u00a0pivothigh(leftBars,\u00a0rightBars)
plot(ph,\u00a0style=cross,\u00a0linewidth=3,\u00a0color=\u00a0red,\u00a0offset=-rightBars)pivotlow()
pivotlow(source, leftbars, rightbars) \u2192 series
pivotlow(leftbars, rightbars) \u2192 series
study(\"PivotLow\",\u00a0overlay=true)
leftBars\u00a0=\u00a0input(2)
rightBars=input(2)
pl\u00a0=\u00a0pivotlow(close,\u00a0leftBars,\u00a0rightBars)
plot(pl,\u00a0style=cross,\u00a0linewidth=3,\u00a0color=\u00a0blue,\u00a0offset=-rightBars)plot()
plot(series, title, color, linewidth, style, trackprice, transp, histbase, offset, join, editable, show_last) \u2192 plot
plot(high+low,\u00a0title='Title',\u00a0color=#00ffaa,\u00a0linewidth=2,\u00a0style=area,\u00a0transp=70,\u00a0offset=15,\u00a0trackprice=true)
//\u00a0You\u00a0may\u00a0fill\u00a0the\u00a0background\u00a0between\u00a0any\u00a0two\u00a0plots\u00a0with\u00a0a\u00a0fill()\u00a0function:
p1\u00a0=\u00a0plot(open)
p2\u00a0=\u00a0plot(close)
fill(p1,\u00a0p2,\u00a0color=green)plotarrow()
plotarrow(series, title, colorup, colordown, transp, offset, minheight, maxheight, editable, show_last) \u2192 void
study(\"plotarrow\u00a0example\",\u00a0overlay=true)
codiff\u00a0=\u00a0close\u00a0-\u00a0open
plotarrow(codiff,\u00a0colorup=teal,\u00a0colordown=orange,\u00a0transp=40)plotbar()
plotbar(open, high, low, close, title, color, editable, show_last) \u2192 void
plotbar(open,\u00a0high,\u00a0low,\u00a0close,\u00a0title='Title',\u00a0color\u00a0=\u00a0open\u00a0<\u00a0close\u00a0?\u00a0green\u00a0:\u00a0red)plotcandle()
plotcandle(open, high, low, close, title, color, wickcolor, editable, show_last, bordercolor) \u2192 void
plotcandle(open,\u00a0high,\u00a0low,\u00a0close,\u00a0title='Title',\u00a0color\u00a0=\u00a0open\u00a0<\u00a0close\u00a0?\u00a0green\u00a0:\u00a0red,\u00a0wickcolor=black)plotchar()
plotchar(series, title, char, location, color, transp, offset, text, textcolor, editable, size, show_last) \u2192 void
study('plotchar\u00a0example',\u00a0overlay=true)
data\u00a0=\u00a0close\u00a0>=\u00a0open
plotchar(data,\u00a0char='\u2744')plotshape()
plotshape(series, title, style, location, color, transp, offset, text, textcolor, editable, size, show_last) \u2192 void
study('plotshape\u00a0example\u00a01',\u00a0overlay=true)
data\u00a0=\u00a0close\u00a0>=\u00a0open
plotshape(data,\u00a0style=shape.xcross)pointfigure()
pointfigure(symbol, source, style, param, reversal) \u2192 string
style is equal to 'ATR', or Box Size if style is equal to 'Traditional'.pnf_tickerid\u00a0=\u00a0pointfigure(tickerid,\u00a0\"hl\",\u00a0\"Traditional\",\u00a01,\u00a03)
pnf_close\u00a0=\u00a0security(pnf_tickerid,\u00a0period,\u00a0close)
plot(pnf_close)renko()
renko(symbol, source, style, param) \u2192 string
renko(symbol, style, param) \u2192 string
style is equal to 'ATR', or Box Size if style is equal to 'Traditional'.renko_tickerid\u00a0=\u00a0renko(tickerid,\u00a0\"ATR\",\u00a010)
renko_close\u00a0=\u00a0security(renko_tickerid,\u00a0period,\u00a0close)
plot(renko_close)rising()
rising(source, length) \u2192 series[bool]
rma()
rma(source, length) \u2192 series
plot(rma(close,\u00a015))
//the\u00a0same\u00a0on\u00a0pine
pine_rma(src,\u00a0length)\u00a0=>
\u00a0\u00a0\u00a0\u00a0alpha\u00a0=\u00a0length
\u00a0\u00a0\u00a0\u00a0sum\u00a0=\u00a00.0
\u00a0\u00a0\u00a0\u00a0sum\u00a0:=\u00a0na(sum[1])\u00a0?\u00a0sma(src,\u00a0length)\u00a0:\u00a0(src\u00a0+\u00a0(alpha\u00a0-\u00a01)\u00a0*\u00a0nz(sum[1]))\u00a0/\u00a0alpha
plot(pine_rma(close,\u00a015))roc()
roc(source, length) \u2192 series
rsi()
rsi(x, y) \u2192 series
plot(rsi(close,\u00a07))
//\u00a0same\u00a0on\u00a0pine,\u00a0but\u00a0less\u00a0efficient
pine_rsi(x,\u00a0y)\u00a0=>\u00a0
\u00a0\u00a0\u00a0\u00a0u\u00a0=\u00a0max(x\u00a0-\u00a0x[1],\u00a00)\u00a0//\u00a0upward\u00a0change
\u00a0\u00a0\u00a0\u00a0d\u00a0=\u00a0max(x[1]\u00a0-\u00a0x,\u00a00)\u00a0//\u00a0downward\u00a0change
\u00a0\u00a0\u00a0\u00a0rs\u00a0=\u00a0rma(u,\u00a0y)\u00a0/\u00a0rma(d,\u00a0y)
\u00a0\u00a0\u00a0\u00a0res\u00a0=\u00a0100\u00a0-\u00a0100\u00a0/\u00a0(1\u00a0+\u00a0rs)
\u00a0\u00a0\u00a0\u00a0res
plot(pine_rsi(close,\u00a07))sar()
sar(start, inc, max) \u2192 series
plot(sar(0.2,\u00a00.2,\u00a0.2),\u00a0style=cross,\u00a0linewidth=3)security()
security(symbol, resolution, expression, gaps, lookahead) \u2192 series[integer]
security(symbol, resolution, expression, gaps, lookahead) \u2192 series
security(symbol, resolution, expression, gaps, lookahead) \u2192 series[bool]
security(symbol, resolution, expression, gaps, lookahead) \u2192 series[color]
s\u00a0=\u00a0security(\"MSFT\",\u00a0\"D\",\u00a0close)\u00a0//\u00a01\u00a0Day
plot(s)
expr\u00a0=\u00a0sma(close,\u00a010)
s1\u00a0=\u00a0security(\"AAPL\",\u00a0\"240\",\u00a0expr)\u00a0//\u00a0240\u00a0Minutes
plot(s1)
//\u00a0To\u00a0avoid\u00a0difference\u00a0in\u00a0calculation\u00a0on\u00a0history/realtime\u00a0you\u00a0can\u00a0request\u00a0not\u00a0latest\u00a0values\u00a0and\u00a0use\u00a0merge\u00a0strategy\u00a0flags\u00a0as\u00a0follows:
s2=security(tickerid,\u00a0\"D\",\u00a0close[1],\u00a0barmerge.gaps_off,\u00a0barmerge.lookahead_on)
plot(s2)sign()
sign(x) \u2192 float
sign(x) \u2192 const float
sign(x) \u2192 series
sin()
sin(x) \u2192 float
sin(x) \u2192 const float
sin(x) \u2192 series
sma()
sma(source, length) \u2192 series
plot(sma(close,\u00a015))
//\u00a0same\u00a0on\u00a0pine,\u00a0but\u00a0much\u00a0less\u00a0efficient
pine_sma(x,\u00a0y)\u00a0=>
\u00a0\u00a0\u00a0\u00a0sum\u00a0=\u00a00.0
\u00a0\u00a0\u00a0\u00a0for\u00a0i\u00a0=\u00a00\u00a0to\u00a0y\u00a0-\u00a01
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0sum\u00a0:=\u00a0sum\u00a0+\u00a0x[i]\u00a0/\u00a0y
\u00a0\u00a0\u00a0\u00a0sum
plot(pine_sma(close,\u00a015))sqrt()
sqrt(x) \u2192 float
sqrt(x) \u2192 const float
sqrt(x) \u2192 series
stdev()
stdev(source, length) \u2192 series
plot(stdev(close,\u00a05))
//the\u00a0same\u00a0on\u00a0pine
isZero(val,\u00a0eps)\u00a0=>\u00a0abs(val)\u00a0<=\u00a0eps
SUM(fst,\u00a0snd)\u00a0=>
\u00a0\u00a0\u00a0\u00a0EPS\u00a0=\u00a01e-10
\u00a0\u00a0\u00a0\u00a0res\u00a0=\u00a0fst\u00a0+\u00a0snd
\u00a0\u00a0\u00a0\u00a0if\u00a0isZero(res,\u00a0EPS)
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0res\u00a0:=\u00a00
\u00a0\u00a0\u00a0\u00a0else
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if\u00a0not\u00a0isZero(res,\u00a01e-4)
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0res\u00a0:=\u00a0res
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0else
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a015
pine_stdev(src,\u00a0length)\u00a0=>
\u00a0\u00a0\u00a0\u00a0avg\u00a0=\u00a0sma(src,\u00a0length)
\u00a0\u00a0\u00a0\u00a0sumOfSquareDeviations\u00a0=\u00a00.0
\u00a0\u00a0\u00a0\u00a0for\u00a0i\u00a0=\u00a00\u00a0to\u00a0length\u00a0-\u00a01
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0sum\u00a0=\u00a0SUM(src[i],\u00a0-avg)
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0sumOfSquareDeviations\u00a0:=\u00a0sumOfSquareDeviations\u00a0+\u00a0sum\u00a0*\u00a0sum
\u00a0\u00a0\u00a0\u00a0stdev\u00a0=\u00a0sqrt(sumOfSquareDeviations\u00a0/\u00a0length)
plot(pine_stdev(close,\u00a05))stoch()
stoch(source, high, low, length) \u2192 series
strategy()
strategy(title, shorttitle, overlay, precision, scale, pyramiding, calc_on_order_fills, calc_on_every_tick, max_bars_back, backtest_fill_limits_assumption, default_qty_type, default_qty_value, initial_capital, currency, slippage, commission_type, commission_value) \u2192 void
strategy(title='MyStrategy')
strategy(title=\"MyStrategy\",\u00a0shorttitle=\"MS\",\u00a0pyramiding\u00a0=\u00a010)strategy.cancel()
strategy.cancel(id, when) \u2192 void
strategy(title\u00a0=\u00a0\"simple\u00a0order\u00a0cancellation\u00a0example\")
conditionForBuy\u00a0=\u00a0open\u00a0>\u00a0high[1]
strategy.entry(\"long\",\u00a0true,\u00a01,\u00a0limit\u00a0=\u00a0low,\u00a0when\u00a0=\u00a0conditionForBuy)\u00a0//\u00a0enter\u00a0long\u00a0using\u00a0limit\u00a0order\u00a0at\u00a0low\u00a0price\u00a0of\u00a0current\u00a0bar\u00a0if\u00a0conditionForBuy\u00a0is\u00a0true
strategy.cancel(\"long\",\u00a0when\u00a0=\u00a0not\u00a0conditionForBuy)\u00a0//\u00a0cancel\u00a0the\u00a0entry\u00a0order\u00a0with\u00a0name\u00a0\"long\"\u00a0if\u00a0conditionForBuy\u00a0is\u00a0falsestrategy.cancel_all()
strategy.cancel_all(when) \u2192 void
strategy(title\u00a0=\u00a0\"simple\u00a0all\u00a0orders\u00a0cancellation\u00a0example\")
conditionForBuy1\u00a0=\u00a0open\u00a0>\u00a0high[1]
strategy.entry(\"long\u00a0entry\u00a01\",\u00a0true,\u00a01,\u00a0limit\u00a0=\u00a0low,\u00a0when\u00a0=\u00a0conditionForBuy1)\u00a0//\u00a0enter\u00a0long\u00a0by\u00a0limit\u00a0if\u00a0conditionForBuy1\u00a0is\u00a0true
conditionForBuy2\u00a0=\u00a0conditionForBuy1\u00a0and\u00a0open[1]\u00a0>\u00a0high[2]
strategy.entry(\"long\u00a0entry\u00a02\",\u00a0true,\u00a01,\u00a0limit\u00a0=\u00a0lowest(low,\u00a02),\u00a0when\u00a0=\u00a0conditionForBuy2)\u00a0//\u00a0enter\u00a0long\u00a0by\u00a0limit\u00a0if\u00a0conditionForBuy2\u00a0is\u00a0true
conditionForStopTrading\u00a0=\u00a0open\u00a0<\u00a0lowest(low,\u00a02)
strategy.cancel_all(conditionForStopTrading)\u00a0//\u00a0cancel\u00a0both\u00a0limit\u00a0orders\u00a0if\u00a0the\u00a0conditon\u00a0conditionForStopTrading\u00a0is\u00a0truestrategy.close()
strategy.close(id, when) \u2192 void
strategy(\"closeEntry\u00a0Demo\",\u00a0overlay=false)
strategy.entry(\"buy\",\u00a0true,\u00a0when\u00a0=\u00a0open\u00a0>\u00a0close)
strategy.close(\"buy\",\u00a0when\u00a0=\u00a0open\u00a0<\u00a0close)
plot(strategy.position_size)strategy.close_all()
strategy.close_all(when) \u2192 void
strategy(\"closeAll\u00a0Demo\",\u00a0overlay=false)
strategy.entry(\"buy\",\u00a0true,\u00a0when\u00a0=\u00a0open\u00a0>\u00a0close)
strategy.close_all(when\u00a0=\u00a0open\u00a0<\u00a0close)
plot(strategy.position_size)strategy.entry()
strategy.entry(id, long, qty, limit, stop, oca_name, oca_type, comment, when) \u2192 void
strategy(title\u00a0=\u00a0\"simple\u00a0gap\u00a0strategy\u00a0example\")
strategy.entry(\"enter\u00a0long\",\u00a0true,\u00a01,\u00a0when\u00a0=\u00a0open\u00a0>\u00a0high[1])\u00a0//\u00a0enter\u00a0long\u00a0by\u00a0market\u00a0if\u00a0current\u00a0open\u00a0great\u00a0then\u00a0previous\u00a0high
strategy.entry(\"enter\u00a0short\",\u00a0false,\u00a01,\u00a0when\u00a0=\u00a0open\u00a0<\u00a0low[1])\u00a0//\u00a0enter\u00a0short\u00a0by\u00a0market\u00a0if\u00a0current\u00a0open\u00a0less\u00a0then\u00a0previous\u00a0lowstrategy.exit()
strategy.exit(id, from_entry, qty, qty_percent, profit, limit, loss, stop, trail_price, trail_points, trail_offset, oca_name, comment, when) \u2192 void
strategy(title\u00a0=\u00a0\"simple\u00a0strategy\u00a0exit\u00a0example\")
strategy.entry(\"long\",\u00a0true,\u00a01,\u00a0when\u00a0=\u00a0open\u00a0>\u00a0high[1])\u00a0//\u00a0enter\u00a0long\u00a0by\u00a0market\u00a0if\u00a0current\u00a0open\u00a0great\u00a0then\u00a0previous\u00a0high
strategy.exit(\"exit\",\u00a0\"long\",\u00a0profit\u00a0=\u00a010,\u00a0loss\u00a0=\u00a05)\u00a0//\u00a0generate\u00a0full\u00a0exit\u00a0bracket\u00a0(profit\u00a010\u00a0points,\u00a0loss\u00a05\u00a0points\u00a0per\u00a0contract)\u00a0from\u00a0entry\u00a0with\u00a0name\u00a0\"long\"strategy.order()
strategy.order(id, long, qty, limit, stop, oca_name, oca_type, comment, when) \u2192 void
strategy(title\u00a0=\u00a0\"simple\u00a0gap\u00a0strategy\u00a0example\")
strategy.order(\"buy\",\u00a0true,\u00a01,\u00a0when\u00a0=\u00a0open\u00a0>\u00a0high[1])\u00a0//\u00a0buy\u00a0by\u00a0market\u00a0if\u00a0current\u00a0open\u00a0great\u00a0then\u00a0previous\u00a0high
strategy.order(\"sell\",\u00a0false,\u00a01,\u00a0when\u00a0=\u00a0open\u00a0<\u00a0low[1])\u00a0//\u00a0sell\u00a0by\u00a0market\u00a0if\u00a0current\u00a0open\u00a0less\u00a0then\u00a0previous\u00a0lowstrategy.risk.allow_entry_in()
strategy.risk.allow_entry_in(value) \u2192 void
strategy(\"risk.long_only\u00a0Demo\")
strategy.risk.allow_entry_in(strategy.direction.long)\u00a0//\u00a0There\u00a0will\u00a0be\u00a0no\u00a0short\u00a0entries,\u00a0only\u00a0exits\u00a0from\u00a0long.
strategy.entry(\"buy\",\u00a0true,\u00a0when\u00a0=\u00a0open\u00a0>\u00a0close)
strategy.entry(\"sell\",\u00a0false,\u00a0when\u00a0=\u00a0open\u00a0<\u00a0close)strategy.risk.max_cons_loss_days()
strategy.risk.max_cons_loss_days(count) \u2192 void
strategy(\"risk.max_cons_loss_days\u00a0Demo\u00a01\")
strategy.risk.max_cons_loss_days(3)\u00a0//\u00a0No\u00a0orders\u00a0will\u00a0be\u00a0placed\u00a0after\u00a03\u00a0days,\u00a0if\u00a0each\u00a0day\u00a0is\u00a0with\u00a0loss.
//\u00a0...strategy.risk.max_drawdown()
strategy.risk.max_drawdown(value, type) \u2192 void
strategy(\"risk.max_drawdown\u00a0Demo\u00a01\")
strategy.risk.max_drawdown(50,\u00a0strategy.percent_of_equity)\u00a0//\u00a0set\u00a0maximum\u00a0drawdown\u00a0to\u00a050%\u00a0of\u00a0maximum\u00a0equity
//\u00a0...\u00a0
strategy(\"risk.max_drawdown\u00a0Demo\u00a02\",\u00a0currency\u00a0=\u00a0EUR)
strategy.risk.max_drawdown(2000,\u00a0strategy.cash)\u00a0\u00a0//\u00a0set\u00a0maximum\u00a0drawdown\u00a0to\u00a02000\u00a0EUR\u00a0from\u00a0maximum\u00a0equity
//\u00a0...\u00a0strategy.risk.max_intraday_filled_orders()
strategy.risk.max_intraday_filled_orders(count) \u2192 void
strategy(\"risk.max_intraday_filled_orders\u00a0Demo\")
strategy.risk.max_intraday_filled_orders(10)\u00a0//\u00a0After\u00a010\u00a0orders\u00a0are\u00a0filled,\u00a0no\u00a0more\u00a0strategy\u00a0orders\u00a0will\u00a0be\u00a0placed\u00a0(except\u00a0for\u00a0a\u00a0market\u00a0order\u00a0to\u00a0exit\u00a0current\u00a0open\u00a0market\u00a0position,\u00a0if\u00a0there\u00a0is\u00a0any).
strategy.entry(\"buy\",\u00a0true,\u00a0when\u00a0=\u00a0open\u00a0>\u00a0close)
strategy.entry(\"sell\",\u00a0false,\u00a0when\u00a0=\u00a0open\u00a0<\u00a0close)strategy.risk.max_intraday_loss()
strategy.risk.max_intraday_loss(value, type) \u2192 void
strategy(\"risk.max_intraday_loss\u00a0Demo\u00a01\")
strategy.risk.max_intraday_loss(10,\u00a0strategy.percent_of_equity)\u00a0//\u00a0set\u00a0maximum\u00a0intraday\u00a0loss\u00a0to\u00a010%\u00a0of\u00a0maximum\u00a0intraday\u00a0equity
//\u00a0...\u00a0
strategy(\"risk.max_intraday_loss\u00a0Demo\u00a02\",\u00a0currency\u00a0=\u00a0EUR)
strategy.risk.max_intraday_loss(100,\u00a0strategy.cash)\u00a0//\u00a0set\u00a0maximum\u00a0intraday\u00a0loss\u00a0to\u00a0100\u00a0EUR\u00a0from\u00a0maximum\u00a0intraday\u00a0equity
//\u00a0...\u00a0strategy.risk.max_position_size()
strategy.risk.max_position_size(contracts) \u2192 void
strategy(\"risk.max_position_size\u00a0Demo\",\u00a0default_qty_value\u00a0=\u00a0100)
strategy.risk.max_position_size(10)
strategy.entry(\"buy\",\u00a0true,\u00a0when\u00a0=\u00a0open\u00a0>\u00a0close)
plot(strategy.position_size)\u00a0\u00a0//\u00a0max\u00a0plot\u00a0value\u00a0will\u00a0be\u00a010study()
study(title, shorttitle, overlay, precision, scale, max_bars_back) \u2192 void
study(title='MyScriptStudy')
study(title=\"MyScriptStudy\",\u00a0shorttitle=\"MSS\",\u00a0precision=6,\u00a0overlay=true)swma()
swma(x) \u2192 series
plot(swma(close))
//\u00a0same\u00a0on\u00a0pine,\u00a0but\u00a0less\u00a0efficient
pine_swma(x)\u00a0=>
\u00a0\u00a0\u00a0\u00a0x[3]\u00a0*\u00a01\u00a0/\u00a06\u00a0+\u00a0x[2]\u00a0*\u00a02\u00a0/\u00a06\u00a0+\u00a0x[1]\u00a0*\u00a02\u00a0/\u00a06\u00a0+\u00a0x[0]\u00a0*\u00a01\u00a0/\u00a06
plot(pine_swma(close))tan()
tan(x) \u2192 float
tan(x) \u2192 const float
tan(x) \u2192 series
tickerid()
tickerid(prefix, ticker, session, adjustment) \u2192 string
study(\"tickerid\u00a0fun\",\u00a0overlay=true)\u00a0
t\u00a0=\u00a0tickerid(syminfo.prefix,\u00a0ticker,\u00a0session.regular,\u00a0adjustment.splits)
t2\u00a0=\u00a0heikinashi(t)
c\u00a0=\u00a0security(t2,\u00a0period,\u00a0low,\u00a0true)
plot(c,\u00a0style=linebr)time()
time(resolution, session) \u2192 series
time(resolution) \u2192 series
//@version=3
study(\"Time\",\u00a0overlay=true)
//\u00a0Try\u00a0this\u00a0on\u00a0chart\u00a0AAPL,1
timeinrange(res,\u00a0sess)\u00a0=>\u00a0not\u00a0na(time(res,\u00a0sess))\u00a0?\u00a01\u00a0:\u00a00
plot(timeinrange(\"1\",\u00a0\"1300-1400\"),\u00a0color=red)
//\u00a0This\u00a0plots\u00a01.0\u00a0at\u00a0every\u00a0start\u00a0of\u00a010\u00a0minute\u00a0bar\u00a0on\u00a0a\u00a01\u00a0minute\u00a0chart:
newbar(res)\u00a0=>\u00a0change(time(res))\u00a0==\u00a00\u00a0?\u00a00\u00a0:\u00a01
plot(newbar(\"10\"))//@version=3
study(\"Time\",\u00a0overlay=true)
t1\u00a0=\u00a0time(period,\u00a0\"0000-0000\")
bgcolor(t1\u00a0?\u00a0blue\u00a0:\u00a0na)//@version=3
study(\"Time\u00a0-\u00a0days\",\u00a0overlay=true)
t1\u00a0=\u00a0time(period,\u00a0\"0000-0000:1234567\")
bgcolor(t1\u00a0?\u00a0green\u00a0:\u00a0na)timestamp()
timestamp(year, month, day, hour, minute, second) \u2192 integer
timestamp(timezone, year, month, day, hour, minute, second) \u2192 integer
//@version=3
study(\"My\u00a0Script\")
plot(timestamp(2016,\u00a001,\u00a019,\u00a009,\u00a030),\u00a0linewidth=3,\u00a0color=green)
plot(timestamp(syminfo.timezone,\u00a02016,\u00a001,\u00a019,\u00a009,\u00a030),\u00a0color=blue)
plot(timestamp(2016,\u00a001,\u00a019,\u00a009,\u00a030,\u00a015),\u00a0color=yellow)
plot(timestamp(\"GMT+6\",\u00a02016,\u00a001,\u00a019,\u00a009,\u00a030,\u00a016))tostring()
tostring(x) \u2192 string
tostring(x, y) \u2192 string
tr()
tr(handle_na) \u2192 series
tsi()
tsi(source, short_length, long_length) \u2192 series
valuewhen()
valuewhen(condition, source, occurrence) \u2192 series
slow\u00a0=\u00a0sma(close,\u00a07)
fast\u00a0=\u00a0sma(close,\u00a014)
//\u00a0get\u00a0value\u00a0of\u00a0close\u00a0on\u00a0second\u00a0cross\u00a0occurrence
valuewhen(cross(slow,\u00a0fast),\u00a0close,\u00a01)variance()
variance(source, length) \u2192 series
vwap()
vwap(x) \u2192 series
vwma()
vwma(source, length) \u2192 series
plot(vwma(close,\u00a015))
//\u00a0same\u00a0on\u00a0pine,\u00a0but\u00a0less\u00a0efficient
pine_vwma(x,\u00a0y)\u00a0=>
\u00a0\u00a0\u00a0\u00a0sma(x\u00a0*\u00a0volume,\u00a0y)\u00a0/\u00a0sma(volume,\u00a0y)
plot(pine_vwma(close,\u00a015))weekofyear()
weekofyear(time) \u2192 series
wma()
wma(source, length) \u2192 series
plot(wma(close,\u00a015))
//\u00a0same\u00a0on\u00a0pine,\u00a0but\u00a0much\u00a0less\u00a0efficient
pine_wma(x,\u00a0y)\u00a0=>
\u00a0\u00a0\u00a0\u00a0norm\u00a0=\u00a00.0
\u00a0\u00a0\u00a0\u00a0sum\u00a0=\u00a00.0
\u00a0\u00a0\u00a0\u00a0for\u00a0i\u00a0=\u00a00\u00a0to\u00a0y\u00a0-\u00a01
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0weight\u00a0=\u00a0(y\u00a0-\u00a0i)\u00a0*\u00a0y
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0norm\u00a0:=\u00a0norm\u00a0+\u00a0weight
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0sum\u00a0:=\u00a0sum\u00a0+\u00a0x[i]\u00a0*\u00a0weight
\u00a0\u00a0\u00a0\u00a0sum\u00a0/\u00a0norm
plot(pine_wma(close,\u00a015))accdist
barstate.isconfirmed
barstate.isfirst
barstate.ishistory
barstate.islast
barstate.isnew
barstate.isrealtime
dayofmonth
hour
minute
month
n
plot(n)
plot(n\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)na
n\u00a0<\u00a010\u00a0?\u00a0na\u00a0:\u00a0close\u00a0\u00a0\u00a0\u00a0//\u00a0CORRECT
close\u00a0==\u00a0na\u00a0?\u00a0close[1]\u00a0:\u00a0close\u00a0\u00a0\u00a0\u00a0//\u00a0INCORRECT!
na(close)\u00a0?\u00a0close[1]\u00a0:\u00a0close\u00a0\u00a0\u00a0\u00a0//\u00a0CORRECTsecond
strategy.closedtrades
strategy.equity
strategy.eventrades
strategy.grossloss
strategy.grossprofit
strategy.initial_capital
strategy.losstrades
strategy.max_contracts_held_all
strategy.max_contracts_held_long
strategy.max_contracts_held_short
strategy.max_drawdown
strategy.netprofit
strategy.openprofit
strategy.opentrades
strategy.position_avg_price
strategy.position_entry_name
strategy.position_size
strategy.wintrades
syminfo.session
ticker
tickerid
time
timenow
weekofyear
year
adjustment.dividends
adjustment.none
adjustment.splits
alert.freq_all
freq parameter of the alert() function.freq parameter of the alert() function.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "alert.freq_once_per_bar",
+ "url": "https://www.tradingview.com/pine-script-reference/v4/#const_alert.freq_once_per_bar",
+ "fragment": "const_alert.freq_once_per_bar",
+ "info": "alert.freq_once_per_bar
freq parameter of the alert() function.freq parameter of the alert() function.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "alert.freq_once_per_bar_close",
+ "url": "https://www.tradingview.com/pine-script-reference/v4/#const_alert.freq_once_per_bar_close",
+ "fragment": "const_alert.freq_once_per_bar_close",
+ "info": "alert.freq_once_per_bar_close
freq parameter of the alert() function.freq parameter of the alert() function.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "barmerge.gaps_off",
+ "url": "https://www.tradingview.com/pine-script-reference/v4/#const_barmerge.gaps_off",
+ "fragment": "const_barmerge.gaps_off",
+ "info": "barmerge.gaps_off
barmerge.gaps_on
barmerge.lookahead_off
barmerge.lookahead_on
color.aqua
color.black
color.blue
color.fuchsia
color.gray
color.green
color.lime
color.maroon
color.olive
color.orange
color.purple
color.red
color.silver
color.teal
color.white
color.yellow
dayofweek.friday
dayofweek.monday
dayofweek.saturday
dayofweek.sunday
dayofweek.thursday
dayofweek.tuesday
dayofweek.wednesday
format.inherit
format.mintick
format.percent
format.price
format.volume
hline.style_dashed
hline.style_dotted
hline.style_solid
input.resolution
label.style_arrowdown
label.style_arrowup
label.style_circle
label.style_cross
label.style_diamond
label.style_flag
label.style_label_center
label.style_label_down
label.style_label_left
label.style_label_lower_left
label.style_label_lower_right
label.style_label_right
label.style_label_up
label.style_label_upper_left
label.style_label_upper_right
label.style_none
label.style_square
label.style_triangledown
label.style_triangleup
label.style_xcross
line.style_arrow_both
line.style_arrow_left
line.style_arrow_right
location.abovebar
location.belowbar
location.bottom
location.top
math.e
math.phi
math.pi
math.rphi
order.ascending
order.descending
plot.style_area
style parameter in the plot function.style parameter in the plot function.",
+ "type": "const integer",
+ "remarks": ""
+ },
+ {
+ "name": "plot.style_areabr",
+ "url": "https://www.tradingview.com/pine-script-reference/v4/#const_plot.style_areabr",
+ "fragment": "const_plot.style_areabr",
+ "info": "plot.style_areabr
style parameter in the plot function. Similar to plot.style_area, except the gaps in the data are not filled.style parameter in the plot function. Similar to plot.style_area, except the gaps in the data are not filled.",
+ "type": "const integer",
+ "remarks": ""
+ },
+ {
+ "name": "plot.style_circles",
+ "url": "https://www.tradingview.com/pine-script-reference/v4/#const_plot.style_circles",
+ "fragment": "const_plot.style_circles",
+ "info": "plot.style_circles
style parameter in the plot function.style parameter in the plot function.",
+ "type": "const integer",
+ "remarks": ""
+ },
+ {
+ "name": "plot.style_columns",
+ "url": "https://www.tradingview.com/pine-script-reference/v4/#const_plot.style_columns",
+ "fragment": "const_plot.style_columns",
+ "info": "plot.style_columns
style parameter in the plot function.style parameter in the plot function.",
+ "type": "const integer",
+ "remarks": ""
+ },
+ {
+ "name": "plot.style_cross",
+ "url": "https://www.tradingview.com/pine-script-reference/v4/#const_plot.style_cross",
+ "fragment": "const_plot.style_cross",
+ "info": "plot.style_cross
style parameter in the plot function.style parameter in the plot function.",
+ "type": "const integer",
+ "remarks": ""
+ },
+ {
+ "name": "plot.style_histogram",
+ "url": "https://www.tradingview.com/pine-script-reference/v4/#const_plot.style_histogram",
+ "fragment": "const_plot.style_histogram",
+ "info": "plot.style_histogram
style parameter in the plot function.style parameter in the plot function.",
+ "type": "const integer",
+ "remarks": ""
+ },
+ {
+ "name": "plot.style_line",
+ "url": "https://www.tradingview.com/pine-script-reference/v4/#const_plot.style_line",
+ "fragment": "const_plot.style_line",
+ "info": "plot.style_line
style parameter in the plot function.style parameter in the plot function.",
+ "type": "const integer",
+ "remarks": ""
+ },
+ {
+ "name": "plot.style_linebr",
+ "url": "https://www.tradingview.com/pine-script-reference/v4/#const_plot.style_linebr",
+ "fragment": "const_plot.style_linebr",
+ "info": "plot.style_linebr
style parameter in the plot function. Similar to plot.style_line, except the gaps in the data are not filled.style parameter in the plot function. Similar to plot.style_line, except the gaps in the data are not filled.",
+ "type": "const integer",
+ "remarks": ""
+ },
+ {
+ "name": "plot.style_stepline",
+ "url": "https://www.tradingview.com/pine-script-reference/v4/#const_plot.style_stepline",
+ "fragment": "const_plot.style_stepline",
+ "info": "plot.style_stepline
style parameter in the plot function.style parameter in the plot function.",
+ "type": "const integer",
+ "remarks": ""
+ },
+ {
+ "name": "position.bottom_center",
+ "url": "https://www.tradingview.com/pine-script-reference/v4/#const_position.bottom_center",
+ "fragment": "const_position.bottom_center",
+ "info": "position.bottom_center
position.bottom_left
position.bottom_right
position.middle_center
position.middle_left
position.middle_right
position.top_center
position.top_left
position.top_right
session.extended
session.regular
size.huge
size.large
size.normal
size.small
size.tiny
strategy.cash
strategy.commission.cash_per_contract
strategy.commission.cash_per_order
strategy.commission.percent
strategy.direction.all
strategy.direction.long
strategy.direction.short
strategy.fixed
strategy.oca.cancel
strategy.oca.none
strategy.oca.reduce
strategy.percent_of_equity
text.align_bottom
text.align_center
text.align_left
text.align_right
text.align_top
xloc.bar_index
xloc.bar_time
yloc.abovebar
yloc.belowbar
yloc.price
abs()
abs(x) \u2192 integer
abs(x) \u2192 input integer
abs(x) \u2192 const integer
abs(x) \u2192 series[integer]
abs(x) \u2192 float
abs(x) \u2192 input float
abs(x) \u2192 const float
abs(x) \u2192 series[float]
acos()
acos(x) \u2192 float
acos(x) \u2192 input float
acos(x) \u2192 const float
acos(x) \u2192 series[float]
alert()
alert(message, freq) \u2192 void
//@version=4
study(\"`alert()`\u00a0example\",\u00a0\"\",\u00a0true)
ma\u00a0=\u00a0sma(close,\u00a014)
xUp\u00a0=\u00a0crossover(close,\u00a0ma)
if\u00a0xUp
\u00a0\u00a0\u00a0\u00a0//\u00a0Trigger\u00a0the\u00a0alert\u00a0the\u00a0first\u00a0time\u00a0a\u00a0cross\u00a0occurs\u00a0during\u00a0the\u00a0real-time\u00a0bar.
\u00a0\u00a0\u00a0\u00a0alert(\"Price\u00a0(\"\u00a0+\u00a0tostring(close)\u00a0+\u00a0\")\u00a0crossed\u00a0over\u00a0MA\u00a0(\"\u00a0+\u00a0tostring(ma)\u00a0+\u00a0\u00a0\").\",\u00a0alert.freq_once_per_bar)
plot(ma)
plotchar(xUp,\u00a0\"xUp\",\u00a0\"\u25b2\",\u00a0location.top,\u00a0size\u00a0=\u00a0size.tiny)alertcondition()
alertcondition(condition, title, message) \u2192 void
alertcondition(close\u00a0>=\u00a0open,\u00a0title='Alert\u00a0on\u00a0Green\u00a0Bar',\u00a0message='Green\u00a0Bar!')alma()
alma(series, length, offset, sigma) \u2192 series[float]
alma(series, length, offset, sigma, floor) \u2192 series[float]
plot(alma(close,\u00a09,\u00a00.85,\u00a06))
//\u00a0same\u00a0on\u00a0pine,\u00a0but\u00a0much\u00a0less\u00a0efficient
pine_alma(series,\u00a0windowsize,\u00a0offset,\u00a0sigma)\u00a0=>
\u00a0\u00a0\u00a0\u00a0m\u00a0=\u00a0offset\u00a0*\u00a0(windowsize\u00a0-\u00a01)
\u00a0\u00a0\u00a0\u00a0//m\u00a0=\u00a0floor(offset\u00a0*\u00a0(windowsize\u00a0-\u00a01))\u00a0//\u00a0Used\u00a0as\u00a0m\u00a0when\u00a0floor=true
\u00a0\u00a0\u00a0\u00a0s\u00a0=\u00a0windowsize\u00a0/\u00a0sigma
\u00a0\u00a0\u00a0\u00a0norm\u00a0=\u00a00.0
\u00a0\u00a0\u00a0\u00a0sum\u00a0=\u00a00.0
\u00a0\u00a0\u00a0\u00a0for\u00a0i\u00a0=\u00a00\u00a0to\u00a0windowsize\u00a0-\u00a01
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0weight\u00a0=\u00a0exp(-1\u00a0*\u00a0pow(i\u00a0-\u00a0m,\u00a02)\u00a0/\u00a0(2\u00a0*\u00a0pow(s,\u00a02)))
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0norm\u00a0:=\u00a0norm\u00a0+\u00a0weight
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0sum\u00a0:=\u00a0sum\u00a0+\u00a0series[windowsize\u00a0-\u00a0i\u00a0-\u00a01]\u00a0*\u00a0weight
\u00a0\u00a0\u00a0\u00a0sum\u00a0/\u00a0norm
plot(pine_alma(close,\u00a09,\u00a00.85,\u00a06))array.avg()
array.avg(id) \u2192 series[float]
array.avg(id) \u2192 series[integer]
//@version=4
study(\"array.avg\u00a0example\")
a\u00a0=\u00a0array.new_float(0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a09
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0close[i])
plot(array.avg(a))array.clear()
array.clear(id) \u2192 void
//@version=4
study(\"array.clear\u00a0example\")
a\u00a0=\u00a0array.new_float(5,high)
array.clear(a)
array.push(a,\u00a0close)
plot(array.get(a,0))
plot(array.size(a))array.concat()
array.concat(id1, id2) \u2192 id1
//@version=4
study(\"array.concat\u00a0example\")
a\u00a0=\u00a0array.new_float(0,0)
b\u00a0=\u00a0array.new_float(0,0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a04
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0high[i])
\u00a0\u00a0\u00a0\u00a0array.push(b,\u00a0low[i])
c\u00a0=\u00a0array.concat(a,b)
plot(array.size(a))
plot(array.size(b))
plot(array.size(c))array.copy()
array.copy(id) \u2192 float[]
array.copy(id) \u2192 int[]
array.copy(id) \u2192 color[]
array.copy(id) \u2192 bool[]
array.copy(id) \u2192 string[]
array.copy(id) \u2192 line[]
array.copy(id) \u2192 label[]
//@version=4
study(\"array.copy\u00a0example\")
length\u00a0=\u00a05
a\u00a0=\u00a0array.new_float(length,\u00a0close)
b\u00a0=\u00a0array.copy(a)
a\u00a0:=\u00a0array.new_float(length,\u00a0open)
plot(array.sum(a)\u00a0/\u00a0length)
plot(array.sum(b)\u00a0/\u00a0length)array.covariance()
array.covariance(id1, id2) \u2192 series[float]
//@version=4
study(\"array.covariance\u00a0example\")
a\u00a0=\u00a0array.new_float(0)
b\u00a0=\u00a0array.new_float(0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a09
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0close[i])
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0open[i])
plot(array.covariance(a,\u00a0b))array.fill()
array.fill(id, value, index_from, index_to) \u2192 void
//@version=4
study(\"array.fill\u00a0example\")
a\u00a0=\u00a0array.new_float(10)
array.fill(a,\u00a0close)
plot(array.sum(a))array.from()
array.from(..args) \u2192 int[]
array.from(..args) \u2192 bool[]
array.from(..args) \u2192 color[]
array.from(..args) \u2192 float[]
array.from(..args) \u2192 line[]
array.from(..args) \u2192 label[]
array.from(..args) \u2192 box[]
array.from(..args) \u2192 table[]
array.from(..args) \u2192 string[]
//@version=4
study(\"array.from_example\",\u00a0overlay\u00a0=\u00a0false)
arr\u00a0=\u00a0array.from(\"Hello\",\u00a0\"World!\")\u00a0//\u00a0arr\u00a0(string[])\u00a0will\u00a0contain\u00a02\u00a0elements:\u00a0{Hello},\u00a0{World!}.
plot(close)array.get()
array.get(id, index) \u2192 series[float]
array.get(id, index) \u2192 series[int]
array.get(id, index) \u2192 series[color]
array.get(id, index) \u2192 series[bool]
array.get(id, index) \u2192 series[string]
array.get(id, index) \u2192 series[line]
array.get(id, index) \u2192 series[label]
//@version=4
study(\"array.get\u00a0example\")
a\u00a0=\u00a0array.new_float(0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a09
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0close[i]\u00a0-\u00a0open[i])
plot(array.get(a,\u00a09))array.includes()
array.includes(id, value) \u2192 series[bool]
//@version=4
study(\"array.includes\u00a0example\")
a\u00a0=\u00a0array.new_float(5,high)
p\u00a0=\u00a0close
if\u00a0array.includes(a,\u00a0high)
\u00a0\u00a0\u00a0\u00a0p\u00a0:=\u00a0open
plot(p)array.indexof()
array.indexof(id, value) \u2192 series[integer]
//@version=4
study(\"array.indexof\u00a0example\")
a\u00a0=\u00a0array.new_float(5,high)
index\u00a0=\u00a0array.indexof(a,\u00a0high)
plot(index)array.insert()
array.insert(id, index, value) \u2192 void
//@version=4
study(\"array.insert\u00a0example\")
a\u00a0=\u00a0array.new_float(5,\u00a0close)
array.insert(a,\u00a00,\u00a0open)
plot(array.get(a,\u00a05))array.join()
array.join(id, separator) \u2192 series[string]
//@version=4
study(\"array.join\u00a0example\")
a\u00a0=\u00a0array.new_float(5,\u00a05)
label.new(bar_index,\u00a0close,\u00a0array.join(a,\u00a0\",\"))array.lastindexof()
array.lastindexof(id, value) \u2192 series[integer]
//@version=4
study(\"array.lastindexof\u00a0example\")
a\u00a0=\u00a0array.new_float(5,high)
index\u00a0=\u00a0array.lastindexof(a,\u00a0high)
plot(index)array.max()
array.max(id) \u2192 series[float]
array.max(id) \u2192 series[integer]
//@version=4
study(\"array.max\u00a0example\")
a\u00a0=\u00a0array.new_float(0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a09
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0close[i])
plot(array.max(a))array.median()
array.median(id) \u2192 series[float]
array.median(id) \u2192 series[integer]
//@version=4
study(\"array.median\u00a0example\")
a\u00a0=\u00a0array.new_float(0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a09
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0close[i])
plot(array.median(a))array.min()
array.min(id) \u2192 series[float]
array.min(id) \u2192 series[integer]
//@version=4
study(\"array.min\u00a0example\")
a\u00a0=\u00a0array.new_float(0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a09
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0close[i])
plot(array.min(a))array.mode()
array.mode(id) \u2192 series[float]
array.mode(id) \u2192 series[integer]
//@version=4
study(\"array.mode\u00a0example\")
a\u00a0=\u00a0array.new_float(0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a09
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0close[i])
plot(array.mode(a))array.new_bool()
array.new_bool(size, initial_value) \u2192 bool[]
//@version=4
study(\"array.new_bool\u00a0example\")
length\u00a0=\u00a05
a\u00a0=\u00a0array.new_bool(length,\u00a0close\u00a0>\u00a0open)
plot(array.get(a,\u00a00)\u00a0?\u00a0close\u00a0:\u00a0open)array.new_box()
array.new_box(size, initial_value) \u2192 box[]
//@version=4
study(\"array.new_box\u00a0example\")
box[]\u00a0boxes\u00a0=\u00a0array.new_box()
array.push(boxes,\u00a0box.new(time,\u00a0close,\u00a0time+2,\u00a0low))
plot(1)array.new_color()
array.new_color(size, initial_value) \u2192 color[]
//@version=4
study(\"array.new_color\u00a0example\")
length\u00a0=\u00a05
a\u00a0=\u00a0array.new_color(length,\u00a0color.red)
plot(close,\u00a0color\u00a0=\u00a0array.get(a,\u00a00))array.new_float()
array.new_float(size, initial_value) \u2192 float[]
//@version=4
study(\"array.new_float\u00a0example\")
length\u00a0=\u00a05
a\u00a0=\u00a0array.new_float(length,\u00a0close)
plot(array.sum(a)\u00a0/\u00a0length)array.new_int()
array.new_int(size, initial_value) \u2192 int[]
//@version=4
study(\"array.new_int\u00a0example\")
length\u00a0=\u00a05
a\u00a0=\u00a0array.new_int(length,\u00a0int(close))
plot(array.sum(a)\u00a0/\u00a0length)array.new_label()
array.new_label(size, initial_value) \u2192 label[]
//@version=4
study(\"array.new_label\u00a0example\")
var\u00a0a\u00a0=\u00a0array.new_label()
l\u00a0=\u00a0label.new(bar_index,\u00a0close,\u00a0\"some\u00a0text\")
array.push(a,\u00a0l)
if\u00a0close\u00a0>\u00a0close[1]\u00a0and\u00a0close[1]\u00a0>\u00a0close[2]
\u00a0\u00a0\u00a0\u00a0//\u00a0remove\u00a0all\u00a0labels
\u00a0\u00a0\u00a0\u00a0size\u00a0=\u00a0array.size(a)\u00a0-\u00a01
\u00a0\u00a0\u00a0\u00a0for\u00a0i\u00a0=\u00a00\u00a0to\u00a0size
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0lb\u00a0=\u00a0array.get(a,\u00a0i)
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0label.delete(lb)array.new_line()
array.new_line(size, initial_value) \u2192 line[]
//@version=4
study(\"array.new_line\u00a0example\")
//\u00a0draw\u00a0last\u00a015\u00a0lines
var\u00a0a\u00a0=\u00a0array.new_line()
array.push(a,\u00a0line.new(bar_index\u00a0-\u00a01,\u00a0close[1],\u00a0bar_index,\u00a0close))
if\u00a0array.size(a)\u00a0>\u00a015
\u00a0\u00a0\u00a0\u00a0ln\u00a0=\u00a0array.shift(a)
\u00a0\u00a0\u00a0\u00a0line.delete(ln)array.new_string()
array.new_string(size, initial_value) \u2192 string[]
//@version=4
study(\"array.new_string\u00a0example\")
length\u00a0=\u00a05
a\u00a0=\u00a0array.new_string(length,\u00a0\"text\")
label.new(bar_index,\u00a0close,\u00a0array.get(a,\u00a00))array.new_table()
array.new_table(size, initial_value) \u2192 table[]
study('table\u00a0array')
table[]\u00a0tables\u00a0=\u00a0array.new_table()
array.push(tables,\u00a0table.new(position\u00a0=\u00a0position.top_left,\u00a0rows\u00a0=\u00a01,\u00a0columns\u00a0=\u00a02,\u00a0bgcolor\u00a0=\u00a0color.yellow,\u00a0border_width=1))
plot(1)array.pop()
array.pop(id) \u2192 series[float]
array.pop(id) \u2192 series[int]
array.pop(id) \u2192 series[color]
array.pop(id) \u2192 series[bool]
array.pop(id) \u2192 series[string]
array.pop(id) \u2192 series[line]
array.pop(id) \u2192 series[label]
//@version=4
study(\"array.pop\u00a0example\")
a\u00a0=\u00a0array.new_float(5,high)
removedEl\u00a0=\u00a0array.pop(a)
plot(array.size(a))
plot(removedEl)array.push()
array.push(id, value) \u2192 void
//@version=4
study(\"array.push\u00a0example\")
a\u00a0=\u00a0array.new_float(5,\u00a00)
array.push(a,\u00a0open)
plot(array.get(a,\u00a05))array.range()
array.range(id) \u2192 series[float]
array.range(id) \u2192 series[integer]
//@version=4
study(\"array.range\u00a0example\")
a\u00a0=\u00a0array.new_float(0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a09
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0close[i])
plot(array.range(a))array.remove()
array.remove(id, index) \u2192 series[float]
array.remove(id, index) \u2192 series[int]
array.remove(id, index) \u2192 series[color]
array.remove(id, index) \u2192 series[bool]
array.remove(id, index) \u2192 series[string]
array.remove(id, index) \u2192 series[line]
array.remove(id, index) \u2192 series[label]
//@version=4
study(\"array.remove\u00a0example\")
a\u00a0=\u00a0array.new_float(5,high)
removedEl\u00a0=\u00a0array.remove(a,\u00a00)
plot(array.size(a))
plot(removedEl)array.reverse()
array.reverse(id) \u2192 void
//@version=4
study(\"array.reverse\u00a0example\")
a\u00a0=\u00a0array.new_float(0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a09
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0close[i])
plot(array.get(a,\u00a00))
array.reverse(a)
plot(array.get(a,\u00a00))array.set()
array.set(id, index, value) \u2192 void
//@version=4
study(\"array.set\u00a0example\")
a\u00a0=\u00a0array.new_float(10)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a09
\u00a0\u00a0\u00a0\u00a0array.set(a,\u00a0i,\u00a0close[i])
plot(array.sum(a)\u00a0/\u00a010)array.shift()
array.shift(id) \u2192 series[float]
array.shift(id) \u2192 series[int]
array.shift(id) \u2192 series[color]
array.shift(id) \u2192 series[bool]
array.shift(id) \u2192 series[string]
array.shift(id) \u2192 series[line]
array.shift(id) \u2192 series[label]
//@version=4
study(\"array.shift\u00a0example\")
a\u00a0=\u00a0array.new_float(5,high)
removedEl\u00a0=\u00a0array.shift(a)
plot(array.size(a))
plot(removedEl)array.size()
array.size(id) \u2192 series[integer]
//@version=4
study(\"array.size\u00a0example\")
a\u00a0=\u00a0array.new_float(0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a09
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0close[i])
//\u00a0note\u00a0that\u00a0changes\u00a0in\u00a0slice\u00a0also\u00a0modify\u00a0original\u00a0array
slice\u00a0=\u00a0array.slice(a,\u00a00,\u00a05)
array.push(slice,\u00a0open)
//\u00a0size\u00a0was\u00a0changed\u00a0in\u00a0slice\u00a0and\u00a0in\u00a0original\u00a0array
plot(array.size(a))
plot(array.size(slice))array.slice()
array.slice(id, index_from, index_to) \u2192 array
//@version=4
study(\"array.slice\u00a0example\")
a\u00a0=\u00a0array.new_float(0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a09
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0close[i])
//\u00a0take\u00a0elements\u00a0from\u00a00\u00a0to\u00a04
//\u00a0*note\u00a0that\u00a0changes\u00a0in\u00a0slice\u00a0also\u00a0modify\u00a0original\u00a0array\u00a0
slice\u00a0=\u00a0array.slice(a,\u00a00,\u00a05)
plot(array.sum(a)\u00a0/\u00a010)
plot(array.sum(slice)\u00a0/\u00a05)array.sort()
array.sort(id, order) \u2192 void
//@version=4
study(\"array.sort\u00a0example\")
a\u00a0=\u00a0array.new_float(0,0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a05
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0high[i])
array.sort(a,\u00a0order.descending)
if\u00a0barstate.islast
\u00a0\u00a0\u00a0\u00a0label.new(bar_index,\u00a0close,\u00a0tostring(a))array.standardize()
array.standardize(id) \u2192 float[]
array.standardize(id) \u2192 int[]
//@version=4
study(\"array.standardize\u00a0example\")
a\u00a0=\u00a0array.new_float(0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a09
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0close[i])
b\u00a0=\u00a0array.standardize(a)
plot(array.min(b))
plot(array.max(b))array.stdev()
array.stdev(id) \u2192 series[float]
array.stdev(id) \u2192 series[integer]
//@version=4
study(\"array.stdev\u00a0example\")
a\u00a0=\u00a0array.new_float(0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a09
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0close[i])
plot(array.stdev(a))array.sum()
array.sum(id) \u2192 series[float]
array.sum(id) \u2192 series[integer]
//@version=4
study(\"array.sum\u00a0example\")
a\u00a0=\u00a0array.new_float(0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a09
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0close[i])
plot(array.sum(a))array.unshift()
array.unshift(id, value) \u2192 void
//@version=4
study(\"array.unshift\u00a0example\")
a\u00a0=\u00a0array.new_float(5,\u00a00)
array.unshift(a,\u00a0open)
plot(array.get(a,\u00a00))array.variance()
array.variance(id) \u2192 series[float]
array.variance(id) \u2192 series[integer]
//@version=4
study(\"array.variance\u00a0example\")
a\u00a0=\u00a0array.new_float(0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a09
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0close[i])
plot(array.variance(a))asin()
asin(x) \u2192 float
asin(x) \u2192 input float
asin(x) \u2192 const float
asin(x) \u2192 series[float]
atan()
atan(x) \u2192 float
atan(x) \u2192 input float
atan(x) \u2192 const float
atan(x) \u2192 series[float]
atr()
atr(length) \u2192 series[float]
plot(atr(14))
//the\u00a0same\u00a0on\u00a0pine
pine_atr(length)\u00a0=>
\u00a0\u00a0\u00a0\u00a0trueRange\u00a0=\u00a0na(high[1])?\u00a0high-low\u00a0:\u00a0max(max(high\u00a0-\u00a0low,\u00a0abs(high\u00a0-\u00a0close[1])),\u00a0abs(low\u00a0-\u00a0close[1]))
\u00a0\u00a0\u00a0\u00a0//true\u00a0range\u00a0can\u00a0be\u00a0also\u00a0calculated\u00a0with\u00a0tr(true)
\u00a0\u00a0\u00a0\u00a0rma(trueRange,\u00a0length)
plot(pine_atr(14))barcolor()
barcolor(color, offset, editable, show_last, title) \u2192 void
barcolor(close\u00a0<\u00a0open\u00a0?\u00a0color.black\u00a0:\u00a0color.white)barssince()
barssince(condition) \u2192 series[integer]
//\u00a0get\u00a0number\u00a0of\u00a0bars\u00a0since\u00a0last\u00a0color.green\u00a0bar
barssince(close\u00a0>=\u00a0open)bb()
bb(series, length, mult) \u2192 [series[float], series[float], series[float]]
//@version=4
study('My\u00a0Script')
[middle,\u00a0upper,\u00a0lower]\u00a0=\u00a0bb(close,\u00a05,\u00a04)
plot(middle,\u00a0color=color.yellow)
plot(upper,\u00a0color=color.yellow)
plot(lower,\u00a0color=color.yellow)
//\u00a0the\u00a0same\u00a0on\u00a0pine
f_bb(src,\u00a0length,\u00a0mult)\u00a0=>
\u00a0\u00a0\u00a0\u00a0float\u00a0basis\u00a0=\u00a0sma(src,\u00a0length)
\u00a0\u00a0\u00a0\u00a0float\u00a0dev\u00a0=\u00a0mult\u00a0*\u00a0stdev(src,\u00a0length)
\u00a0\u00a0\u00a0\u00a0[basis,\u00a0basis\u00a0+\u00a0dev,\u00a0basis\u00a0-\u00a0dev]
[pineMiddle,\u00a0pineUpper,\u00a0pineLower]\u00a0=\u00a0f_bb(close,\u00a05,\u00a04)
plot(pineMiddle)
plot(pineUpper)
plot(pineLower)bbw()
bbw(series, length, mult) \u2192 series[float]
//@version=4
study('My\u00a0Script')
plot(bbw(close,\u00a05,\u00a04),\u00a0color=color.yellow)
//\u00a0the\u00a0same\u00a0on\u00a0pine
f_bbw(src,\u00a0length,\u00a0mult)\u00a0=>
\u00a0\u00a0\u00a0\u00a0float\u00a0basis\u00a0=\u00a0sma(src,\u00a0length)
\u00a0\u00a0\u00a0\u00a0float\u00a0dev\u00a0=\u00a0mult\u00a0*\u00a0stdev(src,\u00a0length)
\u00a0\u00a0\u00a0\u00a0((basis\u00a0+\u00a0dev)\u00a0-\u00a0(basis\u00a0-\u00a0dev))\u00a0/\u00a0basis
plot(f_bbw(close,\u00a05,\u00a04))bgcolor()
bgcolor(color, transp, offset, editable, show_last, title) \u2192 void
bgcolor(close\u00a0<\u00a0open\u00a0?\u00a0color.red\u00a0:\u00a0color.green,\u00a0transp=70)box.delete()
box.delete(id) \u2192 void
box.get_bottom()
box.get_bottom(id) \u2192 series[float]
box.get_left()
box.get_left(id) \u2192 series[integer]
box.get_right()
box.get_right(id) \u2192 series[integer]
box.get_top()
box.get_top(id) \u2192 series[float]
box.new()
box.new(left, top, right, bottom, border_color, border_width, border_style, extend, xloc, bgcolor) \u2192 series[box]
var\u00a0b\u00a0=\u00a0box.new(time,\u00a0open,\u00a0time\u00a0+\u00a060\u00a0*\u00a060\u00a0*\u00a024,\u00a0close,\u00a0xloc=xloc.bar_time,\u00a0border_style=line.style_dashed)
box.set_lefttop(b,\u00a0time,\u00a0100)
box.set_rightbottom(b,\u00a0time\u00a0+\u00a060\u00a0*\u00a060\u00a0*\u00a024,\u00a0500)
box.set_bgcolor(b,\u00a0color.green)box.set_bgcolor()
box.set_bgcolor(id, color) \u2192 void
box.set_border_color()
box.set_border_color(id, color) \u2192 void
box.set_border_style()
box.set_border_style(id, style) \u2192 void
box.set_border_width()
box.set_border_width(id, width) \u2192 void
box.set_bottom()
box.set_bottom(id, bottom) \u2192 void
box.set_extend()
box.set_extend(id, extend) \u2192 void
box.set_left()
box.set_left(id, left) \u2192 void
box.set_lefttop()
box.set_lefttop(id, left, top) \u2192 void
box.set_right()
box.set_right(id, right) \u2192 void
box.set_rightbottom()
box.set_rightbottom(id, right, bottom) \u2192 void
box.set_top()
box.set_top(id, top) \u2192 void
cci()
cci(source, length) \u2192 series[float]
change()
change(source, length) \u2192 series[float]
change(source) \u2192 series[float]
cmo()
cmo(series, length) \u2192 series[float]
study('My\u00a0Script')
plot(cmo(close,\u00a05),\u00a0color=color.yellow)
//\u00a0the\u00a0same\u00a0on\u00a0pine
f_cmo(src,\u00a0length)\u00a0=>
\u00a0\u00a0\u00a0\u00a0float\u00a0mom\u00a0=\u00a0change(src)
\u00a0\u00a0\u00a0\u00a0float\u00a0sm1\u00a0=\u00a0sum((mom\u00a0>=\u00a00)\u00a0?\u00a0mom\u00a0:\u00a00.0,\u00a0length)
\u00a0\u00a0\u00a0\u00a0float\u00a0sm2\u00a0=\u00a0sum((mom\u00a0>=\u00a00)\u00a0?\u00a00.0\u00a0:\u00a0-mom,\u00a0length)
\u00a0\u00a0\u00a0\u00a0return\u00a0=\u00a0100\u00a0*\u00a0(sm1\u00a0-\u00a0sm2)\u00a0/\u00a0(sm1\u00a0+\u00a0sm2)
plot(f_cmo(close,\u00a05))cog()
cog(source, length) \u2192 series[float]
plot(cog(close,\u00a010))
//\u00a0the\u00a0same\u00a0on\u00a0pine
pine_cog(source,\u00a0length)\u00a0=>
\u00a0\u00a0\u00a0\u00a0sum\u00a0=\u00a0sum(source,\u00a0length)
\u00a0\u00a0\u00a0\u00a0num\u00a0=\u00a00.0
\u00a0\u00a0\u00a0\u00a0for\u00a0i\u00a0=\u00a00\u00a0to\u00a0length\u00a0-\u00a01
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0price\u00a0=\u00a0source[i]
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0num\u00a0:=\u00a0num\u00a0+\u00a0price\u00a0*\u00a0(i\u00a0+\u00a01)
\u00a0\u00a0\u00a0\u00a0-num\u00a0/\u00a0sum
plot(pine_cog(close,\u00a010))color.b()
color.b(color) \u2192 series[float]
color.b(color) \u2192 const float
color.b(color) \u2192 input float
color.b(color.blue)color.from_gradient()
color.from_gradient(value, bottom_value, top_value, bottom_color, top_color) \u2192 series[color]
color1\u00a0=\u00a0color.from_gradient(close,\u00a0high,\u00a0low,\u00a0color.yellow,\u00a0color.lime)
color2\u00a0=\u00a0color.from_gradient(rsi(close,\u00a07),\u00a00,\u00a0100,\u00a0color.rgb(255,\u00a00,\u00a00),\u00a0color.rgb(0,\u00a0255,\u00a00,\u00a050))
plot(close,\u00a0color=color1)
plot(rsi(close,7),\u00a0color=color2)color.g()
color.g(color) \u2192 series[float]
color.g(color) \u2192 const float
color.g(color) \u2192 input float
color.g(color.green)color.new()
color.new(color, transp) \u2192 const color
color.new(color, transp) \u2192 series[color]
color.new(color, transp) \u2192 input color
color.new(color.red,\u00a050)color.r()
color.r(color) \u2192 series[float]
color.r(color) \u2192 const float
color.r(color) \u2192 input float
color.r(color.red)color.rgb()
color.rgb(red, green, blue, transp) \u2192 series[color]
color.rgb(red, green, blue, transp) \u2192 const color
color.rgb(red, green, blue, transp) \u2192 input color
color.rgb(255,\u00a00,\u00a00,\u00a050)color.t()
color.t(color) \u2192 series[float]
color.t(color) \u2192 const float
color.t(color) \u2192 input float
color.t(color.new(color.red,\u00a050))correlation()
correlation(source_a, source_b, length) \u2192 series[float]
cos()
cos(x) \u2192 float
cos(x) \u2192 input float
cos(x) \u2192 const float
cos(x) \u2192 series[float]
crossover()
x-series is defined as having crossed over y-series if the value of x is greater than the value of y and the value of x was less than the value of y on the bar immediately preceding the current bar.crossover(x, y) \u2192 series[bool]
x.y.x-series is defined as having crossed over y-series if the value of x is greater than the value of y and the value of x was less than the value of y on the bar immediately preceding the current bar.",
+ "arguments": [
+ {
+ "argument": "x",
+ "type": "float"
+ },
+ {
+ "argument": "y",
+ "type": "float"
+ }
+ ],
+ "syntax": "crossover(x, y) \u2192 series[bool]",
+ "returnType": "series[bool]",
+ "returns": ""
+ },
+ {
+ "name": "crossunder()",
+ "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_crossunder",
+ "fragment": "fun_crossunder",
+ "info": "crossunder()
x-series is defined as having crossed under y-series if the value of x is less than the value of y and the value of x was greater than the value of y on the bar immediately preceding the current bar.crossunder(x, y) \u2192 series[bool]
x.y.x-series is defined as having crossed under y-series if the value of x is less than the value of y and the value of x was greater than the value of y on the bar immediately preceding the current bar.",
+ "arguments": [
+ {
+ "argument": "x",
+ "type": "float"
+ },
+ {
+ "argument": "y",
+ "type": "float"
+ }
+ ],
+ "syntax": "crossunder(x, y) \u2192 series[bool]",
+ "returnType": "series[bool]",
+ "returns": ""
+ },
+ {
+ "name": "cum()",
+ "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_cum",
+ "fragment": "fun_cum",
+ "info": "cum()
cum(x) \u2192 series[float]
dayofmonth()
dayofmonth(time) \u2192 series[integer]
dayofmonth(time, timezone) \u2192 series[integer]
dayofweek()
dayofweek(time) \u2192 series[integer]
dayofweek(time, timezone) \u2192 series[integer]
dev()
dev(source, length) \u2192 series[float]
plot(dev(close,\u00a010))
//\u00a0the\u00a0same\u00a0on\u00a0pine
pine_dev(source,\u00a0length)\u00a0=>
\u00a0\u00a0\u00a0\u00a0mean\u00a0=\u00a0sma(source,\u00a0length)
\u00a0\u00a0\u00a0\u00a0sum\u00a0=\u00a00.0
\u00a0\u00a0\u00a0\u00a0for\u00a0i\u00a0=\u00a00\u00a0to\u00a0length\u00a0-\u00a01
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val\u00a0=\u00a0source[i]
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0sum\u00a0:=\u00a0sum\u00a0+\u00a0abs(val\u00a0-\u00a0mean)
\u00a0\u00a0\u00a0\u00a0dev\u00a0=\u00a0sum/length
plot(pine_dev(close,\u00a010))dividends()
dividends(ticker, field, gaps, lookahead, ignore_invalid_symbol) \u2192 series[float]
s1\u00a0=\u00a0dividends(\"NASDAQ:BELFA\")
plot(s1)
s2\u00a0=\u00a0dividends(\"NASDAQ:BELFA\",\u00a0dividends.net,\u00a0gaps=barmerge.gaps_on,\u00a0lookahead=barmerge.lookahead_on)
plot(s2)dmi()
dmi(diLength, adxSmoothing) \u2192 [series[float], series[float], series[float]]
study(title=\"Directional\u00a0Movement\u00a0Index\",\u00a0shorttitle=\"DMI\",\u00a0format=format.price,\u00a0precision=4)
len\u00a0=\u00a0input(17,\u00a0minval=1,\u00a0title=\"DI\u00a0Length\")
lensig\u00a0=\u00a0input(14,\u00a0title=\"ADX\u00a0Smoothing\",\u00a0minval=1,\u00a0maxval=50)
[diplus,\u00a0diminus,\u00a0adx]\u00a0=\u00a0dmi(len,\u00a0lensig)
plot(adx,\u00a0color=color.red,\u00a0title=\"ADX\")
plot(diplus,\u00a0color=color.blue,\u00a0title=\"+DI\")
plot(diminus,\u00a0color=color.orange,\u00a0title=\"-DI\")earnings()
earnings(ticker, field, gaps, lookahead, ignore_invalid_symbol) \u2192 series[float]
s1\u00a0=\u00a0earnings(\"NASDAQ:BELFA\")
plot(s1)
s2\u00a0=\u00a0earnings(\"NASDAQ:BELFA\",\u00a0earnings.actual,\u00a0gaps=barmerge.gaps_on,\u00a0lookahead=barmerge.lookahead_on)
plot(s2)ema()
ema(source, length) \u2192 series[float]
plot(ema(close,\u00a015))
//the\u00a0same\u00a0on\u00a0pine
pine_ema(src,\u00a0length)\u00a0=>
\u00a0\u00a0\u00a0\u00a0alpha\u00a0=\u00a02\u00a0/\u00a0(length\u00a0+\u00a01)
\u00a0\u00a0\u00a0\u00a0sum\u00a0=\u00a00.0
\u00a0\u00a0\u00a0\u00a0sum\u00a0:=\u00a0na(sum[1])\u00a0?\u00a0sma(src,\u00a0length)\u00a0:\u00a0alpha\u00a0*\u00a0src\u00a0+\u00a0(1\u00a0-\u00a0alpha)\u00a0*\u00a0nz(sum[1])
plot(pine_ema(close,15))exp()
exp(x) \u2192 float
exp(x) \u2192 input float
exp(x) \u2192 const float
exp(x) \u2192 series[float]
falling()
falling(source, length) \u2192 series[bool]
fill()
fill(hline1, hline2, color, transp, title, editable, fillgaps) \u2192 void
fill(plot1, plot2, color, transp, title, editable, show_last, fillgaps) \u2192 void
h1\u00a0=\u00a0hline(20)
h2\u00a0=\u00a0hline(10)
fill(h1,\u00a0h2)
p1\u00a0=\u00a0plot(open)
p2\u00a0=\u00a0plot(close)
fill(p1,\u00a0p2,\u00a0color=color.green)financial()
financial(symbol, financial_id, period, gaps, ignore_invalid_symbol) \u2192 series[float]
f\u00a0=\u00a0financial(\"NASDAQ:MSFT\",\u00a0\"ACCOUNTS_PAYABLE\",\u00a0\"FY\")
plot(f)heikinashi()
heikinashi(symbol) \u2192 string
heikinashi_close\u00a0=\u00a0security(heikinashi(syminfo.tickerid),\u00a0timeframe.period,\u00a0close)
heikinashi_aapl_60_close\u00a0=\u00a0security(heikinashi(\"AAPL\"),\u00a0\"60\",\u00a0close)highest()
highest(source, length) \u2192 series[float]
highest(length) \u2192 series[float]
highestbars()
highestbars(source, length) \u2192 series[integer]
highestbars(length) \u2192 series[integer]
hline()
hline(price, title, color, linestyle, linewidth, editable) \u2192 hline
hline(3.14,\u00a0title='Pi',\u00a0color=color.blue,\u00a0linestyle=hline.style_dotted,\u00a0linewidth=2)
//\u00a0You\u00a0may\u00a0fill\u00a0the\u00a0background\u00a0between\u00a0any\u00a0two\u00a0hlines\u00a0with\u00a0a\u00a0fill()\u00a0function:
h1\u00a0=\u00a0hline(20)
h2\u00a0=\u00a0hline(10)
fill(h1,\u00a0h2)hma()
hma(source, length) \u2192 series[float]
study(\"Hull\u00a0Moving\u00a0Average\")
src\u00a0=\u00a0input(defval=close,\u00a0type=input.source,\u00a0title=\"Source\")
length\u00a0=\u00a0input(defval=9,\u00a0type=input.integer,\u00a0title=\"Length\")
hmaBuildIn\u00a0=\u00a0hma(src,\u00a0length)
plot(hmaBuildIn,\u00a0title=\"Hull\u00a0MA\",\u00a0color=#674EA7)hour()
hour(time) \u2192 series[integer]
hour(time, timezone) \u2192 series[integer]
iff()
iff(condition, then, _else) \u2192 bool
iff(condition, then, _else) \u2192 integer
iff(condition, then, _else) \u2192 float
iff(condition, then, _else) \u2192 color
iff(condition, then, _else) \u2192 series[float]
iff(condition, then, _else) \u2192 series[integer]
iff(condition, then, _else) \u2192 series[color]
iff(condition, then, _else) \u2192 string
iff(condition, then, _else) \u2192 input bool
iff(condition, then, _else) \u2192 input integer
iff(condition, then, _else) \u2192 input float
iff(condition, then, _else) \u2192 input string
iff(condition, then, _else) \u2192 input color
iff(condition, then, _else) \u2192 const bool
iff(condition, then, _else) \u2192 const integer
iff(condition, then, _else) \u2192 const float
iff(condition, then, _else) \u2192 const string
iff(condition, then, _else) \u2192 const color
iff(condition, then, _else) \u2192 series[bool]
iff(condition, then, _else) \u2192 series[string]
iff(condition, then, _else) \u2192 series[line]
iff(condition, then, _else) \u2192 series[label]
iff(condition, then, _else) \u2192 series[table]
iff(condition, then, _else) \u2192 series[box]
iff(condition, then, _else) \u2192 array[<array_type>]
_else argument if you do not need 'else' branch.//\u00a0Draw\u00a0circles\u00a0at\u00a0the\u00a0bars\u00a0where\u00a0open\u00a0crosses\u00a0close
s1\u00a0=\u00a0iff(cross(open,\u00a0close),\u00a0avg(open,close),\u00a0na)
plot(s1,\u00a0style=plot.style_circles,\u00a0linewidth=4,\u00a0color=color.green)input()
input(defval, title, type, confirm, tooltip, inline, group) \u2192 input bool
input(defval, title, type, confirm, tooltip, inline, group) \u2192 input color
input(defval, title, type, minval, maxval, confirm, step, options, tooltip, inline, group) \u2192 input integer
input(defval, title, type, minval, maxval, confirm, step, options, tooltip, inline, group) \u2192 input float
input(defval, title, type, confirm, options, tooltip, inline, group) \u2192 input string
input(defval, title, type, inline, group, tooltip) \u2192 series[float]
b\u00a0=\u00a0input(title=\"On/Off\",\u00a0type=input.bool,\u00a0defval=true)
plot(b\u00a0?\u00a0open\u00a0:\u00a0na)
i\u00a0=\u00a0input(title=\"Offset\",\u00a0type=input.integer,\u00a0defval=7,\u00a0minval=-10,\u00a0maxval=10)
plot(offset(close,\u00a0i))
f\u00a0=\u00a0input(title=\"Angle\",\u00a0type=input.float,\u00a0defval=-0.5,\u00a0minval=-3.14,\u00a0maxval=3.14,\u00a0step=0.02)
plot(sin(f)\u00a0>\u00a00\u00a0?\u00a0close\u00a0:\u00a0open)
sym\u00a0=\u00a0input(title=\"Symbol\",\u00a0type=input.symbol,\u00a0defval=\"DELL\")
res\u00a0=\u00a0input(title=\"Resolution\",\u00a0type=input.resolution,\u00a0defval=\"60\")
c\u00a0=\u00a0input(title=\"Plot\u00a0Color\",\u00a0type=input.color,\u00a0defval=color.red)
plot(close,\u00a0color=c)
plot(security(sym,\u00a0res,\u00a0close),\u00a0color=color.green)
s\u00a0=\u00a0input(title=\"Session\",\u00a0defval=\"24x7\",\u00a0options=[\"24x7\",\u00a0\"0900-1300\",\u00a0\"1300-1700\",\u00a0\"1700-2100\"])
plot(time(timeframe.period,\u00a0s))
src\u00a0=\u00a0input(title=\"Source\",\u00a0type=input.source,\u00a0defval=close)
plot(src)
date1\u00a0=\u00a0input(title=\"Date\",\u00a0type=input.time,\u00a0defval=timestamp(\"20\u00a0Feb\u00a02020\u00a000:00\u00a0+0300\"))
plot(date1)
date2\u00a0=\u00a0input(title=\"Date\",\u00a0type=input.time,\u00a0defval=timestamp(\"2020-02-20T00:00+03:00\"))
plot(date2)kagi()
kagi(symbol, reversal) \u2192 string
kagi_tickerid\u00a0=\u00a0kagi(syminfo.tickerid,\u00a03)
kagi_close\u00a0=\u00a0security(kagi_tickerid,\u00a0timeframe.period,\u00a0close)
plot(kagi_close)kc()
kc(series, length, mult) \u2192 [series[float], series[float], series[float]]
kc(series, length, mult, useTrueRange) \u2192 [series[float], series[float], series[float]]
//@version=4
study('My\u00a0Script')
[middle,\u00a0upper,\u00a0lower]\u00a0=\u00a0kc(close,\u00a05,\u00a04)
plot(middle,\u00a0color=color.yellow)
plot(upper,\u00a0color=color.yellow)
plot(lower,\u00a0color=color.yellow)
//\u00a0the\u00a0same\u00a0on\u00a0pine
f_kc(src,\u00a0length,\u00a0mult,\u00a0useTrueRange)\u00a0=>
\u00a0\u00a0\u00a0\u00a0float\u00a0basis\u00a0=\u00a0ema(src,\u00a0length)
\u00a0\u00a0\u00a0\u00a0float\u00a0range\u00a0=\u00a0(useTrueRange)\u00a0?\u00a0tr\u00a0:\u00a0(high\u00a0-\u00a0low)
\u00a0\u00a0\u00a0\u00a0float\u00a0rangeEma\u00a0=\u00a0ema(range,\u00a0length)
\u00a0\u00a0\u00a0\u00a0[basis,\u00a0basis\u00a0+\u00a0rangeEma\u00a0*\u00a0mult,\u00a0basis\u00a0-\u00a0rangeEma\u00a0*\u00a0mult]
\u00a0\u00a0\u00a0\u00a0
[pineMiddle,\u00a0pineUpper,\u00a0pineLower]\u00a0=\u00a0f_kc(close,\u00a05,\u00a04,\u00a0true)
plot(pineMiddle)
plot(pineUpper)
plot(pineLower)kcw()
kcw(series, length, mult) \u2192 series[float]
kcw(series, length, mult, useTrueRange) \u2192 series[float]
//@version=4
study('My\u00a0Script')
plot(kcw(close,\u00a05,\u00a04),\u00a0color=color.yellow)
//\u00a0the\u00a0same\u00a0on\u00a0pine
f_kcw(src,\u00a0length,\u00a0mult,\u00a0useTrueRange)\u00a0=>
\u00a0\u00a0\u00a0\u00a0float\u00a0basis\u00a0=\u00a0ema(src,\u00a0length)
\u00a0\u00a0\u00a0\u00a0float\u00a0range\u00a0=\u00a0(useTrueRange)\u00a0?\u00a0tr\u00a0:\u00a0(high\u00a0-\u00a0low)
\u00a0\u00a0\u00a0\u00a0float\u00a0rangeEma\u00a0=\u00a0ema(range,\u00a0length)
\u00a0\u00a0\u00a0\u00a0
\u00a0\u00a0\u00a0\u00a0((basis\u00a0+\u00a0rangeEma\u00a0*\u00a0mult)\u00a0-\u00a0(basis\u00a0-\u00a0rangeEma\u00a0*\u00a0mult))\u00a0/\u00a0basis
plot(f_kcw(close,\u00a05,\u00a04,\u00a0true))label.delete()
label.delete(id) \u2192 void
label.get_text()
label.get_text(id) \u2192 series[string]
my_label\u00a0=\u00a0label.new(time,\u00a0open,\u00a0text=\"Open\u00a0bar\u00a0text\",\u00a0xloc=xloc.bar_time)
a\u00a0=\u00a0label.get_text(my_label)
label.new(time,\u00a0close,\u00a0text\u00a0=\u00a0a\u00a0+\u00a0\"\u00a0new\",\u00a0xloc=xloc.bar_time)label.get_x()
label.get_x(id) \u2192 series[integer]
my_label\u00a0=\u00a0label.new(time,\u00a0open,\u00a0text=\"Open\u00a0bar\u00a0text\",\u00a0xloc=xloc.bar_time)
a\u00a0=\u00a0label.get_x(my_label)
plot(time\u00a0-\u00a0label.get_x(my_label))\u00a0//draws\u00a0zero\u00a0plotlabel.get_y()
label.get_y(id) \u2192 series[float]
label.new()
label.new(x, y, text, xloc, yloc, color, style, textcolor, size, textalign, tooltip) \u2192 series[label]
var\u00a0label1\u00a0=\u00a0label.new(bar_index,\u00a0low,\u00a0text=\"Hello,\u00a0world!\",\u00a0style=label.style_circle)
label.set_x(label1,\u00a00)
label.set_xloc(label1,\u00a0time,\u00a0xloc.bar_time)
label.set_color(label1,\u00a0color.red)
label.set_size(label1,\u00a0size.large)label.set_color()
label.set_color(id, color) \u2192 void
label.set_size()
label.set_size(id, size) \u2192 void
label.set_style()
label.set_style(id, style) \u2192 void
label.set_text()
label.set_text(id, text) \u2192 void
label.set_textalign()
label.set_textalign(id, textalign) \u2192 void
label.set_textcolor()
label.set_textcolor(id, textcolor) \u2192 void
label.set_tooltip()
label.set_tooltip(id, tooltip) \u2192 void
label.set_x()
label.set_x(id, x) \u2192 void
label.set_xloc()
label.set_xloc(id, x, xloc) \u2192 void
label.set_xy()
label.set_xy(id, x, y) \u2192 void
label.set_y()
label.set_y(id, y) \u2192 void
label.set_yloc()
label.set_yloc(id, yloc) \u2192 void
line.delete()
line.delete(id) \u2192 void
line.get_price()
line.get_price(id, x) \u2192 series[float]
//@version=4
study(\"GetPrice\",\u00a0overlay=true)
var\u00a0line\u00a0l\u00a0=\u00a0na
if\u00a0bar_index\u00a0==\u00a010
\u00a0\u00a0\u00a0\u00a0l\u00a0:=\u00a0line.new(0,\u00a0high[5],\u00a0bar_index,\u00a0high)
plot(line.get_price(l,\u00a0bar_index),\u00a0color=color.green)line.get_x1()
line.get_x1(id) \u2192 series[integer]
my_line\u00a0=\u00a0line.new(time,\u00a0open,\u00a0time\u00a0+\u00a060\u00a0*\u00a060\u00a0*\u00a024,\u00a0close,\u00a0xloc=xloc.bar_time)
a\u00a0=\u00a0line.get_x1(my_line)
plot(time\u00a0-\u00a0line.get_x1(my_line))\u00a0//draws\u00a0zero\u00a0plotline.get_x2()
line.get_x2(id) \u2192 series[integer]
line.get_y1()
line.get_y1(id) \u2192 series[float]
line.get_y2()
line.get_y2(id) \u2192 series[float]
line.new()
line.new(x1, y1, x2, y2, xloc, extend, color, style, width) \u2192 series[line]
var\u00a0line1\u00a0=\u00a0line.new(0,\u00a0low,\u00a0bar_index,\u00a0high,\u00a0extend=extend.right)
var\u00a0line2\u00a0=\u00a0line.new(time,\u00a0open,\u00a0time\u00a0+\u00a060\u00a0*\u00a060\u00a0*\u00a024,\u00a0close,\u00a0xloc=xloc.bar_time,\u00a0style=line.style_dashed)
line.set_x2(line1,\u00a00)
line.set_xloc(line1,\u00a0time,\u00a0time\u00a0+\u00a060\u00a0*\u00a060\u00a0*\u00a024,\u00a0xloc.bar_time)
line.set_color(line2,\u00a0color.green)
line.set_width(line2,\u00a05)line.set_color()
line.set_color(id, color) \u2192 void
line.set_extend()
line.set_extend(id, extend) \u2192 void
line.set_style()
line.set_style(id, style) \u2192 void
line.set_width()
line.set_width(id, width) \u2192 void
line.set_x1()
line.set_x1(id, x) \u2192 void
line.set_x2()
line.set_x2(id, x) \u2192 void
line.set_xloc()
line.set_xloc(id, x1, x2, xloc) \u2192 void
line.set_xy1()
line.set_xy1(id, x, y) \u2192 void
line.set_xy2()
line.set_xy2(id, x, y) \u2192 void
line.set_y1()
line.set_y1(id, y) \u2192 void
line.set_y2()
line.set_y2(id, y) \u2192 void
linebreak()
linebreak(symbol, number_of_lines) \u2192 string
linebreak_tickerid\u00a0=\u00a0linebreak(syminfo.tickerid,\u00a03)
linebreak_close\u00a0=\u00a0security(linebreak_tickerid,\u00a0timeframe.period,\u00a0close)
plot(linebreak_close)linreg()
linreg(source, length, offset) \u2192 series[float]
log()
y such that e^y = xlog(x) \u2192 float
log(x) \u2192 input float
log(x) \u2192 const float
log(x) \u2192 series[float]
y such that e^y = x",
+ "arguments": [],
+ "syntax": "log(x) \u2192 float",
+ "returnType": "float",
+ "returns": ""
+ },
+ {
+ "name": "log10()",
+ "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_log10",
+ "fragment": "fun_log10",
+ "info": "log10()
y such that 10^y = xlog10(x) \u2192 float
log10(x) \u2192 input float
log10(x) \u2192 const float
log10(x) \u2192 series[float]
y such that 10^y = x",
+ "arguments": [],
+ "syntax": "log10(x) \u2192 float",
+ "returnType": "float",
+ "returns": ""
+ },
+ {
+ "name": "lowest()",
+ "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_lowest",
+ "fragment": "fun_lowest",
+ "info": "lowest()
lowest(source, length) \u2192 series[float]
lowest(length) \u2192 series[float]
lowestbars()
lowestbars(source, length) \u2192 series[integer]
lowestbars(length) \u2192 series[integer]
macd()
macd(source, fastlen, slowlen, siglen) \u2192 [series[float], series[float], series[float]]
//\u00a0Example\u00a01
study('MACD')
[macdLine,\u00a0signalLine,\u00a0histLine]\u00a0=\u00a0macd(close,\u00a012,\u00a026,\u00a09)
plot(macdLine,\u00a0color=color.blue)
plot(signalLine,\u00a0color=color.orange)
plot(histLine,\u00a0color=color.red,\u00a0style=plot.style_histogram)
//\u00a0Example\u00a02
//\u00a0If\u00a0you\u00a0need\u00a0only\u00a0one\u00a0value,\u00a0use\u00a0placeholders\u00a0'_'\u00a0like\u00a0this:
study('MACD')
[_,\u00a0signalLine,\u00a0_]\u00a0=\u00a0macd(close,\u00a012,\u00a026,\u00a09)
plot(signalLine,\u00a0color=color.orange)max()
max(x1, x2, ...) -> const integer
max(x1, x2, ...) -> input integer
max(x1, x2, ...) -> integer
max(x1, x2, ...) -> series[integer]
max(x1, x2, ...) -> const float
max(x1, x2, ...) -> input float
max(x1, x2, ...) -> float
max(x1, x2, ...) -> series[float]
max(close,\u00a0open)
max(close,\u00a0max(open,\u00a042))max_bars_back()
max_bars_back(var, num) \u2192 void
//@version=4
study('My\u00a0Script')
close_()\u00a0=>\u00a0close
depth()\u00a0=>\u00a0400
d\u00a0=\u00a0depth()
v\u00a0=\u00a0close_()
max_bars_back(v,\u00a0500)
out\u00a0=\u00a0if\u00a0bar_index\u00a0>\u00a00
\u00a0\u00a0\u00a0\u00a0v[d]
else
\u00a0\u00a0\u00a0\u00a0v
plot(out)median()
median(source, length) \u2192 series[float]
median(source, length) \u2192 series[integer]
mfi()
mfi(series, length) \u2192 series[float]
//@version=4
study('My\u00a0Script')
plot(mfi(close,\u00a05),\u00a0color=color.yellow)
//\u00a0the\u00a0same\u00a0on\u00a0pine
f_mfi(src,\u00a0length)\u00a0=>
\u00a0\u00a0\u00a0\u00a0float\u00a0upper\u00a0=\u00a0sum(volume\u00a0*\u00a0(change(src)\u00a0<=\u00a00.0\u00a0?\u00a00.0\u00a0:\u00a0src),\u00a0length)
\u00a0\u00a0\u00a0\u00a0float\u00a0lower\u00a0=\u00a0sum(volume\u00a0*\u00a0(change(src)\u00a0>=\u00a00.0\u00a0?\u00a00.0\u00a0:\u00a0src),\u00a0length)
\u00a0\u00a0\u00a0\u00a0
\u00a0\u00a0\u00a0\u00a0if\u00a0na(lower)
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0float\u00a0res\u00a0=\u00a0na
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return\u00a0=\u00a0res
\u00a0\u00a0\u00a0\u00a0else
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return\u00a0=\u00a0rsi(upper,\u00a0lower)
plot(f_mfi(close,\u00a05))min()
min(x1, x2, ...) -> const integer
min(x1, x2, ...) -> input integer
min(x1, x2, ...) -> integer
min(x1, x2, ...) -> series[integer]
min(x1, x2, ...) -> const float
min(x1, x2, ...) -> input float
min(x1, x2, ...) -> float
min(x1, x2, ...) -> series[float]
min(close,\u00a0open)
min(close,\u00a0min(open,\u00a042))minute()
minute(time) \u2192 series[integer]
minute(time, timezone) \u2192 series[integer]
mode()
mode(source, length) \u2192 series[float]
mode(source, length) \u2192 series[integer]
mom()
mom(source, length) \u2192 series[float]
month()
month(time) \u2192 series[integer]
month(time, timezone) \u2192 series[integer]
nz()
nz(x, y) \u2192 integer
nz(x, y) \u2192 float
nz(x, y) \u2192 color
nz(x, y) \u2192 bool
nz(x, y) \u2192 series[integer]
nz(x, y) \u2192 series[float]
nz(x, y) \u2192 series[color]
nz(x, y) \u2192 series[bool]
nz(x) \u2192 integer
nz(x) \u2192 float
nz(x) \u2192 color
nz(x) \u2192 bool
nz(x) \u2192 series[integer]
nz(x) \u2192 series[float]
nz(x) \u2192 series[color]
nz(x) \u2192 series[bool]
nz(sma(close,\u00a0100))offset()
offset(source, offset) \u2192 series[bool]
offset(source, offset) \u2192 series[color]
offset(source, offset) \u2192 series[integer]
offset(source, offset) \u2192 series[float]
percentile_linear_interpolation()
percentile_linear_interpolation(source, length, percentage) \u2192 series[float]
percentile_nearest_rank()
percentile_nearest_rank(source, length, percentage) \u2192 series[float]
percentrank()
percentrank(source, length) \u2192 series[float]
pivothigh()
pivothigh(source, leftbars, rightbars) \u2192 series[float]
pivothigh(leftbars, rightbars) \u2192 series[float]
study(\"PivotHigh\",\u00a0overlay=true)
leftBars\u00a0=\u00a0input(2)
rightBars=input(2)
ph\u00a0=\u00a0pivothigh(leftBars,\u00a0rightBars)
plot(ph,\u00a0style=plot.style_cross,\u00a0linewidth=3,\u00a0color=\u00a0color.red,\u00a0offset=-rightBars)pivotlow()
pivotlow(source, leftbars, rightbars) \u2192 series[float]
pivotlow(leftbars, rightbars) \u2192 series[float]
study(\"PivotLow\",\u00a0overlay=true)
leftBars\u00a0=\u00a0input(2)
rightBars=input(2)
pl\u00a0=\u00a0pivotlow(close,\u00a0leftBars,\u00a0rightBars)
plot(pl,\u00a0style=plot.style_cross,\u00a0linewidth=3,\u00a0color=\u00a0color.blue,\u00a0offset=-rightBars)plot()
plot(series, title, color, linewidth, style, trackprice, transp, histbase, offset, join, editable, show_last, display) \u2192 plot
plot(high+low,\u00a0title='Title',\u00a0color=#00ffaa,\u00a0linewidth=2,\u00a0style=plot.style_area,\u00a0transp=70,\u00a0offset=15,\u00a0trackprice=true)
//\u00a0You\u00a0may\u00a0fill\u00a0the\u00a0background\u00a0between\u00a0any\u00a0two\u00a0plots\u00a0with\u00a0a\u00a0fill()\u00a0function:
p1\u00a0=\u00a0plot(open)
p2\u00a0=\u00a0plot(close)
fill(p1,\u00a0p2,\u00a0color=color.green)plotarrow()
plotarrow(series, title, colorup, colordown, transp, offset, minheight, maxheight, editable, show_last, display) \u2192 void
study(\"plotarrow\u00a0example\",\u00a0overlay=true)
codiff\u00a0=\u00a0close\u00a0-\u00a0open
plotarrow(codiff,\u00a0colorup=color.teal,\u00a0colordown=color.orange,\u00a0transp=40)plotbar()
plotbar(open, high, low, close, title, color, editable, show_last, display) \u2192 void
plotbar(open,\u00a0high,\u00a0low,\u00a0close,\u00a0title='Title',\u00a0color\u00a0=\u00a0open\u00a0<\u00a0close\u00a0?\u00a0color.green\u00a0:\u00a0color.red)plotcandle()
plotcandle(open, high, low, close, title, color, wickcolor, editable, show_last, bordercolor, display) \u2192 void
plotcandle(open,\u00a0high,\u00a0low,\u00a0close,\u00a0title='Title',\u00a0color\u00a0=\u00a0open\u00a0<\u00a0close\u00a0?\u00a0color.green\u00a0:\u00a0color.red,\u00a0wickcolor=color.black)plotchar()
plotchar(series, title, char, location, color, transp, offset, text, textcolor, editable, size, show_last, display) \u2192 void
study('plotchar\u00a0example',\u00a0overlay=true)
data\u00a0=\u00a0close\u00a0>=\u00a0open
plotchar(data,\u00a0char='\u2744')plotshape()
plotshape(series, title, style, location, color, transp, offset, text, textcolor, editable, size, show_last, display) \u2192 void
study('plotshape\u00a0example\u00a01',\u00a0overlay=true)
data\u00a0=\u00a0close\u00a0>=\u00a0open
plotshape(data,\u00a0style=shape.xcross)pointfigure()
pointfigure(symbol, source, style, param, reversal) \u2192 string
style is equal to 'ATR', or Box Size if style is equal to 'Traditional'.pnf_tickerid\u00a0=\u00a0pointfigure(syminfo.tickerid,\u00a0\"hl\",\u00a0\"Traditional\",\u00a01,\u00a03)
pnf_close\u00a0=\u00a0security(pnf_tickerid,\u00a0timeframe.period,\u00a0close)
plot(pnf_close)pow()
pow(base, exponent) \u2192 float
pow(base, exponent) \u2192 input float
pow(base, exponent) \u2192 const float
pow(base, exponent) \u2192 series[float]
pow(close,\u00a02)quandl()
quandl(ticker, gaps, index, ignore_invalid_symbol) \u2192 series[float]
f\u00a0=\u00a0quandl(\"CFTC/SB_FO_ALL\",\u00a0barmerge.gaps_off,\u00a00)
plot(f)random()
random(min, max, seed) \u2192 series[float]
range()
range(source, length) \u2192 series[float]
range(source, length) \u2192 series[integer]
renko()
renko(symbol, style, param) \u2192 string
style is equal to 'ATR', or Box Size if style is equal to 'Traditional'.renko_tickerid\u00a0=\u00a0renko(syminfo.tickerid,\u00a0\"ATR\",\u00a010)
renko_close\u00a0=\u00a0security(renko_tickerid,\u00a0timeframe.period,\u00a0close)
plot(renko_close)rising()
rising(source, length) \u2192 series[bool]
rma()
rma(source, length) \u2192 series[float]
plot(rma(close,\u00a015))
//the\u00a0same\u00a0on\u00a0pine
pine_rma(src,\u00a0length)\u00a0=>
\u00a0\u00a0\u00a0\u00a0alpha\u00a0=\u00a01/length
\u00a0\u00a0\u00a0\u00a0sum\u00a0=\u00a00.0
\u00a0\u00a0\u00a0\u00a0sum\u00a0:=\u00a0na(sum[1])\u00a0?\u00a0sma(src,\u00a0length)\u00a0:\u00a0alpha\u00a0*\u00a0src\u00a0+\u00a0(1\u00a0-\u00a0alpha)\u00a0*\u00a0nz(sum[1])
plot(pine_rma(close,\u00a015))roc()
roc(source, length) \u2192 series[float]
round()
round(x) \u2192 integer
round(x) \u2192 input integer
round(x) \u2192 const integer
round(x) \u2192 series[integer]
round(number, precision) \u2192 float
round(number, precision) \u2192 input float
round(number, precision) \u2192 const float
round(number, precision) \u2192 series[float]
round_to_mintick()
round_to_mintick(x) \u2192 float
round_to_mintick(x) \u2192 series[float]
rsi()
rsi(x, y) \u2192 series[float]
plot(rsi(close,\u00a07))
//\u00a0same\u00a0on\u00a0pine,\u00a0but\u00a0less\u00a0efficient
pine_rsi(x,\u00a0y)\u00a0=>\u00a0
\u00a0\u00a0\u00a0\u00a0u\u00a0=\u00a0max(x\u00a0-\u00a0x[1],\u00a00)\u00a0//\u00a0upward\u00a0change
\u00a0\u00a0\u00a0\u00a0d\u00a0=\u00a0max(x[1]\u00a0-\u00a0x,\u00a00)\u00a0//\u00a0downward\u00a0change
\u00a0\u00a0\u00a0\u00a0rs\u00a0=\u00a0rma(u,\u00a0y)\u00a0/\u00a0rma(d,\u00a0y)
\u00a0\u00a0\u00a0\u00a0res\u00a0=\u00a0100\u00a0-\u00a0100\u00a0/\u00a0(1\u00a0+\u00a0rs)
\u00a0\u00a0\u00a0\u00a0res
plot(pine_rsi(close,\u00a07))sar()
sar(start, inc, max) \u2192 series[float]
plot(sar(0.02,\u00a00.02,\u00a00.2),\u00a0style=plot.style_cross,\u00a0linewidth=3)
//\u00a0The\u00a0same\u00a0on\u00a0Pine
pine_sar(start,\u00a0inc,\u00a0max)\u00a0=>
\u00a0\u00a0\u00a0\u00a0var\u00a0float\u00a0result\u00a0=\u00a0na
\u00a0\u00a0\u00a0\u00a0var\u00a0float\u00a0maxMin\u00a0=\u00a0na
\u00a0\u00a0\u00a0\u00a0var\u00a0float\u00a0acceleration\u00a0=\u00a0na
\u00a0\u00a0\u00a0\u00a0var\u00a0bool\u00a0isBelow\u00a0=\u00a0na
\u00a0\u00a0\u00a0\u00a0bool\u00a0isFirstTrendBar\u00a0=\u00a0false
\u00a0\u00a0\u00a0\u00a0
\u00a0\u00a0\u00a0\u00a0if\u00a0bar_index\u00a0==\u00a01
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if\u00a0close\u00a0>\u00a0close[1]
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0isBelow\u00a0:=\u00a0true
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0maxMin\u00a0:=\u00a0high
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0result\u00a0:=\u00a0low[1]
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0else
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0isBelow\u00a0:=\u00a0false
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0maxMin\u00a0:=\u00a0low
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0result\u00a0:=\u00a0high[1]
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0isFirstTrendBar\u00a0:=\u00a0true
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0acceleration\u00a0:=\u00a0start
\u00a0\u00a0\u00a0\u00a0
\u00a0\u00a0\u00a0\u00a0result\u00a0:=\u00a0result\u00a0+\u00a0acceleration\u00a0*\u00a0(maxMin\u00a0-\u00a0result)
\u00a0\u00a0\u00a0\u00a0
\u00a0\u00a0\u00a0\u00a0if\u00a0isBelow
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if\u00a0result\u00a0>\u00a0low
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0isFirstTrendBar\u00a0:=\u00a0true
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0isBelow\u00a0:=\u00a0false
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0result\u00a0:=\u00a0max(high,\u00a0maxMin)
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0maxMin\u00a0:=\u00a0low
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0acceleration\u00a0:=\u00a0start
\u00a0\u00a0\u00a0\u00a0else
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if\u00a0result\u00a0<\u00a0high
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0isFirstTrendBar\u00a0:=\u00a0true
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0isBelow\u00a0:=\u00a0true
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0result\u00a0:=\u00a0min(low,\u00a0maxMin)
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0maxMin\u00a0:=\u00a0high
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0acceleration\u00a0:=\u00a0start
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0
\u00a0\u00a0\u00a0\u00a0if\u00a0not\u00a0isFirstTrendBar
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if\u00a0isBelow
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if\u00a0high\u00a0>\u00a0maxMin
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0maxMin\u00a0:=\u00a0high
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0acceleration\u00a0:=\u00a0min(acceleration\u00a0+\u00a0inc,\u00a0max)
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0else
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if\u00a0low\u00a0<\u00a0maxMin
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0maxMin\u00a0:=\u00a0low
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0acceleration\u00a0:=\u00a0min(acceleration\u00a0+\u00a0inc,\u00a0max)
\u00a0\u00a0\u00a0\u00a0
\u00a0\u00a0\u00a0\u00a0if\u00a0isBelow
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0result\u00a0:=\u00a0min(result,\u00a0low[1])
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if\u00a0bar_index\u00a0>\u00a01
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0result\u00a0:=\u00a0min(result,\u00a0low[2])
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0
\u00a0\u00a0\u00a0\u00a0else
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0result\u00a0:=\u00a0max(result,\u00a0high[1])
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if\u00a0bar_index\u00a0>\u00a01
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0result\u00a0:=\u00a0max(result,\u00a0high[2])
\u00a0\u00a0\u00a0\u00a0
\u00a0\u00a0\u00a0\u00a0result
\u00a0\u00a0\u00a0\u00a0
plot(pine_sar(0.02,\u00a00.02,\u00a00.2),\u00a0style=plot.style_cross,\u00a0linewidth=3)second()
second(time) \u2192 series[integer]
second(time, timezone) \u2192 series[integer]
security()
security(symbol, resolution, expression, gaps, lookahead, ignore_invalid_symbol) \u2192 series[float]
security(symbol, resolution, expression, gaps, lookahead, ignore_invalid_symbol) \u2192 series[integer]
security(symbol, resolution, expression, gaps, lookahead, ignore_invalid_symbol) \u2192 series[bool]
security(symbol, resolution, expression, gaps, lookahead, ignore_invalid_symbol) \u2192 series[color]
security(symbol, resolution, expression, gaps, lookahead, ignore_invalid_symbol) \u2192 <arg_expr_type>
s\u00a0=\u00a0security(\"MSFT\",\u00a0\"D\",\u00a0close)\u00a0//\u00a01\u00a0Day
plot(s)
expr\u00a0=\u00a0sma(close,\u00a010)
s1\u00a0=\u00a0security(\"AAPL\",\u00a0\"240\",\u00a0expr)\u00a0//\u00a0240\u00a0Minutes
plot(s1)
//\u00a0To\u00a0avoid\u00a0difference\u00a0in\u00a0calculation\u00a0on\u00a0history/realtime\u00a0you\u00a0can\u00a0request\u00a0not\u00a0latest\u00a0values\u00a0and\u00a0use\u00a0merge\u00a0strategy\u00a0flags\u00a0as\u00a0follows:
s2=security(syminfo.tickerid,\u00a0\"D\",\u00a0close[1],\u00a0barmerge.gaps_off,\u00a0barmerge.lookahead_on)
plot(s2)
f()\u00a0=>\u00a0[open,\u00a0high]
[o,\u00a0h]\u00a0=\u00a0security(syminfo.tickerid,\u00a0\"D\",\u00a0f())
[l,\u00a0c]\u00a0=\u00a0security(syminfo.tickerid,\u00a0\"D\",\u00a0[low,\u00a0close])
plot((o\u00a0+\u00a0h\u00a0+\u00a0l\u00a0+\u00a0c)\u00a0/\u00a04)sign()
sign(x) \u2192 float
sign(x) \u2192 input float
sign(x) \u2192 const float
sign(x) \u2192 series[float]
sin()
sin(x) \u2192 float
sin(x) \u2192 input float
sin(x) \u2192 const float
sin(x) \u2192 series[float]
sma()
sma(source, length) \u2192 series[float]
plot(sma(close,\u00a015))
//\u00a0same\u00a0on\u00a0pine,\u00a0but\u00a0much\u00a0less\u00a0efficient
pine_sma(x,\u00a0y)\u00a0=>
\u00a0\u00a0\u00a0\u00a0sum\u00a0=\u00a00.0
\u00a0\u00a0\u00a0\u00a0for\u00a0i\u00a0=\u00a00\u00a0to\u00a0y\u00a0-\u00a01
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0sum\u00a0:=\u00a0sum\u00a0+\u00a0x[i]\u00a0/\u00a0y
\u00a0\u00a0\u00a0\u00a0sum
plot(pine_sma(close,\u00a015))splits()
splits(ticker, field, gaps, lookahead, ignore_invalid_symbol) \u2192 series[float]
s1\u00a0=\u00a0splits(\"NASDAQ:BELFA\",\u00a0splits.denominator)
plot(s1)
s2\u00a0=\u00a0splits(\"NASDAQ:BELFA\",\u00a0splits.denominator,\u00a0gaps=barmerge.gaps_on,\u00a0lookahead=barmerge.lookahead_on)
plot(s2)sqrt()
sqrt(x) \u2192 float
sqrt(x) \u2192 input float
sqrt(x) \u2192 const float
sqrt(x) \u2192 series[float]
stdev()
stdev(source, length) \u2192 series[float]
plot(stdev(close,\u00a05))
//the\u00a0same\u00a0on\u00a0pine
isZero(val,\u00a0eps)\u00a0=>\u00a0abs(val)\u00a0<=\u00a0eps
SUM(fst,\u00a0snd)\u00a0=>
\u00a0\u00a0\u00a0\u00a0EPS\u00a0=\u00a01e-10
\u00a0\u00a0\u00a0\u00a0res\u00a0=\u00a0fst\u00a0+\u00a0snd
\u00a0\u00a0\u00a0\u00a0if\u00a0isZero(res,\u00a0EPS)
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0res\u00a0:=\u00a00
\u00a0\u00a0\u00a0\u00a0else
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if\u00a0not\u00a0isZero(res,\u00a01e-4)
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0res\u00a0:=\u00a0res
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0else
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a015
pine_stdev(src,\u00a0length)\u00a0=>
\u00a0\u00a0\u00a0\u00a0avg\u00a0=\u00a0sma(src,\u00a0length)
\u00a0\u00a0\u00a0\u00a0sumOfSquareDeviations\u00a0=\u00a00.0
\u00a0\u00a0\u00a0\u00a0for\u00a0i\u00a0=\u00a00\u00a0to\u00a0length\u00a0-\u00a01
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0sum\u00a0=\u00a0SUM(src[i],\u00a0-avg)
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0sumOfSquareDeviations\u00a0:=\u00a0sumOfSquareDeviations\u00a0+\u00a0sum\u00a0*\u00a0sum
\u00a0\u00a0\u00a0\u00a0stdev\u00a0=\u00a0sqrt(sumOfSquareDeviations\u00a0/\u00a0length)
plot(pine_stdev(close,\u00a05))stoch()
stoch(source, high, low, length) \u2192 series[float]
str.format()
str.format(formatString, arg0, arg1, ...) -> string
str.format(formatString, arg0, arg1, ...) -> series[string]
//\u00a0The\u00a0format\u00a0specifier\u00a0inside\u00a0the\u00a0curly\u00a0braces\u00a0accepts\u00a0certain\u00a0modifiers:
//\u00a0-\u00a0Specify\u00a0the\u00a0number\u00a0of\u00a0decimals\u00a0to\u00a0display:
str.format(\"{0,number,#.#}\",\u00a01.34)\u00a0//\u00a0returns:\u00a01.3
//\u00a0-\u00a0Round\u00a0a\u00a0float\u00a0value\u00a0to\u00a0an\u00a0integer:
str.format(\"{0,number,integer}\",\u00a01.34)\u00a0//\u00a0returns:\u00a01
//\u00a0-\u00a0Display\u00a0a\u00a0number\u00a0in\u00a0currency:
str.format(\"{0,number,currency}\",\u00a01.34)\u00a0//\u00a0returns:\u00a0$1.34
//\u00a0-\u00a0Display\u00a0a\u00a0number\u00a0as\u00a0a\u00a0percentage:
str.format(\"{0,number,percent}\",\u00a00.5)\u00a0//\u00a0returns:\u00a050%
//\u00a0EXAMPLES\u00a0WITH\u00a0SEVERAL\u00a0ARGUMENTS
//\u00a0returns:\u00a0Number\u00a01\u00a0is\u00a0not\u00a0equal\u00a0to\u00a04
str.format(\"Number\u00a0{0}\u00a0is\u00a0not\u00a0{1}\u00a0to\u00a0{2}\",\u00a01,\u00a0\"equal\",\u00a04)
//\u00a0returns:\u00a01.34\u00a0!=\u00a01.3
str.format(\"{0}\u00a0!=\u00a0{0,\u00a0number,\u00a0#.#}\",\u00a01.34)
//\u00a0returns:\u00a01\u00a0is\u00a0equal\u00a0to\u00a01,\u00a0but\u00a02\u00a0is\u00a0equal\u00a0to\u00a02
str.format(\"{0,\u00a0number,\u00a0integer}\u00a0is\u00a0equal\u00a0to\u00a01,\u00a0but\u00a0{1,\u00a0number,\u00a0integer}\u00a0is\u00a0equal\u00a0to\u00a02\",\u00a01.34,\u00a01.52)
//\u00a0returns:\u00a0The\u00a0cash\u00a0turnover\u00a0amounted\u00a0to\u00a0$1,340,000.00
str.format(\"The\u00a0cash\u00a0turnover\u00a0amounted\u00a0to\u00a0{0,\u00a0number,\u00a0currency}\",\u00a01340000)
//\u00a0returns:\u00a0Expected\u00a0return\u00a0is\u00a010%\u00a0-\u00a020%
str.format(\"Expected\u00a0return\u00a0is\u00a0{0,\u00a0number,\u00a0percent}\u00a0-\u00a0{1,\u00a0number,\u00a0percent}\",\u00a00.1,\u00a00.2)str.length()
str.length(string) \u2192 const integer
str.length(string) \u2192 integer
str.length(string) \u2192 series[integer]
str.replace_all()
str.replace_all(source, target, replacement) \u2192 string
str.replace_all(source, target, replacement) \u2192 series[string]
str.split()
str.split(string, separator) \u2192 string[]
strategy()
strategy(title, shorttitle, overlay, format, precision, scale, pyramiding, calc_on_order_fills, calc_on_every_tick, max_bars_back, backtest_fill_limits_assumption, default_qty_type, default_qty_value, initial_capital, currency, max_lines_count, max_labels_count, slippage, commission_type, commission_value, process_orders_on_close, close_entries_rule, margin_long, margin_short, max_boxes_count, explicit_plot_zorder) \u2192 void
true, generates an additional attempt to execute orders after a bar closes and strategy calculations are completed. If the orders are market orders, the broker emulator executes them before the next bar's open. If the orders are conditional on price, they will only be filled if the price conditions are met. This option is useful if you wish to close positions on the current bar. The default value is 'false'.false.currency. Optional. The default is 100000.strategy(title='MyStrategy')
strategy(title=\"MyStrategy\",\u00a0shorttitle=\"MS\",\u00a0pyramiding\u00a0=\u00a010)strategy.cancel()
strategy.cancel(id, when) \u2192 void
strategy(title\u00a0=\u00a0\"simple\u00a0order\u00a0cancellation\u00a0example\")
conditionForBuy\u00a0=\u00a0open\u00a0>\u00a0high[1]
strategy.entry(\"long\",\u00a0true,\u00a01,\u00a0limit\u00a0=\u00a0low,\u00a0when\u00a0=\u00a0conditionForBuy)\u00a0//\u00a0enter\u00a0long\u00a0using\u00a0limit\u00a0order\u00a0at\u00a0low\u00a0price\u00a0of\u00a0current\u00a0bar\u00a0if\u00a0conditionForBuy\u00a0is\u00a0true
strategy.cancel(\"long\",\u00a0when\u00a0=\u00a0not\u00a0conditionForBuy)\u00a0//\u00a0cancel\u00a0the\u00a0entry\u00a0order\u00a0with\u00a0name\u00a0\"long\"\u00a0if\u00a0conditionForBuy\u00a0is\u00a0falsestrategy.cancel_all()
strategy.cancel_all(when) \u2192 void
strategy(title\u00a0=\u00a0\"simple\u00a0all\u00a0orders\u00a0cancellation\u00a0example\")
conditionForBuy1\u00a0=\u00a0open\u00a0>\u00a0high[1]
strategy.entry(\"long\u00a0entry\u00a01\",\u00a0true,\u00a01,\u00a0limit\u00a0=\u00a0low,\u00a0when\u00a0=\u00a0conditionForBuy1)\u00a0//\u00a0enter\u00a0long\u00a0by\u00a0limit\u00a0if\u00a0conditionForBuy1\u00a0is\u00a0true
conditionForBuy2\u00a0=\u00a0conditionForBuy1\u00a0and\u00a0open[1]\u00a0>\u00a0high[2]
strategy.entry(\"long\u00a0entry\u00a02\",\u00a0true,\u00a01,\u00a0limit\u00a0=\u00a0lowest(low,\u00a02),\u00a0when\u00a0=\u00a0conditionForBuy2)\u00a0//\u00a0enter\u00a0long\u00a0by\u00a0limit\u00a0if\u00a0conditionForBuy2\u00a0is\u00a0true
conditionForStopTrading\u00a0=\u00a0open\u00a0<\u00a0lowest(low,\u00a02)
strategy.cancel_all(conditionForStopTrading)\u00a0//\u00a0cancel\u00a0both\u00a0limit\u00a0orders\u00a0if\u00a0the\u00a0conditon\u00a0conditionForStopTrading\u00a0is\u00a0truestrategy.close()
strategy.close(id, when, comment, qty, qty_percent, alert_message) \u2192 void
strategy(\"closeEntry\u00a0Demo\",\u00a0overlay=false)
strategy.entry(\"buy\",\u00a0true,\u00a0when\u00a0=\u00a0open\u00a0>\u00a0close)
strategy.close(\"buy\",\u00a0when\u00a0=\u00a0open\u00a0<\u00a0close,\u00a0qty_percent\u00a0=\u00a050,\u00a0comment\u00a0=\u00a0\"close\u00a0buy\u00a0entry\u00a0for\u00a050%\")
plot(strategy.position_size)strategy.close_all()
strategy.close_all(when, comment, alert_message) \u2192 void
strategy(\"closeAll\u00a0Demo\",\u00a0overlay=false)
strategy.entry(\"buy\",\u00a0true,\u00a0when\u00a0=\u00a0open\u00a0>\u00a0close)
strategy.close_all(when\u00a0=\u00a0open\u00a0<\u00a0close,\u00a0comment\u00a0=\u00a0\"close\u00a0all\u00a0entries\")
plot(strategy.position_size)strategy.entry()
strategy.entry(id, long, qty, limit, stop, oca_name, oca_type, comment, when, alert_message) \u2192 void
strategy(title\u00a0=\u00a0\"simple\u00a0gap\u00a0strategy\u00a0example\")
strategy.entry(\"enter\u00a0long\",\u00a0true,\u00a01,\u00a0when\u00a0=\u00a0open\u00a0>\u00a0high[1])\u00a0//\u00a0enter\u00a0long\u00a0by\u00a0market\u00a0if\u00a0current\u00a0open\u00a0great\u00a0then\u00a0previous\u00a0high
strategy.entry(\"enter\u00a0short\",\u00a0false,\u00a01,\u00a0when\u00a0=\u00a0open\u00a0<\u00a0low[1])\u00a0//\u00a0enter\u00a0short\u00a0by\u00a0market\u00a0if\u00a0current\u00a0open\u00a0less\u00a0then\u00a0previous\u00a0lowstrategy.exit()
strategy.exit(id, from_entry, qty, qty_percent, profit, limit, loss, stop, trail_price, trail_points, trail_offset, oca_name, comment, when, alert_message) \u2192 void
strategy(title\u00a0=\u00a0\"simple\u00a0strategy\u00a0exit\u00a0example\")
strategy.entry(\"long\",\u00a0true,\u00a01,\u00a0when\u00a0=\u00a0open\u00a0>\u00a0high[1])\u00a0//\u00a0enter\u00a0long\u00a0by\u00a0market\u00a0if\u00a0current\u00a0open\u00a0great\u00a0then\u00a0previous\u00a0high
strategy.exit(\"exit\",\u00a0\"long\",\u00a0profit\u00a0=\u00a010,\u00a0loss\u00a0=\u00a05)\u00a0//\u00a0generate\u00a0full\u00a0exit\u00a0bracket\u00a0(profit\u00a010\u00a0points,\u00a0loss\u00a05\u00a0points\u00a0per\u00a0contract)\u00a0from\u00a0entry\u00a0with\u00a0name\u00a0\"long\"strategy.order()
strategy.order(id, long, qty, limit, stop, oca_name, oca_type, comment, when, alert_message) \u2192 void
strategy(title\u00a0=\u00a0\"simple\u00a0gap\u00a0strategy\u00a0example\")
strategy.order(\"buy\",\u00a0true,\u00a01,\u00a0when\u00a0=\u00a0open\u00a0>\u00a0high[1])\u00a0//\u00a0buy\u00a0by\u00a0market\u00a0if\u00a0current\u00a0open\u00a0great\u00a0then\u00a0previous\u00a0high
strategy.order(\"sell\",\u00a0false,\u00a01,\u00a0when\u00a0=\u00a0open\u00a0<\u00a0low[1])\u00a0//\u00a0sell\u00a0by\u00a0market\u00a0if\u00a0current\u00a0open\u00a0less\u00a0then\u00a0previous\u00a0lowstrategy.risk.allow_entry_in()
strategy.risk.allow_entry_in(value) \u2192 void
strategy(\"risk.long_only\u00a0Demo\")
strategy.risk.allow_entry_in(strategy.direction.long)\u00a0//\u00a0There\u00a0will\u00a0be\u00a0no\u00a0short\u00a0entries,\u00a0only\u00a0exits\u00a0from\u00a0long.
strategy.entry(\"buy\",\u00a0true,\u00a0when\u00a0=\u00a0open\u00a0>\u00a0close)
strategy.entry(\"sell\",\u00a0false,\u00a0when\u00a0=\u00a0open\u00a0<\u00a0close)strategy.risk.max_cons_loss_days()
strategy.risk.max_cons_loss_days(count, alert_message) \u2192 void
strategy(\"risk.max_cons_loss_days\u00a0Demo\u00a01\")
strategy.risk.max_cons_loss_days(3)\u00a0//\u00a0No\u00a0orders\u00a0will\u00a0be\u00a0placed\u00a0after\u00a03\u00a0days,\u00a0if\u00a0each\u00a0day\u00a0is\u00a0with\u00a0loss.
//\u00a0...strategy.risk.max_drawdown()
strategy.risk.max_drawdown(value, type, alert_message) \u2192 void
strategy(\"risk.max_drawdown\u00a0Demo\u00a01\")
strategy.risk.max_drawdown(50,\u00a0strategy.percent_of_equity)\u00a0//\u00a0set\u00a0maximum\u00a0drawdown\u00a0to\u00a050%\u00a0of\u00a0maximum\u00a0equity
//\u00a0...\u00a0
strategy(\"risk.max_drawdown\u00a0Demo\u00a02\",\u00a0currency\u00a0=\u00a0EUR)
strategy.risk.max_drawdown(2000,\u00a0strategy.cash)\u00a0\u00a0//\u00a0set\u00a0maximum\u00a0drawdown\u00a0to\u00a02000\u00a0EUR\u00a0from\u00a0maximum\u00a0equity
//\u00a0...\u00a0strategy.risk.max_intraday_filled_orders()
strategy.risk.max_intraday_filled_orders(count, alert_message) \u2192 void
strategy(\"risk.max_intraday_filled_orders\u00a0Demo\")
strategy.risk.max_intraday_filled_orders(10)\u00a0//\u00a0After\u00a010\u00a0orders\u00a0are\u00a0filled,\u00a0no\u00a0more\u00a0strategy\u00a0orders\u00a0will\u00a0be\u00a0placed\u00a0(except\u00a0for\u00a0a\u00a0market\u00a0order\u00a0to\u00a0exit\u00a0current\u00a0open\u00a0market\u00a0position,\u00a0if\u00a0there\u00a0is\u00a0any).
strategy.entry(\"buy\",\u00a0true,\u00a0when\u00a0=\u00a0open\u00a0>\u00a0close)
strategy.entry(\"sell\",\u00a0false,\u00a0when\u00a0=\u00a0open\u00a0<\u00a0close)strategy.risk.max_intraday_loss()
strategy.risk.max_intraday_loss(value, type, alert_message) \u2192 void
strategy(\"risk.max_intraday_loss\u00a0Demo\u00a01\")
strategy.risk.max_intraday_loss(10,\u00a0strategy.percent_of_equity)\u00a0//\u00a0set\u00a0maximum\u00a0intraday\u00a0loss\u00a0to\u00a010%\u00a0of\u00a0maximum\u00a0intraday\u00a0equity
//\u00a0...\u00a0
strategy(\"risk.max_intraday_loss\u00a0Demo\u00a02\",\u00a0currency\u00a0=\u00a0EUR)
strategy.risk.max_intraday_loss(100,\u00a0strategy.cash)\u00a0//\u00a0set\u00a0maximum\u00a0intraday\u00a0loss\u00a0to\u00a0100\u00a0EUR\u00a0from\u00a0maximum\u00a0intraday\u00a0equity
//\u00a0...\u00a0strategy.risk.max_position_size()
strategy.risk.max_position_size(contracts) \u2192 void
strategy(\"risk.max_position_size\u00a0Demo\",\u00a0default_qty_value\u00a0=\u00a0100)
strategy.risk.max_position_size(10)
strategy.entry(\"buy\",\u00a0true,\u00a0when\u00a0=\u00a0open\u00a0>\u00a0close)
plot(strategy.position_size)\u00a0\u00a0//\u00a0max\u00a0plot\u00a0value\u00a0will\u00a0be\u00a010study()
study(title, shorttitle, overlay, format, precision, scale, max_bars_back, max_lines_count, max_labels_count, resolution, resolution_gaps, max_boxes_count, explicit_plot_zorder) \u2192 void
false.study(title='MyScriptStudy')
study(title=\"MyScriptStudy\",\u00a0shorttitle=\"MSS\",\u00a0precision=6,\u00a0overlay=true)supertrend()
supertrend(factor, atrPeriod) \u2192 [series[float], series[float]]
//@version=4
study(\"Supertrend\",\u00a0overlay=true)
mult\u00a0=\u00a0input(type=input.float,\u00a0defval=4)
len\u00a0=\u00a0input(type=input.integer,\u00a0defval=14)
[superTrend,\u00a0dir]\u00a0=\u00a0supertrend(mult,\u00a0len)
colResistance\u00a0=\u00a0dir\u00a0==\u00a01\u00a0and\u00a0dir\u00a0==\u00a0dir[1]\u00a0?\u00a0color.new(color.red,\u00a00)\u00a0:\u00a0color.new(color.red,\u00a0100)
colSupport\u00a0=\u00a0dir\u00a0==\u00a0-1\u00a0and\u00a0dir\u00a0==\u00a0dir[1]\u00a0?\u00a0color.new(color.green,\u00a00)\u00a0:\u00a0color.new(color.green,\u00a0100)
plot(superTrend,\u00a0color\u00a0=\u00a0colResistance,\u00a0linewidth=2)
plot(superTrend,\u00a0color\u00a0=\u00a0colSupport,\u00a0linewidth=2)swma()
swma(x) \u2192 series[float]
plot(swma(close))
//\u00a0same\u00a0on\u00a0pine,\u00a0but\u00a0less\u00a0efficient
pine_swma(x)\u00a0=>
\u00a0\u00a0\u00a0\u00a0x[3]\u00a0*\u00a01\u00a0/\u00a06\u00a0+\u00a0x[2]\u00a0*\u00a02\u00a0/\u00a06\u00a0+\u00a0x[1]\u00a0*\u00a02\u00a0/\u00a06\u00a0+\u00a0x[0]\u00a0*\u00a01\u00a0/\u00a06
plot(pine_swma(close))table.cell()
table.cell(table_id, column, row, text, width, height, text_color, text_halign, text_valign, text_size, bgcolor) \u2192 void
table.cell_set_bgcolor()
table.cell_set_bgcolor(table_id, column, row, bgcolor) \u2192 void
table.cell_set_height()
table.cell_set_height(table_id, column, row, height) \u2192 void
table.cell_set_text()
table.cell_set_text(table_id, column, row, text) \u2192 void
//@version=4
study(\"TABLE\u00a0example\")
var\u00a0tLog\u00a0=\u00a0table.new(position\u00a0=\u00a0position.top_left,\u00a0rows\u00a0=\u00a01,\u00a0columns\u00a0=\u00a02,\u00a0bgcolor\u00a0=\u00a0color.yellow,\u00a0border_width=1)
table.cell(tLog,\u00a0row\u00a0=\u00a00,\u00a0column\u00a0=\u00a00,\u00a0text\u00a0=\u00a0\"sometext\",\u00a0text_color\u00a0=\u00a0color.blue)
table.cell_set_text(tLog,\u00a0row\u00a0=\u00a00,\u00a0column\u00a0=\u00a00,\u00a0text\u00a0=\u00a0\"sometext\")table.cell_set_text_color()
table.cell_set_text_color(table_id, column, row, text_color) \u2192 void
table.cell_set_text_halign()
table.cell_set_text_halign(table_id, column, row, text_halign) \u2192 void
table.cell_set_text_size()
table.cell_set_text_size(table_id, column, row, text_size) \u2192 void
table.cell_set_text_valign()
table.cell_set_text_valign(table_id, column, row, text_valign) \u2192 void
table.cell_set_width()
table.cell_set_width(table_id, column, row, width) \u2192 void
table.clear()
table.clear(table_id, start_column, start_row, end_column, end_row) \u2192 void
//@version=4
study(\"A\u00a0donut\",\u00a0overlay=true)
if\u00a0barstate.islast
\u00a0\u00a0\u00a0\u00a0colNum\u00a0=\u00a08,\u00a0rowNum\u00a0=\u00a08
\u00a0\u00a0\u00a0\u00a0padding\u00a0=\u00a0\"\u25ef\"
\u00a0\u00a0\u00a0\u00a0donutTable\u00a0=\u00a0table.new(position.middle_right,\u00a0colNum,\u00a0rowNum)
\u00a0\u00a0\u00a0\u00a0for\u00a0c\u00a0=\u00a00\u00a0to\u00a0colNum\u00a0-\u00a01
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0for\u00a0r\u00a0=\u00a00\u00a0to\u00a0rowNum\u00a0-\u00a01
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0table.cell(donutTable,\u00a0c,\u00a0r,\u00a0text=padding,\u00a0bgcolor=#face6e,\u00a0text_color=color.new(color.black,\u00a0100))
\u00a0\u00a0\u00a0\u00a0table.clear(donutTable,\u00a02,\u00a02,\u00a05,\u00a05)table.delete()
table.delete(table_id) \u2192 void
//@version=4
study(\"table.delete\u00a0example\")
var\u00a0testTable\u00a0=\u00a0table.new(position\u00a0=\u00a0position.top_right,\u00a0columns\u00a0=\u00a02,\u00a0rows\u00a0=\u00a01,\u00a0bgcolor\u00a0=\u00a0color.yellow,\u00a0border_width\u00a0=\u00a01)
if\u00a0barstate.islast
\u00a0\u00a0\u00a0\u00a0table.cell(table_id\u00a0=\u00a0testTable,\u00a0column\u00a0=\u00a00,\u00a0row\u00a0=\u00a00,\u00a0text\u00a0=\u00a0\"Open\u00a0is\u00a0\"\u00a0+\u00a0tostring(open))
\u00a0\u00a0\u00a0\u00a0table.cell(table_id\u00a0=\u00a0testTable,\u00a0column\u00a0=\u00a01,\u00a0row\u00a0=\u00a00,\u00a0text\u00a0=\u00a0\"Close\u00a0is\u00a0\"\u00a0+\u00a0tostring(close),\u00a0bgcolor=color.teal)
if\u00a0barstate.isrealtime
\u00a0\u00a0\u00a0\u00a0table.delete(testTable)table.new()
table.new(position, columns, rows, bgcolor, frame_color, frame_width, border_color, border_width) \u2192 series[table]
//@version=4
study(\"table.new\u00a0example\")
var\u00a0testTable\u00a0=\u00a0table.new(position\u00a0=\u00a0position.top_right,\u00a0columns\u00a0=\u00a02,\u00a0rows\u00a0=\u00a01,\u00a0bgcolor\u00a0=\u00a0color.yellow,\u00a0border_width\u00a0=\u00a01)
if\u00a0barstate.islast
\u00a0\u00a0\u00a0\u00a0table.cell(table_id\u00a0=\u00a0testTable,\u00a0column\u00a0=\u00a00,\u00a0row\u00a0=\u00a00,\u00a0text\u00a0=\u00a0\"Open\u00a0is\u00a0\"\u00a0+\u00a0tostring(open))
\u00a0\u00a0\u00a0\u00a0table.cell(table_id\u00a0=\u00a0testTable,\u00a0column\u00a0=\u00a01,\u00a0row\u00a0=\u00a00,\u00a0text\u00a0=\u00a0\"Close\u00a0is\u00a0\"\u00a0+\u00a0tostring(close),\u00a0bgcolor=color.teal)table.set_bgcolor()
table.set_bgcolor(table_id, bgcolor) \u2192 void
table.set_border_color()
table.set_border_color(table_id, border_color) \u2192 void
table.set_border_width()
table.set_border_width(table_id, border_width) \u2192 void
table.set_frame_color()
table.set_frame_color(table_id, frame_color) \u2192 void
table.set_frame_width()
table.set_frame_width(table_id, frame_width) \u2192 void
table.set_position()
table.set_position(table_id, position) \u2192 void
tan()
tan(x) \u2192 float
tan(x) \u2192 input float
tan(x) \u2192 const float
tan(x) \u2192 series[float]
tickerid()
tickerid(prefix, ticker, session, adjustment) \u2192 string
study(\"tickerid\u00a0fun\",\u00a0overlay=true)\u00a0
t\u00a0=\u00a0tickerid(syminfo.prefix,\u00a0syminfo.ticker,\u00a0session.regular,\u00a0adjustment.splits)
t2\u00a0=\u00a0heikinashi(t)
c\u00a0=\u00a0security(t2,\u00a0timeframe.period,\u00a0low,\u00a0true)
plot(c,\u00a0style=plot.style_linebr)time()
time(resolution, session, timezone) \u2192 series[integer]
time(resolution, session) \u2192 series[integer]
time(resolution) \u2192 series[integer]
session argument. Can only be used when a session is specified. Optional. The default is syminfo.timezone. Can be specified in GMT notation (e.g. \"GMT-5\") or as an IANA time zone database name (e.g. \"America/New_York\").//@version=4
study(\"Time\",\u00a0overlay=true)
//\u00a0Try\u00a0this\u00a0on\u00a0chart\u00a0AAPL,1
timeinrange(res,\u00a0sess)\u00a0=>\u00a0not\u00a0na(time(res,\u00a0sess,\u00a0\"America/New_York\"))\u00a0?\u00a01\u00a0:\u00a00
plot(timeinrange(\"1\",\u00a0\"1300-1400\"),\u00a0color=color.red)
//\u00a0This\u00a0plots\u00a01.0\u00a0at\u00a0every\u00a0start\u00a0of\u00a010\u00a0minute\u00a0bar\u00a0on\u00a0a\u00a01\u00a0minute\u00a0chart:
newbar(res)\u00a0=>\u00a0change(time(res))\u00a0==\u00a00\u00a0?\u00a00\u00a0:\u00a01
plot(newbar(\"10\"))//@version=4
study(\"Time\",\u00a0overlay=true)
t1\u00a0=\u00a0time(timeframe.period,\u00a0\"0000-0000\")
bgcolor(t1\u00a0?\u00a0color.blue\u00a0:\u00a0na)//@version=4
study(\"Time\u00a0-\u00a0days\",\u00a0overlay=true)
t1\u00a0=\u00a0time(timeframe.period,\u00a0\"0000-0000:1234567\")
bgcolor(t1\u00a0?\u00a0color.green\u00a0:\u00a0na)time_close()
time_close(resolution, session, timezone) \u2192 series[integer]
time_close(resolution, session) \u2192 series[integer]
time_close(resolution) \u2192 series[integer]
session argument. Can only be used when a session is specified. Optional. The default is syminfo.timezone. Can be specified in GMT notation (e.g. \"GMT-5\") or as an IANA time zone database name (e.g. \"America/New_York\").//@version=4
study(\"Time\",\u00a0overlay=true)
t1\u00a0=\u00a0time_close(timeframe.period,\u00a0\"1200-1300\",\u00a0\"America/New_York\")
bgcolor(t1\u00a0?\u00a0color.blue\u00a0:\u00a0na)timestamp()
timestamp(dateString) \u2192 const integer
timestamp(year, month, day, hour, minute, second) \u2192 integer
timestamp(timezone, year, month, day, hour, minute, second) \u2192 integer
timestamp(year, month, day, hour, minute, second) \u2192 series[integer]
timestamp(timezone, year, month, day, hour, minute, second) \u2192 series[integer]
//@version=4
study(\"My\u00a0Script\")
plot(timestamp(2016,\u00a001,\u00a019,\u00a009,\u00a030),\u00a0linewidth=3,\u00a0color=color.green)
plot(timestamp(syminfo.timezone,\u00a02016,\u00a001,\u00a019,\u00a009,\u00a030),\u00a0color=color.blue)
plot(timestamp(2016,\u00a001,\u00a019,\u00a009,\u00a030),\u00a0color=color.yellow)
plot(timestamp(\"GMT+6\",\u00a02016,\u00a001,\u00a019,\u00a009,\u00a030))
plot(timestamp(2019,\u00a006,\u00a019,\u00a009,\u00a030,\u00a015),\u00a0color=color.lime)
plot(timestamp(\"GMT+3\",\u00a02019,\u00a006,\u00a019,\u00a009,\u00a030,\u00a015),\u00a0color=color.fuchsia)
plot(timestamp(\"Feb\u00a001\u00a02020\u00a022:10:05\"))
plot(timestamp(\"2011-10-10T14:48:00\"))
plot(timestamp(\"04\u00a0Dec\u00a01995\u00a000:12:00\u00a0GMT+5\"))todegrees()
todegrees(radians) \u2192 series[float]
tonumber()
tonumber(x) \u2192 series[float]
toradians()
toradians(degrees) \u2192 series[float]
tostring()
tostring(x) \u2192 series[string]
tostring(x, y) \u2192 series[string]
tostring(x) \u2192 string
tostring(x, y) \u2192 string
tr()
tr(handle_na) \u2192 series[float]
tsi()
tsi(source, short_length, long_length) \u2192 series[float]
valuewhen()
valuewhen(condition, source, occurrence) \u2192 series[float]
valuewhen(condition, source, occurrence) \u2192 series[integer]
slow\u00a0=\u00a0sma(close,\u00a07)
fast\u00a0=\u00a0sma(close,\u00a014)
//\u00a0get\u00a0value\u00a0of\u00a0close\u00a0on\u00a0second\u00a0cross\u00a0occurrence
valuewhen(cross(slow,\u00a0fast),\u00a0close,\u00a01)variance()
variance(source, length) \u2192 series[float]
vwap()
vwap(x) \u2192 series[float]
vwma()
vwma(source, length) \u2192 series[float]
plot(vwma(close,\u00a015))
//\u00a0same\u00a0on\u00a0pine,\u00a0but\u00a0less\u00a0efficient
pine_vwma(x,\u00a0y)\u00a0=>
\u00a0\u00a0\u00a0\u00a0sma(x\u00a0*\u00a0volume,\u00a0y)\u00a0/\u00a0sma(volume,\u00a0y)
plot(pine_vwma(close,\u00a015))weekofyear()
weekofyear(time) \u2192 series[integer]
weekofyear(time, timezone) \u2192 series[integer]
wma()
wma(source, length) \u2192 series[float]
plot(wma(close,\u00a015))
//\u00a0same\u00a0on\u00a0pine,\u00a0but\u00a0much\u00a0less\u00a0efficient
pine_wma(x,\u00a0y)\u00a0=>
\u00a0\u00a0\u00a0\u00a0norm\u00a0=\u00a00.0
\u00a0\u00a0\u00a0\u00a0sum\u00a0=\u00a00.0
\u00a0\u00a0\u00a0\u00a0for\u00a0i\u00a0=\u00a00\u00a0to\u00a0y\u00a0-\u00a01
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0weight\u00a0=\u00a0(y\u00a0-\u00a0i)\u00a0*\u00a0y
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0norm\u00a0:=\u00a0norm\u00a0+\u00a0weight
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0sum\u00a0:=\u00a0sum\u00a0+\u00a0x[i]\u00a0*\u00a0weight
\u00a0\u00a0\u00a0\u00a0sum\u00a0/\u00a0norm
plot(pine_wma(close,\u00a015))wpr()
wpr(length) \u2192 series[float]
//@version=4
study(\"Williams\u00a0%R\",\u00a0shorttitle=\"%R\",\u00a0format=format.price,\u00a0precision=2)
plot(wpr(14),\u00a0title=\"%R\",\u00a0color=#ff6d00,\u00a0transp=0)year()
year(time) \u2192 series[integer]
year(time, timezone) \u2192 series[integer]
accdist
bar_index
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)barstate.isconfirmed
barstate.isfirst
barstate.ishistory
barstate.islast
barstate.islastconfirmedhistory
barstate.isnew
barstate.isrealtime
dayofmonth
dayofweek
hour
iii
study('My\u00a0Script')
plot(iii,\u00a0color=color.yellow)
//\u00a0the\u00a0same\u00a0on\u00a0pine
f_iii()\u00a0=>
\u00a0\u00a0\u00a0\u00a0return\u00a0=\u00a0(2\u00a0*\u00a0close\u00a0-\u00a0high\u00a0-\u00a0low)\u00a0/\u00a0((high\u00a0-\u00a0low)\u00a0*\u00a0volume)
plot(f_iii())minute
month
na
bar_index\u00a0<\u00a010\u00a0?\u00a0na\u00a0:\u00a0close\u00a0\u00a0\u00a0\u00a0//\u00a0CORRECT
close\u00a0==\u00a0na\u00a0?\u00a0close[1]\u00a0:\u00a0close\u00a0\u00a0\u00a0\u00a0//\u00a0INCORRECT!
na(close)\u00a0?\u00a0close[1]\u00a0:\u00a0close\u00a0\u00a0\u00a0\u00a0//\u00a0CORRECTnvi
//@version=4
study('My\u00a0Script')
plot(nvi,\u00a0color=color.yellow)
//\u00a0the\u00a0same\u00a0on\u00a0pine
f_nvi()\u00a0=>
\u00a0\u00a0\u00a0\u00a0float\u00a0nvi\u00a0=\u00a01.0
\u00a0\u00a0\u00a0\u00a0float\u00a0prevNvi\u00a0=\u00a0(nz(nvi[1],\u00a00.0)\u00a0==\u00a00.0)\u00a0\u00a0?\u00a01.0:\u00a0nvi[1]
\u00a0\u00a0\u00a0\u00a0if\u00a0nz(close,\u00a00.0)\u00a0==\u00a00.0\u00a0or\u00a0nz(close[1],\u00a00.0)\u00a0==\u00a00.0
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0nvi\u00a0:=\u00a0prevNvi
\u00a0\u00a0\u00a0\u00a0else
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0nvi\u00a0:=\u00a0(volume\u00a0<\u00a0nz(volume[1],\u00a00.0))\u00a0?\u00a0prevNvi\u00a0+\u00a0((close\u00a0-\u00a0close[1])\u00a0/\u00a0close[1])\u00a0*\u00a0prevNvi\u00a0:\u00a0prevNvi
\u00a0\u00a0\u00a0\u00a0result\u00a0=\u00a0nvi
plot(f_nvi())obv
study('My\u00a0Script')
plot(obv,\u00a0color=color.yellow)
//\u00a0the\u00a0same\u00a0on\u00a0pine
f_obv()\u00a0=>
\u00a0\u00a0\u00a0\u00a0return\u00a0=\u00a0cum(sign(change(close))\u00a0*\u00a0volume)
plot(f_obv())pvi
//@version=4
study('My\u00a0Script')
plot(pvi,\u00a0color=color.yellow)
//\u00a0the\u00a0same\u00a0on\u00a0pine
f_pvi()\u00a0=>
\u00a0\u00a0\u00a0\u00a0float\u00a0pvi\u00a0=\u00a01.0
\u00a0\u00a0\u00a0\u00a0float\u00a0prevPvi\u00a0=\u00a0(nz(pvi[1],\u00a00.0)\u00a0==\u00a00.0)\u00a0\u00a0?\u00a01.0:\u00a0pvi[1]
\u00a0\u00a0\u00a0\u00a0if\u00a0nz(close,\u00a00.0)\u00a0==\u00a00.0\u00a0or\u00a0nz(close[1],\u00a00.0)\u00a0==\u00a00.0
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0pvi\u00a0:=\u00a0prevPvi
\u00a0\u00a0\u00a0\u00a0else
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0pvi\u00a0:=\u00a0(volume\u00a0>\u00a0nz(volume[1],\u00a00.0))\u00a0?\u00a0prevPvi\u00a0+\u00a0((close\u00a0-\u00a0close[1])\u00a0/\u00a0close[1])\u00a0*\u00a0prevPvi\u00a0:\u00a0prevPvi
\u00a0\u00a0\u00a0\u00a0result\u00a0=\u00a0pvi
plot(f_pvi())pvt
study('My\u00a0Script')
plot(pvt,\u00a0color=color.yellow)
//\u00a0the\u00a0same\u00a0on\u00a0pine
f_pvt()\u00a0=>
\u00a0\u00a0\u00a0\u00a0return\u00a0=\u00a0cum((change(close)\u00a0/\u00a0close[1])\u00a0*\u00a0volume)
plot(f_pvt())second
session.ismarket
session.ispostmarket
session.ispremarket
strategy.closedtrades
strategy.equity
strategy.eventrades
strategy.grossloss
strategy.grossprofit
strategy.initial_capital
strategy.losstrades
strategy.max_contracts_held_all
strategy.max_contracts_held_long
strategy.max_contracts_held_short
strategy.max_drawdown
strategy.netprofit
strategy.openprofit
strategy.opentrades
strategy.position_avg_price
strategy.position_entry_name
strategy.position_size
strategy.wintrades
syminfo.basecurrency
syminfo.currency
syminfo.description
syminfo.prefix
If\u00a0current\u00a0chart\u00a0symbol\u00a0is\u00a0'BATS:MSFT'\u00a0then\u00a0syminfo.prefix\u00a0is\u00a0'BATS'.syminfo.root
For\u00a0example\u00a0if\u00a0current\u00a0chart\u00a0ticker\u00a0is\u00a0'CLM2014',\u00a0would\u00a0return\u00a0'CL'.syminfo.session
syminfo.ticker
syminfo.tickerid
syminfo.type
time
dayofmonth(time) can be lower by 1 than the date of the trading day, because the bar for the current day actually opens one day prior.dayofmonth(time) can be lower by 1 than the date of the trading day, because the bar for the current day actually opens one day prior."
+ ]
+ },
+ {
+ "name": "time_close",
+ "url": "https://www.tradingview.com/pine-script-reference/v4/#var_time_close",
+ "fragment": "var_time_close",
+ "info": "time_tradingday
time, which would return the timestamp for Sunday at 17:00 for the Monday daily bar, time_tradingday will return the timestamp for Monday, 00:00.time_tradingday returns the trading day of the last day inside the bar (e.g. on 1W, it will return the last trading day of the week).time, which would return the timestamp for Sunday at 17:00 for the Monday daily bar, time_tradingday will return the timestamp for Monday, 00:00.",
+ "When used on timeframes higher than 1D, time_tradingday returns the trading day of the last day inside the bar (e.g. on 1W, it will return the last trading day of the week)."
+ ]
+ },
+ {
+ "name": "timeframe.isdaily",
+ "url": "https://www.tradingview.com/pine-script-reference/v4/#var_timeframe.isdaily",
+ "fragment": "var_timeframe.isdaily",
+ "info": "timeframe.isdaily
timeframe.isdwm
timeframe.isintraday
timeframe.isminutes
timeframe.ismonthly
timeframe.isseconds
timeframe.isweekly
timeframe.multiplier
timeframe.period
timenow
wad
study('My\u00a0Script')
plot(wad,\u00a0color=color.yellow)
//\u00a0the\u00a0same\u00a0on\u00a0pine
f_wad()\u00a0=>
\u00a0\u00a0\u00a0\u00a0trueHigh\u00a0=\u00a0max(high,\u00a0close[1])
\u00a0\u00a0\u00a0\u00a0trueLow\u00a0=\u00a0min(low,\u00a0close[1])
\u00a0\u00a0\u00a0\u00a0mom\u00a0=\u00a0change(close)
\u00a0\u00a0\u00a0\u00a0gain\u00a0=\u00a0(mom\u00a0>\u00a00)\u00a0?\u00a0close\u00a0-\u00a0trueLow\u00a0:\u00a0(mom\u00a0<\u00a00)\u00a0?\u00a0close\u00a0-\u00a0trueHigh\u00a0:\u00a00
\u00a0\u00a0\u00a0\u00a0return\u00a0=\u00a0cum(gain)
plot(f_wad())weekofyear
wvad
study('My\u00a0Script')
plot(wvad,\u00a0color=color.yellow)
//\u00a0the\u00a0same\u00a0on\u00a0pine
f_wvad()\u00a0=>
\u00a0\u00a0\u00a0\u00a0return\u00a0=\u00a0(close\u00a0-\u00a0open)\u00a0/\u00a0(high\u00a0-\u00a0low)\u00a0*\u00a0volume
plot(f_wvad())year
adjustment.dividends
adjustment.none
adjustment.splits
alert.freq_all
freq parameter of the alert() function.freq parameter of the alert() function.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "alert.freq_once_per_bar",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_alert.freq_once_per_bar",
+ "fragment": "const_alert.freq_once_per_bar",
+ "info": "alert.freq_once_per_bar
freq parameter of the alert() function.freq parameter of the alert() function.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "alert.freq_once_per_bar_close",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_alert.freq_once_per_bar_close",
+ "fragment": "const_alert.freq_once_per_bar_close",
+ "info": "alert.freq_once_per_bar_close
freq parameter of the alert() function.freq parameter of the alert() function.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "backadjustment.inherit",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_backadjustment.inherit",
+ "fragment": "const_backadjustment.inherit",
+ "info": "backadjustment.inherit
backadjustment parameter in ticker.new and ticker.modify functions.backadjustment parameter in ticker.new and ticker.modify functions.",
+ "type": "const backadjustment",
+ "remarks": ""
+ },
+ {
+ "name": "backadjustment.off",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_backadjustment.off",
+ "fragment": "const_backadjustment.off",
+ "info": "backadjustment.off
backadjustment parameter in ticker.new and ticker.modify functions.backadjustment parameter in ticker.new and ticker.modify functions.",
+ "type": "const backadjustment",
+ "remarks": ""
+ },
+ {
+ "name": "backadjustment.on",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_backadjustment.on",
+ "fragment": "const_backadjustment.on",
+ "info": "backadjustment.on
backadjustment parameter in ticker.new and ticker.modify functions.backadjustment parameter in ticker.new and ticker.modify functions.",
+ "type": "const backadjustment",
+ "remarks": ""
+ },
+ {
+ "name": "barmerge.gaps_off",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_barmerge.gaps_off",
+ "fragment": "const_barmerge.gaps_off",
+ "info": "barmerge.gaps_off
barmerge.gaps_on
barmerge.lookahead_off
barmerge.lookahead_on
color.aqua
color.black
color.blue
color.fuchsia
color.gray
color.green
color.lime
color.maroon
color.olive
color.orange
color.purple
color.red
color.silver
color.teal
color.white
color.yellow
dayofweek.friday
dayofweek.monday
dayofweek.saturday
dayofweek.sunday
dayofweek.thursday
dayofweek.tuesday
dayofweek.wednesday
display parameter of plot*() and input*() functions. Displays plotted or input values in all possible locations.",
+ "type": "const plot_simple_display",
+ "remarks": ""
+ },
+ {
+ "name": "display.data_window",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_display.data_window",
+ "fragment": "const_display.data_window",
+ "info": "display parameter of plot*() and input*() functions. Displays plotted or input values in the Data Window, a menu accessible from the chart's right sidebar.",
+ "type": "const plot_display",
+ "remarks": ""
+ },
+ {
+ "name": "display.none",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_display.none",
+ "fragment": "const_display.none",
+ "info": "display.none
display parameter of plot*() and input*() functions. plot*() functions using this will not display their plotted values anywhere. However, alert template messages and fill functions can still use the values, and they will appear in exported chart data. input*() functions using this constant will only display their values within the script's settings.display parameter of plot*() and input*() functions. plot*() functions using this will not display their plotted values anywhere. However, alert template messages and fill functions can still use the values, and they will appear in exported chart data. input*() functions using this constant will only display their values within the script's settings.",
+ "type": "const plot_simple_display",
+ "remarks": ""
+ },
+ {
+ "name": "display.pane",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_display.pane",
+ "fragment": "const_display.pane",
+ "info": "display parameter of plot*() functions. Displays plotted values in the chart pane used by the script.",
+ "type": "const plot_display",
+ "remarks": ""
+ },
+ {
+ "name": "display.price_scale",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_display.price_scale",
+ "fragment": "const_display.price_scale",
+ "info": "display parameter of plot*() functions. Displays the plot\u2019s label and value on the price scale if the chart's settings allow it.",
+ "type": "const plot_display",
+ "remarks": ""
+ },
+ {
+ "name": "display.status_line",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_display.status_line",
+ "fragment": "const_display.status_line",
+ "info": "display.status_line
display parameter of plot*() and input*() functions. Displays plotted or input values in the status line next to the script's name on the chart if the chart's settings allow it.display parameter of plot*() and input*() functions. Displays plotted or input values in the status line next to the script's name on the chart if the chart's settings allow it.",
+ "type": "const plot_display",
+ "remarks": ""
+ },
+ {
+ "name": "dividends.gross",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_dividends.gross",
+ "fragment": "const_dividends.gross",
+ "info": "dividends.gross
dividends.net
earnings.actual
earnings.estimate
earnings.standardized
false
font.family_default
font.family_monospace
format.inherit
format.mintick
format.percent
format.price
format.volume
plot*() call uses this format option, the function's precision parameter will not affect the result.hline.style_dashed
hline.style_dotted
hline.style_solid
label.style_arrowdown
label.style_arrowup
label.style_circle
label.style_cross
label.style_diamond
label.style_flag
label.style_label_center
label.style_label_down
label.style_label_left
label.style_label_lower_left
label.style_label_lower_right
label.style_label_right
label.style_label_up
label.style_label_upper_left
label.style_label_upper_right
label.style_none
label.style_square
label.style_text_outline
label.style_triangledown
label.style_triangleup
label.style_xcross
line.style_arrow_both
line.style_arrow_left
line.style_arrow_right
location.abovebar
location.belowbar
location.bottom
location.top
math.e
math.phi
math.pi
math.rphi
order.ascending
order.descending
plot.style_area
style parameter in the plot function.style parameter in the plot function.",
+ "type": "const plot_style",
+ "remarks": ""
+ },
+ {
+ "name": "plot.style_areabr",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_plot.style_areabr",
+ "fragment": "const_plot.style_areabr",
+ "info": "plot.style_areabr
style parameter in the plot function. Similar to plot.style_area, except the gaps in the data are not filled.style parameter in the plot function. Similar to plot.style_area, except the gaps in the data are not filled.",
+ "type": "const plot_style",
+ "remarks": ""
+ },
+ {
+ "name": "plot.style_circles",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_plot.style_circles",
+ "fragment": "const_plot.style_circles",
+ "info": "plot.style_circles
style parameter in the plot function.style parameter in the plot function.",
+ "type": "const plot_style",
+ "remarks": ""
+ },
+ {
+ "name": "plot.style_columns",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_plot.style_columns",
+ "fragment": "const_plot.style_columns",
+ "info": "plot.style_columns
style parameter in the plot function.style parameter in the plot function.",
+ "type": "const plot_style",
+ "remarks": ""
+ },
+ {
+ "name": "plot.style_cross",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_plot.style_cross",
+ "fragment": "const_plot.style_cross",
+ "info": "plot.style_cross
style parameter in the plot function.style parameter in the plot function.",
+ "type": "const plot_style",
+ "remarks": ""
+ },
+ {
+ "name": "plot.style_histogram",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_plot.style_histogram",
+ "fragment": "const_plot.style_histogram",
+ "info": "plot.style_histogram
style parameter in the plot function.style parameter in the plot function.",
+ "type": "const plot_style",
+ "remarks": ""
+ },
+ {
+ "name": "plot.style_line",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_plot.style_line",
+ "fragment": "const_plot.style_line",
+ "info": "plot.style_line
style parameter in the plot function.style parameter in the plot function.",
+ "type": "const plot_style",
+ "remarks": ""
+ },
+ {
+ "name": "plot.style_linebr",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_plot.style_linebr",
+ "fragment": "const_plot.style_linebr",
+ "info": "plot.style_linebr
style parameter in the plot function. Similar to plot.style_line, except the gaps in the data are not filled.style parameter in the plot function. Similar to plot.style_line, except the gaps in the data are not filled.",
+ "type": "const plot_style",
+ "remarks": ""
+ },
+ {
+ "name": "plot.style_stepline",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_plot.style_stepline",
+ "fragment": "const_plot.style_stepline",
+ "info": "plot.style_stepline
style parameter in the plot function.style parameter in the plot function.",
+ "type": "const plot_style",
+ "remarks": ""
+ },
+ {
+ "name": "plot.style_stepline_diamond",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_plot.style_stepline_diamond",
+ "fragment": "const_plot.style_stepline_diamond",
+ "info": "plot.style_stepline_diamond
style parameter in the plot function. Similar to plot.style_stepline, except the data changes are also marked with the Diamond shapes.style parameter in the plot function. Similar to plot.style_stepline, except the data changes are also marked with the Diamond shapes.",
+ "type": "const plot_style",
+ "remarks": ""
+ },
+ {
+ "name": "plot.style_steplinebr",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_plot.style_steplinebr",
+ "fragment": "const_plot.style_steplinebr",
+ "info": "plot.style_steplinebr
style parameter in the plot function.style parameter in the plot function.",
+ "type": "const plot_style",
+ "remarks": ""
+ },
+ {
+ "name": "position.bottom_center",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_position.bottom_center",
+ "fragment": "const_position.bottom_center",
+ "info": "position.bottom_center
position.bottom_left
position.bottom_right
position.middle_center
position.middle_left
position.middle_right
position.top_center
position.top_left
position.top_right
session.extended
session.regular
settlement_as_close.inherit
settlement_as_close parameter in ticker.new and ticker.modify functions.settlement_as_close parameter in ticker.new and ticker.modify functions.",
+ "type": "const settlement",
+ "remarks": ""
+ },
+ {
+ "name": "settlement_as_close.off",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_settlement_as_close.off",
+ "fragment": "const_settlement_as_close.off",
+ "info": "settlement_as_close.off
settlement_as_close parameter in ticker.new and ticker.modify functions.settlement_as_close parameter in ticker.new and ticker.modify functions.",
+ "type": "const settlement",
+ "remarks": ""
+ },
+ {
+ "name": "settlement_as_close.on",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_settlement_as_close.on",
+ "fragment": "const_settlement_as_close.on",
+ "info": "settlement_as_close.on
settlement_as_close parameter in ticker.new and ticker.modify functions.settlement_as_close parameter in ticker.new and ticker.modify functions.",
+ "type": "const settlement",
+ "remarks": ""
+ },
+ {
+ "name": "shape.arrowdown",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_shape.arrowdown",
+ "fragment": "const_shape.arrowdown",
+ "info": "",
+ "description": "Shape style for plotshape function.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "shape.arrowup",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_shape.arrowup",
+ "fragment": "const_shape.arrowup",
+ "info": "",
+ "description": "Shape style for plotshape function.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "shape.circle",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_shape.circle",
+ "fragment": "const_shape.circle",
+ "info": "",
+ "description": "Shape style for plotshape function.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "shape.cross",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_shape.cross",
+ "fragment": "const_shape.cross",
+ "info": "",
+ "description": "Shape style for plotshape function.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "shape.diamond",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_shape.diamond",
+ "fragment": "const_shape.diamond",
+ "info": "",
+ "description": "Shape style for plotshape function.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "shape.flag",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_shape.flag",
+ "fragment": "const_shape.flag",
+ "info": "",
+ "description": "Shape style for plotshape function.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "shape.labeldown",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_shape.labeldown",
+ "fragment": "const_shape.labeldown",
+ "info": "",
+ "description": "Shape style for plotshape function.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "shape.labelup",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_shape.labelup",
+ "fragment": "const_shape.labelup",
+ "info": "",
+ "description": "Shape style for plotshape function.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "shape.square",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_shape.square",
+ "fragment": "const_shape.square",
+ "info": "",
+ "description": "Shape style for plotshape function.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "shape.triangledown",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_shape.triangledown",
+ "fragment": "const_shape.triangledown",
+ "info": "",
+ "description": "Shape style for plotshape function.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "shape.triangleup",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_shape.triangleup",
+ "fragment": "const_shape.triangleup",
+ "info": "",
+ "description": "Shape style for plotshape function.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "shape.xcross",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_shape.xcross",
+ "fragment": "const_shape.xcross",
+ "info": "",
+ "description": "Shape style for plotshape function.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "size.auto",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_size.auto",
+ "fragment": "const_size.auto",
+ "info": "size.huge
size.large
size.normal
size.small
size.tiny
splits.denominator
splits.numerator
strategy.cash
default_qty_type parameter in the strategy declaration statement. It is only relevant when no value is used for the \u2018qty\u2019 parameter in strategy.entry or strategy.order function calls. It specifies that an amount of cash in the strategy.account_currency will be used to enter trades.//@version=5
strategy(\"strategy.cash\",\u00a0overlay\u00a0=\u00a0true,\u00a0default_qty_value\u00a0=\u00a050,\u00a0default_qty_type\u00a0=\u00a0strategy.cash,\u00a0initial_capital\u00a0=\u00a01000000)
if\u00a0bar_index\u00a0==\u00a00
\u00a0\u00a0\u00a0\u00a0//\u00a0As\u00a0\u2018qty\u2019\u00a0is\u00a0not\u00a0defined,\u00a0the\u00a0previously\u00a0defined\u00a0values\u00a0for\u00a0the\u00a0`default_qty_type`\u00a0and\u00a0`default_qty_value`\u00a0parameters\u00a0are\u00a0used\u00a0to\u00a0enter\u00a0trades,\u00a0namely\u00a050\u00a0units\u00a0of\u00a0cash\u00a0in\u00a0the\u00a0currency\u00a0of\u00a0`strategy.account_currency`.
\u00a0\u00a0\u00a0\u00a0//\u00a0`qty`\u00a0is\u00a0calculated\u00a0as\u00a0(default_qty_value)/(close\u00a0price).\u00a0If\u00a0current\u00a0price\u00a0is\u00a0$5,\u00a0then\u00a0qty\u00a0=\u00a050/5\u00a0=\u00a010.
\u00a0\u00a0\u00a0\u00a0strategy.entry(\"EN\",\u00a0strategy.long)
if\u00a0bar_index\u00a0==\u00a02
\u00a0\u00a0\u00a0\u00a0strategy.close(\"EN\")default_qty_type parameter in the strategy declaration statement. It is only relevant when no value is used for the \u2018qty\u2019 parameter in strategy.entry or strategy.order function calls. It specifies that an amount of cash in the strategy.account_currency will be used to enter trades.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "strategy.commission.cash_per_contract",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_strategy.commission.cash_per_contract",
+ "fragment": "const_strategy.commission.cash_per_contract",
+ "info": "strategy.commission.cash_per_contract
strategy.commission.cash_per_order
strategy.commission.percent
strategy.direction.all
strategy.direction.long
strategy.direction.short
strategy.fixed
default_qty_type parameter in the strategy declaration statement. It is only relevant when no value is used for the \u2018qty\u2019 parameter in strategy.entry or strategy.order function calls. It specifies that a number of contracts/shares/lots will be used to enter trades.//@version=5
strategy(\"strategy.fixed\",\u00a0overlay\u00a0=\u00a0true,\u00a0default_qty_value\u00a0=\u00a050,\u00a0default_qty_type\u00a0=\u00a0strategy.fixed,\u00a0initial_capital\u00a0=\u00a01000000)
if\u00a0bar_index\u00a0==\u00a00
\u00a0\u00a0\u00a0\u00a0//\u00a0As\u00a0\u2018qty\u2019\u00a0is\u00a0not\u00a0defined,\u00a0the\u00a0previously\u00a0defined\u00a0values\u00a0for\u00a0the\u00a0`default_qty_type`\u00a0and\u00a0`default_qty_value`\u00a0parameters\u00a0are\u00a0used\u00a0to\u00a0enter\u00a0trades,\u00a0namely\u00a050\u00a0contracts.
\u00a0\u00a0\u00a0\u00a0//\u00a0qty\u00a0=\u00a050
\u00a0\u00a0\u00a0\u00a0strategy.entry(\"EN\",\u00a0strategy.long)
if\u00a0bar_index\u00a0==\u00a02
\u00a0\u00a0\u00a0\u00a0strategy.close(\"EN\")default_qty_type parameter in the strategy declaration statement. It is only relevant when no value is used for the \u2018qty\u2019 parameter in strategy.entry or strategy.order function calls. It specifies that a number of contracts/shares/lots will be used to enter trades.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "strategy.long",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_strategy.long",
+ "fragment": "const_strategy.long",
+ "info": "strategy.long
direction parameter of the strategy.entry and strategy.order commands. It specifies that the command creates a buy order.direction parameter of the strategy.entry and strategy.order commands. It specifies that the command creates a buy order.",
+ "type": "const strategy_direction",
+ "remarks": ""
+ },
+ {
+ "name": "strategy.oca.cancel",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_strategy.oca.cancel",
+ "fragment": "const_strategy.oca.cancel",
+ "info": "strategy.oca.cancel
oca_type parameter of the strategy.entry and strategy.order commands. It specifies that the strategy cancels the unfilled order when another order with the same oca_name and oca_type executes.oca_* arguments, the strategy cannot fully or partially cancel either one.oca_type parameter of the strategy.entry and strategy.order commands. It specifies that the strategy cancels the unfilled order when another order with the same oca_name and oca_type executes.",
+ "type": "const string",
+ "remarks": [
+ "Strategies cannot cancel or reduce pending orders from an OCA group if they execute on the same tick. For example, if the market price triggers two stop orders from strategy.order calls with the same oca_* arguments, the strategy cannot fully or partially cancel either one."
+ ]
+ },
+ {
+ "name": "strategy.oca.none",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_strategy.oca.none",
+ "fragment": "const_strategy.oca.none",
+ "info": "strategy.oca.none
oca_type parameter of the strategy.entry and strategy.order commands. It specifies that the order executes independently of all other orders, including those with the same oca_name.oca_type parameter of the strategy.entry and strategy.order commands. It specifies that the order executes independently of all other orders, including those with the same oca_name.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "strategy.oca.reduce",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_strategy.oca.reduce",
+ "fragment": "const_strategy.oca.reduce",
+ "info": "strategy.oca.reduce
oca_type parameter of the strategy.entry and strategy.order commands. It specifies that when another order with the same oca_name and oca_type executes, the strategy reduces the unfilled order by that order's size. If the unfilled order's size reaches 0 after reduction, it is the same as canceling the order entirely.oca_* arguments, the strategy cannot fully or partially cancel either one.oca_type parameter of the strategy.entry and strategy.order commands. It specifies that when another order with the same oca_name and oca_type executes, the strategy reduces the unfilled order by that order's size. If the unfilled order's size reaches 0 after reduction, it is the same as canceling the order entirely.",
+ "type": "const string",
+ "remarks": [
+ "Strategies cannot cancel or reduce pending orders from an OCA group if they execute on the same tick. For example, if the market price triggers two stop orders from strategy.order calls with the same oca_* arguments, the strategy cannot fully or partially cancel either one.",
+ "Orders from strategy.exit automatically use this OCA type, and they belong to the same OCA group by default."
+ ]
+ },
+ {
+ "name": "strategy.percent_of_equity",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_strategy.percent_of_equity",
+ "fragment": "const_strategy.percent_of_equity",
+ "info": "strategy.percent_of_equity
default_qty_type parameter in the strategy declaration statement. It is only relevant when no value is used for the \u2018qty\u2019 parameter in strategy.entry or strategy.order function calls. It specifies that a percentage (0-100) of equity will be used to enter trades.//@version=5
strategy(\"strategy.percent_of_equity\",\u00a0overlay\u00a0=\u00a0false,\u00a0default_qty_value\u00a0=\u00a0100,\u00a0default_qty_type\u00a0=\u00a0strategy.percent_of_equity,\u00a0initial_capital\u00a0=\u00a01000000)
//\u00a0As\u00a0\u2018qty\u2019\u00a0is\u00a0not\u00a0defined,\u00a0the\u00a0previously\u00a0defined\u00a0values\u00a0for\u00a0the\u00a0`default_qty_type`\u00a0and\u00a0`default_qty_value`\u00a0parameters\u00a0are\u00a0used\u00a0to\u00a0enter\u00a0trades,\u00a0namely\u00a0100%\u00a0of\u00a0available\u00a0equity.
if\u00a0bar_index\u00a0==\u00a00
\u00a0\u00a0\u00a0\u00a0strategy.entry(\"EN\",\u00a0strategy.long)
if\u00a0bar_index\u00a0==\u00a02
\u00a0\u00a0\u00a0\u00a0strategy.close(\"EN\")
plot(strategy.equity)
\u00a0//\u00a0The\u00a0\u2018qty\u2019\u00a0parameter\u00a0is\u00a0set\u00a0to\u00a010.\u00a0Entering\u00a0position\u00a0with\u00a0fixed\u00a0size\u00a0of\u00a010\u00a0contracts\u00a0and\u00a0entry\u00a0market\u00a0price\u00a0=\u00a0(10\u00a0*\u00a0close).
if\u00a0bar_index\u00a0==\u00a04
\u00a0\u00a0\u00a0\u00a0strategy.entry(\"EN\",\u00a0strategy.long,\u00a0qty\u00a0=\u00a010)
if\u00a0bar_index\u00a0==\u00a06
\u00a0\u00a0\u00a0\u00a0strategy.close(\"EN\")default_qty_type parameter in the strategy declaration statement. It is only relevant when no value is used for the \u2018qty\u2019 parameter in strategy.entry or strategy.order function calls. It specifies that a percentage (0-100) of equity will be used to enter trades.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "strategy.short",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_strategy.short",
+ "fragment": "const_strategy.short",
+ "info": "strategy.short
direction parameter of the strategy.entry and strategy.order commands. It specifies that the command creates a sell order.direction parameter of the strategy.entry and strategy.order commands. It specifies that the command creates a sell order.",
+ "type": "const strategy_direction",
+ "remarks": ""
+ },
+ {
+ "name": "text.align_bottom",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_text.align_bottom",
+ "fragment": "const_text.align_bottom",
+ "info": "text.align_bottom
text.align_center
text.align_left
text.align_right
text.align_top
text.wrap_auto
text.wrap_none
true
xloc.bar_index
xloc = xloc.bar_index, the drawing object treats each x-coordinate as a bar_index value.xloc = xloc.bar_index, the drawing object treats each x-coordinate as a bar_index value.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "xloc.bar_time",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_xloc.bar_time",
+ "fragment": "const_xloc.bar_time",
+ "info": "xloc.bar_time
xloc = xloc.bar_time, the drawing object treats each x-coordinate as a UNIX timestamp, expressed in milliseconds.xloc = xloc.bar_time, the drawing object treats each x-coordinate as a UNIX timestamp, expressed in milliseconds.",
+ "type": "const string",
+ "remarks": ""
+ },
+ {
+ "name": "yloc.abovebar",
+ "url": "https://www.tradingview.com/pine-script-reference/v5/#const_yloc.abovebar",
+ "fragment": "const_yloc.abovebar",
+ "info": "yloc.abovebar
yloc.belowbar
yloc.price
alert()
alert(message, freq) \u2192 void
//@version=5
indicator(\"`alert()`\u00a0example\",\u00a0\"\",\u00a0true)
ma\u00a0=\u00a0ta.sma(close,\u00a014)
xUp\u00a0=\u00a0ta.crossover(close,\u00a0ma)
if\u00a0xUp
\u00a0\u00a0\u00a0\u00a0//\u00a0Trigger\u00a0the\u00a0alert\u00a0the\u00a0first\u00a0time\u00a0a\u00a0cross\u00a0occurs\u00a0during\u00a0the\u00a0real-time\u00a0bar.
\u00a0\u00a0\u00a0\u00a0alert(\"Price\u00a0(\"\u00a0+\u00a0str.tostring(close)\u00a0+\u00a0\")\u00a0crossed\u00a0over\u00a0MA\u00a0(\"\u00a0+\u00a0str.tostring(ma)\u00a0+\u00a0\u00a0\").\",\u00a0alert.freq_once_per_bar)
plot(ma)
plotchar(xUp,\u00a0\"xUp\",\u00a0\"\u25b2\",\u00a0location.top,\u00a0size\u00a0=\u00a0size.tiny)alertcondition()
alertcondition(condition, title, message) \u2192 void
//@version=5
indicator(\"alertcondition\",\u00a0overlay=true)
alertcondition(close\u00a0>=\u00a0open,\u00a0title='Alert\u00a0on\u00a0Green\u00a0Bar',\u00a0message='Green\u00a0Bar!')array.abs()
2 overloadsarray.abs(id) \u2192 array<float>
array.abs(id) \u2192 array<int>
array.avg()
2 overloadsarray.avg(id) \u2192 series float
array.avg(id) \u2192 series int
//@version=5
indicator(\"array.avg\u00a0example\")
a\u00a0=\u00a0array.new_float(0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a09
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0close[i])
plot(array.avg(a))array.binary_search()
array.binary_search(id, val) \u2192 series int
//@version=5
indicator(\"array.binary_search\")
a\u00a0=\u00a0array.from(5,\u00a0-2,\u00a00,\u00a09,\u00a01)
array.sort(a)\u00a0//\u00a0[-2,\u00a00,\u00a01,\u00a05,\u00a09]
position\u00a0=\u00a0array.binary_search(a,\u00a00)\u00a0//\u00a01
plot(position)array.binary_search_leftmost()
array.binary_search_leftmost(id, val) \u2192 series int
//@version=5
indicator(\"array.binary_search_leftmost\")
a\u00a0=\u00a0array.from(5,\u00a0-2,\u00a00,\u00a09,\u00a01)
array.sort(a)\u00a0//\u00a0[-2,\u00a00,\u00a01,\u00a05,\u00a09]
position\u00a0=\u00a0array.binary_search_leftmost(a,\u00a03)\u00a0//\u00a02
plot(position)//@version=5
indicator(\"array.binary_search_leftmost,\u00a0repetitive\u00a0elements\")
a\u00a0=\u00a0array.from(4,\u00a05,\u00a05,\u00a05)
//\u00a0Returns\u00a0the\u00a0index\u00a0of\u00a0the\u00a0first\u00a0instance.
position\u00a0=\u00a0array.binary_search_leftmost(a,\u00a05)\u00a0
plot(position)\u00a0//\u00a0Plots\u00a01array.binary_search_rightmost()
array.binary_search_rightmost(id, val) \u2192 series int
//@version=5
indicator(\"array.binary_search_rightmost\")
a\u00a0=\u00a0array.from(5,\u00a0-2,\u00a00,\u00a09,\u00a01)
array.sort(a)\u00a0//\u00a0[-2,\u00a00,\u00a01,\u00a05,\u00a09]
position\u00a0=\u00a0array.binary_search_rightmost(a,\u00a03)\u00a0//\u00a03
plot(position)//@version=5
indicator(\"array.binary_search_rightmost,\u00a0repetitive\u00a0elements\")
a\u00a0=\u00a0array.from(4,\u00a05,\u00a05,\u00a05)
//\u00a0Returns\u00a0the\u00a0index\u00a0of\u00a0the\u00a0last\u00a0instance.
position\u00a0=\u00a0array.binary_search_rightmost(a,\u00a05)\u00a0
plot(position)\u00a0//\u00a0Plots\u00a03array.clear()
array.clear(id) \u2192 void
//@version=5
indicator(\"array.clear\u00a0example\")
a\u00a0=\u00a0array.new_float(5,high)
array.clear(a)
array.push(a,\u00a0close)
plot(array.get(a,0))
plot(array.size(a))array.concat()
array.concat(id1, id2) \u2192 array<type>
//@version=5
indicator(\"array.concat\u00a0example\")
a\u00a0=\u00a0array.new_float(0,0)
b\u00a0=\u00a0array.new_float(0,0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a04
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0high[i])
\u00a0\u00a0\u00a0\u00a0array.push(b,\u00a0low[i])
c\u00a0=\u00a0array.concat(a,b)
plot(array.size(a))
plot(array.size(b))
plot(array.size(c))array.copy()
array.copy(id) \u2192 array<type>
//@version=5
indicator(\"array.copy\u00a0example\")
length\u00a0=\u00a05
a\u00a0=\u00a0array.new_float(length,\u00a0close)
b\u00a0=\u00a0array.copy(a)
a\u00a0:=\u00a0array.new_float(length,\u00a0open)
plot(array.sum(a)\u00a0/\u00a0length)
plot(array.sum(b)\u00a0/\u00a0length)array.covariance()
array.covariance(id1, id2, biased) \u2192 series float
//@version=5
indicator(\"array.covariance\u00a0example\")
a\u00a0=\u00a0array.new_float(0)
b\u00a0=\u00a0array.new_float(0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a09
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0close[i])
\u00a0\u00a0\u00a0\u00a0array.push(b,\u00a0open[i])
plot(array.covariance(a,\u00a0b))biased is true, function will calculate using a biased estimate of the entire population, if false - unbiased estimate of a sample.id array are true, false otherwise.",
+ "arguments": [
+ {
+ "argument": "id",
+ "type": "arrayarray.fill()
array.fill(id, value, index_from, index_to) \u2192 void
//@version=5
indicator(\"array.fill\u00a0example\")
a\u00a0=\u00a0array.new_float(10)
array.fill(a,\u00a0close)
plot(array.sum(a))array.first()
array.first(id) \u2192 series <type>
//@version=5
indicator(\"array.first\u00a0example\")
arr\u00a0=\u00a0array.new_int(3,\u00a010)
plot(array.first(arr))array.from()
12 overloadsarray.from(arg0, arg1, ...) \u2192 array<series enum>
array.from(arg0, arg1, ...) \u2192 array<type>
array.from(arg0, arg1, ...) \u2192 array<label>
array.from(arg0, arg1, ...) \u2192 array<line>
array.from(arg0, arg1, ...) \u2192 array<box>
array.from(arg0, arg1, ...) \u2192 array<table>
array.from(arg0, arg1, ...) \u2192 array<linefill>
array.from(arg0, arg1, ...) \u2192 array<string>
array.from(arg0, arg1, ...) \u2192 array<color>
array.from(arg0, arg1, ...) \u2192 array<int>
array.from(arg0, arg1, ...) \u2192 array<float>
array.from(arg0, arg1, ...) \u2192 array<bool>
//@version=5
indicator(\"array.from_example\",\u00a0overlay\u00a0=\u00a0false)
arr\u00a0=\u00a0array.from(\"Hello\",\u00a0\"World!\")\u00a0//\u00a0arr\u00a0(array<string>)\u00a0will\u00a0contain\u00a02\u00a0elements:\u00a0{Hello},\u00a0{World!}.
plot(close)array.get()
array.get(id, index) \u2192 series <type>
//@version=5
indicator(\"array.get\u00a0example\")
a\u00a0=\u00a0array.new_float(0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a09
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0close[i]\u00a0-\u00a0open[i])
plot(array.get(a,\u00a09))array.includes()
array.includes(id, value) \u2192 series bool
//@version=5
indicator(\"array.includes\u00a0example\")
a\u00a0=\u00a0array.new_float(5,high)
p\u00a0=\u00a0close
if\u00a0array.includes(a,\u00a0high)
\u00a0\u00a0\u00a0\u00a0p\u00a0:=\u00a0open
plot(p)array.indexof()
array.indexof(id, value) \u2192 series int
//@version=5
indicator(\"array.indexof\u00a0example\")
a\u00a0=\u00a0array.new_float(5,high)
index\u00a0=\u00a0array.indexof(a,\u00a0high)
plot(index)array.insert()
array.insert(id, index, value) \u2192 void
//@version=5
indicator(\"array.insert\u00a0example\")
a\u00a0=\u00a0array.new_float(5,\u00a0close)
array.insert(a,\u00a00,\u00a0open)
plot(array.get(a,\u00a05))array.join()
array.join(id, separator) \u2192 series string
//@version=5
indicator(\"array.join\u00a0example\")
a\u00a0=\u00a0array.new_float(5,\u00a05)
label.new(bar_index,\u00a0close,\u00a0array.join(a,\u00a0\",\"))array.last()
array.last(id) \u2192 series <type>
//@version=5
indicator(\"array.last\u00a0example\")
arr\u00a0=\u00a0array.new_int(3,\u00a010)
plot(array.last(arr))array.lastindexof()
array.lastindexof(id, value) \u2192 series int
//@version=5
indicator(\"array.lastindexof\u00a0example\")
a\u00a0=\u00a0array.new_float(5,high)
index\u00a0=\u00a0array.lastindexof(a,\u00a0high)
plot(index)array.max()
4 overloadsarray.max(id) \u2192 series float
array.max(id) \u2192 series int
array.max(id, nth) \u2192 series float
array.max(id, nth) \u2192 series int
//@version=5
indicator(\"array.max\")
a\u00a0=\u00a0array.from(5,\u00a0-2,\u00a00,\u00a09,\u00a01)
thirdHighest\u00a0=\u00a0array.max(a,\u00a02)\u00a0//\u00a01
plot(thirdHighest)array.median()
2 overloadsarray.median(id) \u2192 series float
array.median(id) \u2192 series int
//@version=5
indicator(\"array.median\u00a0example\")
a\u00a0=\u00a0array.new_float(0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a09
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0close[i])
plot(array.median(a))array.min()
4 overloadsarray.min(id) \u2192 series float
array.min(id) \u2192 series int
array.min(id, nth) \u2192 series float
array.min(id, nth) \u2192 series int
//@version=5
indicator(\"array.min\")
a\u00a0=\u00a0array.from(5,\u00a0-2,\u00a00,\u00a09,\u00a01)
secondLowest\u00a0=\u00a0array.min(a,\u00a01)\u00a0//\u00a00
plot(secondLowest)array.mode()
2 overloadsarray.mode(id) \u2192 series float
array.mode(id) \u2192 series int
//@version=5
indicator(\"array.mode\u00a0example\")
a\u00a0=\u00a0array.new_float(0)
for\u00a0i\u00a0=\u00a00\u00a0to\u00a09
\u00a0\u00a0\u00a0\u00a0array.push(a,\u00a0close[i])
plot(array.mode(a))id array. If none exists, returns the smallest value instead.array.new_bool()
array.new_bool(size, initial_value) \u2192 array<bool>
//@version=5
indicator(\"array.new_bool\u00a0example\")
length\u00a0=\u00a05
a\u00a0=\u00a0array.new_bool(length,\u00a0close\u00a0>\u00a0open)
plot(array.get(a,\u00a00)\u00a0?\u00a0close\u00a0:\u00a0open)array.new_box()
array.new_box(size, initial_value) \u2192 array<box>
//@version=5
indicator(\"array.new_box\u00a0example\")
boxes\u00a0=\u00a0array.new_box()
array.push(boxes,\u00a0box.new(time,\u00a0close,\u00a0time+2,\u00a0low,\u00a0xloc=xloc.bar_time))
plot(1)array.new_color()
array.new_color(size, initial_value) \u2192 array<color>
//@version=5
indicator(\"array.new_color\u00a0example\")
length\u00a0=\u00a05
a\u00a0=\u00a0array.new_color(length,\u00a0color.red)
plot(close,\u00a0color\u00a0=\u00a0array.get(a,\u00a00))array.new_float()
array.new_float(size, initial_value) \u2192 array<float>
//@version=5
indicator(\"array.new_float\u00a0example\")
length\u00a0=\u00a05
a\u00a0=\u00a0array.new_float(length,\u00a0close)
plot(array.sum(a)\u00a0/\u00a0length)array.new_int()
array.new_int(size, initial_value) \u2192 array<int>
//@version=5
indicator(\"array.new_int\u00a0example\")
length\u00a0=\u00a05
a\u00a0=\u00a0array.new_int(length,\u00a0int(close))
plot(array.sum(a)\u00a0/\u00a0length)array.new_label()
array.new_label(size, initial_value) \u2192 array<label>
//@version=5
indicator(\"array.new_label\u00a0example\",\u00a0overlay\u00a0=\u00a0true,\u00a0max_labels_count\u00a0=\u00a0500)
//@variable\u00a0The\u00a0number\u00a0of\u00a0labels\u00a0to\u00a0show\u00a0on\u00a0the\u00a0chart.
int\u00a0labelCount\u00a0=\u00a0input.int(50,\u00a0\"Labels\u00a0to\u00a0show\",\u00a01,\u00a0500)
//@variable\u00a0An\u00a0array\u00a0of\u00a0`label`\u00a0objects.
var\u00a0array<label>\u00a0labelArray\u00a0=\u00a0array.new_label()
//@variable\u00a0A\u00a0`chart.point`\u00a0for\u00a0the\u00a0new\u00a0label.
labelPoint\u00a0=\u00a0chart.point.from_index(bar_index,\u00a0close)
//@variable\u00a0The\u00a0text\u00a0in\u00a0the\u00a0new\u00a0label.
string\u00a0labelText\u00a0=\u00a0na
//@variable\u00a0The\u00a0color\u00a0of\u00a0the\u00a0new\u00a0label.
color\u00a0labelColor\u00a0=\u00a0na
//@variable\u00a0The\u00a0style\u00a0of\u00a0the\u00a0new\u00a0label.
string\u00a0labelStyle\u00a0=\u00a0na
//\u00a0Set\u00a0the\u00a0label\u00a0attributes\u00a0for\u00a0rising\u00a0bars.
if\u00a0close\u00a0>\u00a0open
\u00a0\u00a0\u00a0\u00a0labelText\u00a0\u00a0:=\u00a0\"Rising\"
\u00a0\u00a0\u00a0\u00a0labelColor\u00a0:=\u00a0color.green
\u00a0\u00a0\u00a0\u00a0labelStyle\u00a0:=\u00a0label.style_label_down
//\u00a0Set\u00a0the\u00a0label\u00a0attributes\u00a0for\u00a0falling\u00a0bars.
else\u00a0if\u00a0close\u00a0<\u00a0open
\u00a0\u00a0\u00a0\u00a0labelText\u00a0\u00a0:=\u00a0\"Falling\"
\u00a0\u00a0\u00a0\u00a0labelColor\u00a0:=\u00a0color.red
\u00a0\u00a0\u00a0\u00a0labelStyle\u00a0:=\u00a0label.style_label_up
//\u00a0Add\u00a0a\u00a0new\u00a0label\u00a0to\u00a0the\u00a0`labelArray`\u00a0when\u00a0the\u00a0chart\u00a0bar\u00a0closed\u00a0at\u00a0a\u00a0new\u00a0value.
if\u00a0close\u00a0!=\u00a0open
\u00a0\u00a0\u00a0\u00a0labelArray.push(label.new(labelPoint,\u00a0labelText,\u00a0color\u00a0=\u00a0labelColor,\u00a0style\u00a0=\u00a0labelStyle))
//\u00a0Remove\u00a0the\u00a0first\u00a0element\u00a0and\u00a0delete\u00a0its\u00a0label\u00a0when\u00a0the\u00a0size\u00a0of\u00a0the\u00a0`labelArray`\u00a0exceeds\u00a0the\u00a0`labelCount`.
if\u00a0labelArray.size()\u00a0>\u00a0labelCount
\u00a0\u00a0\u00a0\u00a0label.delete(labelArray.shift())