diff --git a/.gitignore b/.gitignore index a3c8b50..3bcf133 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,1790 @@ Pine Scripts PineScripts # .vsix -*.vsix \ No newline at end of file +*.vsix +.venv/pyvenv.cfg +.venv/bin/activate +.venv/bin/activate.csh +.venv/bin/activate.fish +.venv/bin/Activate.ps1 +.venv/bin/normalizer +.venv/bin/pip +.venv/bin/pip3 +.venv/bin/pip3.12 +.venv/bin/playwright +.venv/bin/python +.venv/bin/python3 +.venv/bin/python3.12 +.venv/include/site/python3.12/greenlet/greenlet.h +.venv/lib/python3.12/site-packages/typing_extensions.py +.venv/lib/python3.12/site-packages/__pycache__/typing_extensions.cpython-312.pyc +.venv/lib/python3.12/site-packages/beautifulsoup4-4.13.3.dist-info/INSTALLER +.venv/lib/python3.12/site-packages/beautifulsoup4-4.13.3.dist-info/METADATA +.venv/lib/python3.12/site-packages/beautifulsoup4-4.13.3.dist-info/RECORD +.venv/lib/python3.12/site-packages/beautifulsoup4-4.13.3.dist-info/REQUESTED +.venv/lib/python3.12/site-packages/beautifulsoup4-4.13.3.dist-info/WHEEL +.venv/lib/python3.12/site-packages/beautifulsoup4-4.13.3.dist-info/licenses/AUTHORS +.venv/lib/python3.12/site-packages/beautifulsoup4-4.13.3.dist-info/licenses/LICENSE +.venv/lib/python3.12/site-packages/bs4/__init__.py +.venv/lib/python3.12/site-packages/bs4/_deprecation.py +.venv/lib/python3.12/site-packages/bs4/_typing.py +.venv/lib/python3.12/site-packages/bs4/_warnings.py +.venv/lib/python3.12/site-packages/bs4/css.py +.venv/lib/python3.12/site-packages/bs4/dammit.py +.venv/lib/python3.12/site-packages/bs4/diagnose.py +.venv/lib/python3.12/site-packages/bs4/element.py +.venv/lib/python3.12/site-packages/bs4/exceptions.py +.venv/lib/python3.12/site-packages/bs4/filter.py +.venv/lib/python3.12/site-packages/bs4/formatter.py +.venv/lib/python3.12/site-packages/bs4/py.typed +.venv/lib/python3.12/site-packages/bs4/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/__pycache__/_deprecation.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/__pycache__/_typing.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/__pycache__/_warnings.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/__pycache__/css.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/__pycache__/dammit.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/__pycache__/diagnose.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/__pycache__/element.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/__pycache__/exceptions.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/__pycache__/filter.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/__pycache__/formatter.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/builder/__init__.py +.venv/lib/python3.12/site-packages/bs4/builder/_html5lib.py +.venv/lib/python3.12/site-packages/bs4/builder/_htmlparser.py +.venv/lib/python3.12/site-packages/bs4/builder/_lxml.py +.venv/lib/python3.12/site-packages/bs4/builder/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/builder/__pycache__/_html5lib.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/builder/__pycache__/_htmlparser.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/builder/__pycache__/_lxml.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/tests/__init__.py +.venv/lib/python3.12/site-packages/bs4/tests/test_builder_registry.py +.venv/lib/python3.12/site-packages/bs4/tests/test_builder.py +.venv/lib/python3.12/site-packages/bs4/tests/test_css.py +.venv/lib/python3.12/site-packages/bs4/tests/test_dammit.py +.venv/lib/python3.12/site-packages/bs4/tests/test_element.py +.venv/lib/python3.12/site-packages/bs4/tests/test_filter.py +.venv/lib/python3.12/site-packages/bs4/tests/test_formatter.py +.venv/lib/python3.12/site-packages/bs4/tests/test_fuzz.py +.venv/lib/python3.12/site-packages/bs4/tests/test_html5lib.py +.venv/lib/python3.12/site-packages/bs4/tests/test_htmlparser.py +.venv/lib/python3.12/site-packages/bs4/tests/test_lxml.py +.venv/lib/python3.12/site-packages/bs4/tests/test_navigablestring.py +.venv/lib/python3.12/site-packages/bs4/tests/test_pageelement.py +.venv/lib/python3.12/site-packages/bs4/tests/test_soup.py +.venv/lib/python3.12/site-packages/bs4/tests/test_tag.py +.venv/lib/python3.12/site-packages/bs4/tests/test_tree.py +.venv/lib/python3.12/site-packages/bs4/tests/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/tests/__pycache__/test_builder_registry.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/tests/__pycache__/test_builder.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/tests/__pycache__/test_css.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/tests/__pycache__/test_dammit.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/tests/__pycache__/test_element.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/tests/__pycache__/test_filter.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/tests/__pycache__/test_formatter.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/tests/__pycache__/test_fuzz.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/tests/__pycache__/test_html5lib.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/tests/__pycache__/test_htmlparser.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/tests/__pycache__/test_lxml.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/tests/__pycache__/test_navigablestring.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/tests/__pycache__/test_pageelement.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/tests/__pycache__/test_soup.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/tests/__pycache__/test_tag.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/tests/__pycache__/test_tree.cpython-312.pyc +.venv/lib/python3.12/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-4670634698080256.testcase +.venv/lib/python3.12/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-4818336571064320.testcase +.venv/lib/python3.12/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-4999465949331456.testcase +.venv/lib/python3.12/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5000587759190016.testcase +.venv/lib/python3.12/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5167584867909632.testcase +.venv/lib/python3.12/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5270998950477824.testcase +.venv/lib/python3.12/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5375146639360000.testcase +.venv/lib/python3.12/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5492400320282624.testcase +.venv/lib/python3.12/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5703933063462912.testcase +.venv/lib/python3.12/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5843991618256896.testcase +.venv/lib/python3.12/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5984173902397440.testcase +.venv/lib/python3.12/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-6124268085182464.testcase +.venv/lib/python3.12/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-6241471367348224.testcase +.venv/lib/python3.12/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-6306874195312640.testcase +.venv/lib/python3.12/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-6450958476902400.testcase +.venv/lib/python3.12/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-6600557255327744.testcase +.venv/lib/python3.12/site-packages/bs4/tests/fuzz/crash-0d306a50c8ed8bcd0785b67000fcd5dea1d33f08.testcase +.venv/lib/python3.12/site-packages/bs4/tests/fuzz/crash-ffbdfa8a2b26f13537b68d3794b0478a4090ee4a.testcase +.venv/lib/python3.12/site-packages/certifi/__init__.py +.venv/lib/python3.12/site-packages/certifi/__main__.py +.venv/lib/python3.12/site-packages/certifi/cacert.pem +.venv/lib/python3.12/site-packages/certifi/core.py +.venv/lib/python3.12/site-packages/certifi/py.typed +.venv/lib/python3.12/site-packages/certifi/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/certifi/__pycache__/__main__.cpython-312.pyc +.venv/lib/python3.12/site-packages/certifi/__pycache__/core.cpython-312.pyc +.venv/lib/python3.12/site-packages/certifi-2025.1.31.dist-info/INSTALLER +.venv/lib/python3.12/site-packages/certifi-2025.1.31.dist-info/LICENSE +.venv/lib/python3.12/site-packages/certifi-2025.1.31.dist-info/METADATA +.venv/lib/python3.12/site-packages/certifi-2025.1.31.dist-info/RECORD +.venv/lib/python3.12/site-packages/certifi-2025.1.31.dist-info/top_level.txt +.venv/lib/python3.12/site-packages/certifi-2025.1.31.dist-info/WHEEL +.venv/lib/python3.12/site-packages/charset_normalizer/__init__.py +.venv/lib/python3.12/site-packages/charset_normalizer/__main__.py +.venv/lib/python3.12/site-packages/charset_normalizer/api.py +.venv/lib/python3.12/site-packages/charset_normalizer/cd.py +.venv/lib/python3.12/site-packages/charset_normalizer/constant.py +.venv/lib/python3.12/site-packages/charset_normalizer/legacy.py +.venv/lib/python3.12/site-packages/charset_normalizer/md__mypyc.cpython-312-darwin.so +.venv/lib/python3.12/site-packages/charset_normalizer/md.cpython-312-darwin.so +.venv/lib/python3.12/site-packages/charset_normalizer/md.py +.venv/lib/python3.12/site-packages/charset_normalizer/models.py +.venv/lib/python3.12/site-packages/charset_normalizer/py.typed +.venv/lib/python3.12/site-packages/charset_normalizer/utils.py +.venv/lib/python3.12/site-packages/charset_normalizer/version.py +.venv/lib/python3.12/site-packages/charset_normalizer/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/charset_normalizer/__pycache__/__main__.cpython-312.pyc +.venv/lib/python3.12/site-packages/charset_normalizer/__pycache__/api.cpython-312.pyc +.venv/lib/python3.12/site-packages/charset_normalizer/__pycache__/cd.cpython-312.pyc +.venv/lib/python3.12/site-packages/charset_normalizer/__pycache__/constant.cpython-312.pyc +.venv/lib/python3.12/site-packages/charset_normalizer/__pycache__/legacy.cpython-312.pyc +.venv/lib/python3.12/site-packages/charset_normalizer/__pycache__/md.cpython-312.pyc +.venv/lib/python3.12/site-packages/charset_normalizer/__pycache__/models.cpython-312.pyc +.venv/lib/python3.12/site-packages/charset_normalizer/__pycache__/utils.cpython-312.pyc +.venv/lib/python3.12/site-packages/charset_normalizer/__pycache__/version.cpython-312.pyc +.venv/lib/python3.12/site-packages/charset_normalizer/cli/__init__.py +.venv/lib/python3.12/site-packages/charset_normalizer/cli/__main__.py +.venv/lib/python3.12/site-packages/charset_normalizer/cli/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/charset_normalizer/cli/__pycache__/__main__.cpython-312.pyc +.venv/lib/python3.12/site-packages/charset_normalizer-3.4.1.dist-info/entry_points.txt +.venv/lib/python3.12/site-packages/charset_normalizer-3.4.1.dist-info/INSTALLER +.venv/lib/python3.12/site-packages/charset_normalizer-3.4.1.dist-info/LICENSE +.venv/lib/python3.12/site-packages/charset_normalizer-3.4.1.dist-info/METADATA +.venv/lib/python3.12/site-packages/charset_normalizer-3.4.1.dist-info/RECORD +.venv/lib/python3.12/site-packages/charset_normalizer-3.4.1.dist-info/top_level.txt +.venv/lib/python3.12/site-packages/charset_normalizer-3.4.1.dist-info/WHEEL +.venv/lib/python3.12/site-packages/greenlet/__init__.py +.venv/lib/python3.12/site-packages/greenlet/_greenlet.cpython-312-darwin.so +.venv/lib/python3.12/site-packages/greenlet/CObjects.cpp +.venv/lib/python3.12/site-packages/greenlet/greenlet_allocator.hpp +.venv/lib/python3.12/site-packages/greenlet/greenlet_compiler_compat.hpp +.venv/lib/python3.12/site-packages/greenlet/greenlet_cpython_add_pending.hpp +.venv/lib/python3.12/site-packages/greenlet/greenlet_cpython_compat.hpp +.venv/lib/python3.12/site-packages/greenlet/greenlet_exceptions.hpp +.venv/lib/python3.12/site-packages/greenlet/greenlet_internal.hpp +.venv/lib/python3.12/site-packages/greenlet/greenlet_refs.hpp +.venv/lib/python3.12/site-packages/greenlet/greenlet_slp_switch.hpp +.venv/lib/python3.12/site-packages/greenlet/greenlet_thread_support.hpp +.venv/lib/python3.12/site-packages/greenlet/greenlet.cpp +.venv/lib/python3.12/site-packages/greenlet/greenlet.h +.venv/lib/python3.12/site-packages/greenlet/PyGreenlet.cpp +.venv/lib/python3.12/site-packages/greenlet/PyGreenlet.hpp +.venv/lib/python3.12/site-packages/greenlet/PyGreenletUnswitchable.cpp +.venv/lib/python3.12/site-packages/greenlet/PyModule.cpp +.venv/lib/python3.12/site-packages/greenlet/slp_platformselect.h +.venv/lib/python3.12/site-packages/greenlet/TBrokenGreenlet.cpp +.venv/lib/python3.12/site-packages/greenlet/TExceptionState.cpp +.venv/lib/python3.12/site-packages/greenlet/TGreenlet.cpp +.venv/lib/python3.12/site-packages/greenlet/TGreenlet.hpp +.venv/lib/python3.12/site-packages/greenlet/TGreenletGlobals.cpp +.venv/lib/python3.12/site-packages/greenlet/TMainGreenlet.cpp +.venv/lib/python3.12/site-packages/greenlet/TPythonState.cpp +.venv/lib/python3.12/site-packages/greenlet/TStackState.cpp +.venv/lib/python3.12/site-packages/greenlet/TThreadState.hpp +.venv/lib/python3.12/site-packages/greenlet/TThreadStateCreator.hpp +.venv/lib/python3.12/site-packages/greenlet/TThreadStateDestroy.cpp +.venv/lib/python3.12/site-packages/greenlet/TUserGreenlet.cpp +.venv/lib/python3.12/site-packages/greenlet/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/platform/__init__.py +.venv/lib/python3.12/site-packages/greenlet/platform/setup_switch_x64_masm.cmd +.venv/lib/python3.12/site-packages/greenlet/platform/switch_aarch64_gcc.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_alpha_unix.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_amd64_unix.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_arm32_gcc.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_arm32_ios.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_arm64_masm.asm +.venv/lib/python3.12/site-packages/greenlet/platform/switch_arm64_masm.obj +.venv/lib/python3.12/site-packages/greenlet/platform/switch_arm64_msvc.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_csky_gcc.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_loongarch64_linux.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_m68k_gcc.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_mips_unix.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_ppc_aix.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_ppc_linux.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_ppc_macosx.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_ppc_unix.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_ppc64_aix.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_ppc64_linux.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_riscv_unix.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_s390_unix.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_sh_gcc.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_sparc_sun_gcc.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_x32_unix.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_x64_masm.asm +.venv/lib/python3.12/site-packages/greenlet/platform/switch_x64_masm.obj +.venv/lib/python3.12/site-packages/greenlet/platform/switch_x64_msvc.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_x86_msvc.h +.venv/lib/python3.12/site-packages/greenlet/platform/switch_x86_unix.h +.venv/lib/python3.12/site-packages/greenlet/platform/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__init__.py +.venv/lib/python3.12/site-packages/greenlet/tests/_test_extension_cpp.cpp +.venv/lib/python3.12/site-packages/greenlet/tests/_test_extension_cpp.cpython-312-darwin.so +.venv/lib/python3.12/site-packages/greenlet/tests/_test_extension.c +.venv/lib/python3.12/site-packages/greenlet/tests/_test_extension.cpython-312-darwin.so +.venv/lib/python3.12/site-packages/greenlet/tests/fail_clearing_run_switches.py +.venv/lib/python3.12/site-packages/greenlet/tests/fail_cpp_exception.py +.venv/lib/python3.12/site-packages/greenlet/tests/fail_initialstub_already_started.py +.venv/lib/python3.12/site-packages/greenlet/tests/fail_slp_switch.py +.venv/lib/python3.12/site-packages/greenlet/tests/fail_switch_three_greenlets.py +.venv/lib/python3.12/site-packages/greenlet/tests/fail_switch_three_greenlets2.py +.venv/lib/python3.12/site-packages/greenlet/tests/fail_switch_two_greenlets.py +.venv/lib/python3.12/site-packages/greenlet/tests/leakcheck.py +.venv/lib/python3.12/site-packages/greenlet/tests/test_contextvars.py +.venv/lib/python3.12/site-packages/greenlet/tests/test_cpp.py +.venv/lib/python3.12/site-packages/greenlet/tests/test_extension_interface.py +.venv/lib/python3.12/site-packages/greenlet/tests/test_gc.py +.venv/lib/python3.12/site-packages/greenlet/tests/test_generator_nested.py +.venv/lib/python3.12/site-packages/greenlet/tests/test_generator.py +.venv/lib/python3.12/site-packages/greenlet/tests/test_greenlet_trash.py +.venv/lib/python3.12/site-packages/greenlet/tests/test_greenlet.py +.venv/lib/python3.12/site-packages/greenlet/tests/test_leaks.py +.venv/lib/python3.12/site-packages/greenlet/tests/test_stack_saved.py +.venv/lib/python3.12/site-packages/greenlet/tests/test_throw.py +.venv/lib/python3.12/site-packages/greenlet/tests/test_tracing.py +.venv/lib/python3.12/site-packages/greenlet/tests/test_version.py +.venv/lib/python3.12/site-packages/greenlet/tests/test_weakref.py +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/fail_clearing_run_switches.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/fail_cpp_exception.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/fail_initialstub_already_started.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/fail_slp_switch.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/fail_switch_three_greenlets.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/fail_switch_three_greenlets2.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/fail_switch_two_greenlets.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/leakcheck.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_contextvars.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_cpp.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_extension_interface.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_gc.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_generator_nested.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_generator.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_greenlet_trash.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_greenlet.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_leaks.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_stack_saved.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_throw.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_tracing.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_version.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_weakref.cpython-312.pyc +.venv/lib/python3.12/site-packages/greenlet-3.1.1.dist-info/AUTHORS +.venv/lib/python3.12/site-packages/greenlet-3.1.1.dist-info/INSTALLER +.venv/lib/python3.12/site-packages/greenlet-3.1.1.dist-info/LICENSE +.venv/lib/python3.12/site-packages/greenlet-3.1.1.dist-info/LICENSE.PSF +.venv/lib/python3.12/site-packages/greenlet-3.1.1.dist-info/METADATA +.venv/lib/python3.12/site-packages/greenlet-3.1.1.dist-info/RECORD +.venv/lib/python3.12/site-packages/greenlet-3.1.1.dist-info/top_level.txt +.venv/lib/python3.12/site-packages/greenlet-3.1.1.dist-info/WHEEL +.venv/lib/python3.12/site-packages/idna/__init__.py +.venv/lib/python3.12/site-packages/idna/codec.py +.venv/lib/python3.12/site-packages/idna/compat.py +.venv/lib/python3.12/site-packages/idna/core.py +.venv/lib/python3.12/site-packages/idna/idnadata.py +.venv/lib/python3.12/site-packages/idna/intranges.py +.venv/lib/python3.12/site-packages/idna/package_data.py +.venv/lib/python3.12/site-packages/idna/py.typed +.venv/lib/python3.12/site-packages/idna/uts46data.py +.venv/lib/python3.12/site-packages/idna/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/idna/__pycache__/codec.cpython-312.pyc +.venv/lib/python3.12/site-packages/idna/__pycache__/compat.cpython-312.pyc +.venv/lib/python3.12/site-packages/idna/__pycache__/core.cpython-312.pyc +.venv/lib/python3.12/site-packages/idna/__pycache__/idnadata.cpython-312.pyc +.venv/lib/python3.12/site-packages/idna/__pycache__/intranges.cpython-312.pyc +.venv/lib/python3.12/site-packages/idna/__pycache__/package_data.cpython-312.pyc +.venv/lib/python3.12/site-packages/idna/__pycache__/uts46data.cpython-312.pyc +.venv/lib/python3.12/site-packages/idna-3.10.dist-info/INSTALLER +.venv/lib/python3.12/site-packages/idna-3.10.dist-info/LICENSE.md +.venv/lib/python3.12/site-packages/idna-3.10.dist-info/METADATA +.venv/lib/python3.12/site-packages/idna-3.10.dist-info/RECORD +.venv/lib/python3.12/site-packages/idna-3.10.dist-info/WHEEL +.venv/lib/python3.12/site-packages/pip/__init__.py +.venv/lib/python3.12/site-packages/pip/__main__.py +.venv/lib/python3.12/site-packages/pip/__pip-runner__.py +.venv/lib/python3.12/site-packages/pip/py.typed +.venv/lib/python3.12/site-packages/pip/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/__pycache__/__main__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/__pycache__/__pip-runner__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/__init__.py +.venv/lib/python3.12/site-packages/pip/_internal/build_env.py +.venv/lib/python3.12/site-packages/pip/_internal/cache.py +.venv/lib/python3.12/site-packages/pip/_internal/configuration.py +.venv/lib/python3.12/site-packages/pip/_internal/exceptions.py +.venv/lib/python3.12/site-packages/pip/_internal/main.py +.venv/lib/python3.12/site-packages/pip/_internal/pyproject.py +.venv/lib/python3.12/site-packages/pip/_internal/self_outdated_check.py +.venv/lib/python3.12/site-packages/pip/_internal/wheel_builder.py +.venv/lib/python3.12/site-packages/pip/_internal/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/__pycache__/build_env.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/__pycache__/cache.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/__pycache__/configuration.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/__pycache__/exceptions.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/__pycache__/main.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/__pycache__/pyproject.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/__pycache__/self_outdated_check.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/__pycache__/wheel_builder.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/cli/__init__.py +.venv/lib/python3.12/site-packages/pip/_internal/cli/autocompletion.py +.venv/lib/python3.12/site-packages/pip/_internal/cli/base_command.py +.venv/lib/python3.12/site-packages/pip/_internal/cli/cmdoptions.py +.venv/lib/python3.12/site-packages/pip/_internal/cli/command_context.py +.venv/lib/python3.12/site-packages/pip/_internal/cli/index_command.py +.venv/lib/python3.12/site-packages/pip/_internal/cli/main_parser.py +.venv/lib/python3.12/site-packages/pip/_internal/cli/main.py +.venv/lib/python3.12/site-packages/pip/_internal/cli/parser.py +.venv/lib/python3.12/site-packages/pip/_internal/cli/progress_bars.py +.venv/lib/python3.12/site-packages/pip/_internal/cli/req_command.py +.venv/lib/python3.12/site-packages/pip/_internal/cli/spinners.py +.venv/lib/python3.12/site-packages/pip/_internal/cli/status_codes.py +.venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/autocompletion.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/base_command.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/cmdoptions.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/command_context.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/index_command.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/main_parser.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/main.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/parser.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/progress_bars.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/req_command.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/spinners.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/status_codes.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/commands/__init__.py +.venv/lib/python3.12/site-packages/pip/_internal/commands/cache.py +.venv/lib/python3.12/site-packages/pip/_internal/commands/check.py +.venv/lib/python3.12/site-packages/pip/_internal/commands/completion.py +.venv/lib/python3.12/site-packages/pip/_internal/commands/configuration.py +.venv/lib/python3.12/site-packages/pip/_internal/commands/debug.py +.venv/lib/python3.12/site-packages/pip/_internal/commands/download.py +.venv/lib/python3.12/site-packages/pip/_internal/commands/freeze.py +.venv/lib/python3.12/site-packages/pip/_internal/commands/hash.py +.venv/lib/python3.12/site-packages/pip/_internal/commands/help.py +.venv/lib/python3.12/site-packages/pip/_internal/commands/index.py +.venv/lib/python3.12/site-packages/pip/_internal/commands/inspect.py +.venv/lib/python3.12/site-packages/pip/_internal/commands/install.py +.venv/lib/python3.12/site-packages/pip/_internal/commands/list.py +.venv/lib/python3.12/site-packages/pip/_internal/commands/search.py +.venv/lib/python3.12/site-packages/pip/_internal/commands/show.py +.venv/lib/python3.12/site-packages/pip/_internal/commands/uninstall.py +.venv/lib/python3.12/site-packages/pip/_internal/commands/wheel.py +.venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/cache.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/check.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/completion.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/configuration.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/debug.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/download.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/freeze.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/hash.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/help.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/index.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/inspect.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/install.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/list.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/search.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/show.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/uninstall.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/wheel.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/distributions/__init__.py +.venv/lib/python3.12/site-packages/pip/_internal/distributions/base.py +.venv/lib/python3.12/site-packages/pip/_internal/distributions/installed.py +.venv/lib/python3.12/site-packages/pip/_internal/distributions/sdist.py +.venv/lib/python3.12/site-packages/pip/_internal/distributions/wheel.py +.venv/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/base.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/installed.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/sdist.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/wheel.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/index/__init__.py +.venv/lib/python3.12/site-packages/pip/_internal/index/collector.py +.venv/lib/python3.12/site-packages/pip/_internal/index/package_finder.py +.venv/lib/python3.12/site-packages/pip/_internal/index/sources.py +.venv/lib/python3.12/site-packages/pip/_internal/index/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/index/__pycache__/collector.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/index/__pycache__/package_finder.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/index/__pycache__/sources.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/locations/__init__.py +.venv/lib/python3.12/site-packages/pip/_internal/locations/_distutils.py +.venv/lib/python3.12/site-packages/pip/_internal/locations/_sysconfig.py +.venv/lib/python3.12/site-packages/pip/_internal/locations/base.py +.venv/lib/python3.12/site-packages/pip/_internal/locations/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/locations/__pycache__/_distutils.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/locations/__pycache__/_sysconfig.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/locations/__pycache__/base.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/metadata/__init__.py +.venv/lib/python3.12/site-packages/pip/_internal/metadata/_json.py +.venv/lib/python3.12/site-packages/pip/_internal/metadata/base.py +.venv/lib/python3.12/site-packages/pip/_internal/metadata/pkg_resources.py +.venv/lib/python3.12/site-packages/pip/_internal/metadata/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/metadata/__pycache__/_json.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/metadata/__pycache__/base.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/metadata/__pycache__/pkg_resources.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__init__.py +.venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_compat.py +.venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_dists.py +.venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py +.venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__pycache__/_compat.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__pycache__/_dists.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__pycache__/_envs.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/models/__init__.py +.venv/lib/python3.12/site-packages/pip/_internal/models/candidate.py +.venv/lib/python3.12/site-packages/pip/_internal/models/direct_url.py +.venv/lib/python3.12/site-packages/pip/_internal/models/format_control.py +.venv/lib/python3.12/site-packages/pip/_internal/models/index.py +.venv/lib/python3.12/site-packages/pip/_internal/models/installation_report.py +.venv/lib/python3.12/site-packages/pip/_internal/models/link.py +.venv/lib/python3.12/site-packages/pip/_internal/models/scheme.py +.venv/lib/python3.12/site-packages/pip/_internal/models/search_scope.py +.venv/lib/python3.12/site-packages/pip/_internal/models/selection_prefs.py +.venv/lib/python3.12/site-packages/pip/_internal/models/target_python.py +.venv/lib/python3.12/site-packages/pip/_internal/models/wheel.py +.venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/candidate.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/direct_url.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/format_control.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/index.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/installation_report.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/link.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/scheme.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/search_scope.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/selection_prefs.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/target_python.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/wheel.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/network/__init__.py +.venv/lib/python3.12/site-packages/pip/_internal/network/auth.py +.venv/lib/python3.12/site-packages/pip/_internal/network/cache.py +.venv/lib/python3.12/site-packages/pip/_internal/network/download.py +.venv/lib/python3.12/site-packages/pip/_internal/network/lazy_wheel.py +.venv/lib/python3.12/site-packages/pip/_internal/network/session.py +.venv/lib/python3.12/site-packages/pip/_internal/network/utils.py +.venv/lib/python3.12/site-packages/pip/_internal/network/xmlrpc.py +.venv/lib/python3.12/site-packages/pip/_internal/network/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/network/__pycache__/auth.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/network/__pycache__/cache.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/network/__pycache__/download.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/network/__pycache__/lazy_wheel.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/network/__pycache__/session.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/network/__pycache__/utils.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/network/__pycache__/xmlrpc.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/operations/__init__.py +.venv/lib/python3.12/site-packages/pip/_internal/operations/check.py +.venv/lib/python3.12/site-packages/pip/_internal/operations/freeze.py +.venv/lib/python3.12/site-packages/pip/_internal/operations/prepare.py +.venv/lib/python3.12/site-packages/pip/_internal/operations/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/operations/__pycache__/check.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/operations/__pycache__/freeze.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/operations/__pycache__/prepare.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/operations/build/__init__.py +.venv/lib/python3.12/site-packages/pip/_internal/operations/build/build_tracker.py +.venv/lib/python3.12/site-packages/pip/_internal/operations/build/metadata_editable.py +.venv/lib/python3.12/site-packages/pip/_internal/operations/build/metadata_legacy.py +.venv/lib/python3.12/site-packages/pip/_internal/operations/build/metadata.py +.venv/lib/python3.12/site-packages/pip/_internal/operations/build/wheel_editable.py +.venv/lib/python3.12/site-packages/pip/_internal/operations/build/wheel_legacy.py +.venv/lib/python3.12/site-packages/pip/_internal/operations/build/wheel.py +.venv/lib/python3.12/site-packages/pip/_internal/operations/build/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/operations/build/__pycache__/build_tracker.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/operations/build/__pycache__/metadata_editable.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/operations/build/__pycache__/metadata_legacy.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/operations/build/__pycache__/metadata.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/operations/build/__pycache__/wheel_editable.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/operations/build/__pycache__/wheel_legacy.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/operations/build/__pycache__/wheel.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/operations/install/__init__.py +.venv/lib/python3.12/site-packages/pip/_internal/operations/install/editable_legacy.py +.venv/lib/python3.12/site-packages/pip/_internal/operations/install/wheel.py +.venv/lib/python3.12/site-packages/pip/_internal/operations/install/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/operations/install/__pycache__/editable_legacy.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/operations/install/__pycache__/wheel.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/req/__init__.py +.venv/lib/python3.12/site-packages/pip/_internal/req/constructors.py +.venv/lib/python3.12/site-packages/pip/_internal/req/req_file.py +.venv/lib/python3.12/site-packages/pip/_internal/req/req_install.py +.venv/lib/python3.12/site-packages/pip/_internal/req/req_set.py +.venv/lib/python3.12/site-packages/pip/_internal/req/req_uninstall.py +.venv/lib/python3.12/site-packages/pip/_internal/req/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/req/__pycache__/constructors.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/req/__pycache__/req_file.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/req/__pycache__/req_install.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/req/__pycache__/req_set.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/req/__pycache__/req_uninstall.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/resolution/__init__.py +.venv/lib/python3.12/site-packages/pip/_internal/resolution/base.py +.venv/lib/python3.12/site-packages/pip/_internal/resolution/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/resolution/__pycache__/base.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/resolution/legacy/__init__.py +.venv/lib/python3.12/site-packages/pip/_internal/resolution/legacy/resolver.py +.venv/lib/python3.12/site-packages/pip/_internal/resolution/legacy/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/resolution/legacy/__pycache__/resolver.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/__init__.py +.venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/base.py +.venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py +.venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/factory.py +.venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py +.venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/provider.py +.venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/reporter.py +.venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/requirements.py +.venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/resolver.py +.venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/__pycache__/base.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/__pycache__/candidates.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/__pycache__/factory.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/__pycache__/found_candidates.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/__pycache__/provider.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/__pycache__/reporter.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/__pycache__/requirements.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/__pycache__/resolver.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__init__.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/_jaraco_text.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/_log.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/appdirs.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/compat.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/compatibility_tags.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/datetime.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/deprecation.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/direct_url_helpers.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/egg_link.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/entrypoints.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/filesystem.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/filetypes.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/glibc.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/hashes.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/logging.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/misc.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/packaging.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/retry.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/setuptools_build.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/subprocess.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/temp_dir.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/unpacking.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/urls.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/virtualenv.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/wheel.py +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/_jaraco_text.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/_log.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/appdirs.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/compat.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/compatibility_tags.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/datetime.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/deprecation.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/direct_url_helpers.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/egg_link.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/entrypoints.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/filesystem.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/filetypes.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/glibc.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/hashes.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/logging.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/misc.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/packaging.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/retry.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/setuptools_build.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/subprocess.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/temp_dir.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/unpacking.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/urls.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/virtualenv.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/wheel.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/vcs/__init__.py +.venv/lib/python3.12/site-packages/pip/_internal/vcs/bazaar.py +.venv/lib/python3.12/site-packages/pip/_internal/vcs/git.py +.venv/lib/python3.12/site-packages/pip/_internal/vcs/mercurial.py +.venv/lib/python3.12/site-packages/pip/_internal/vcs/subversion.py +.venv/lib/python3.12/site-packages/pip/_internal/vcs/versioncontrol.py +.venv/lib/python3.12/site-packages/pip/_internal/vcs/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/vcs/__pycache__/bazaar.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/vcs/__pycache__/git.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/vcs/__pycache__/mercurial.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/vcs/__pycache__/subversion.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_internal/vcs/__pycache__/versioncontrol.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/typing_extensions.py +.venv/lib/python3.12/site-packages/pip/_vendor/vendor.txt +.venv/lib/python3.12/site-packages/pip/_vendor/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/__pycache__/typing_extensions.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/_cmd.py +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/adapter.py +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/cache.py +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/controller.py +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/filewrapper.py +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/heuristics.py +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/py.typed +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/serialize.py +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/wrapper.py +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/__pycache__/_cmd.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/__pycache__/adapter.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/__pycache__/cache.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/__pycache__/controller.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/__pycache__/filewrapper.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/__pycache__/heuristics.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/__pycache__/serialize.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/__pycache__/wrapper.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/file_cache.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/redis_cache.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/certifi/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/certifi/__main__.py +.venv/lib/python3.12/site-packages/pip/_vendor/certifi/cacert.pem +.venv/lib/python3.12/site-packages/pip/_vendor/certifi/core.py +.venv/lib/python3.12/site-packages/pip/_vendor/certifi/py.typed +.venv/lib/python3.12/site-packages/pip/_vendor/certifi/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/certifi/__pycache__/__main__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/certifi/__pycache__/core.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/compat.py +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/database.py +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/index.py +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/locators.py +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/manifest.py +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/markers.py +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/metadata.py +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/resources.py +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/scripts.py +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/t32.exe +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/t64-arm.exe +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/t64.exe +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/util.py +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/version.py +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/w32.exe +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/w64-arm.exe +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/w64.exe +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/wheel.py +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/compat.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/database.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/index.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/locators.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/manifest.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/markers.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/metadata.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/resources.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/scripts.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/util.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/version.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/wheel.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/distro/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/distro/__main__.py +.venv/lib/python3.12/site-packages/pip/_vendor/distro/distro.py +.venv/lib/python3.12/site-packages/pip/_vendor/distro/py.typed +.venv/lib/python3.12/site-packages/pip/_vendor/distro/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/distro/__pycache__/__main__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/distro/__pycache__/distro.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/idna/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/idna/codec.py +.venv/lib/python3.12/site-packages/pip/_vendor/idna/compat.py +.venv/lib/python3.12/site-packages/pip/_vendor/idna/core.py +.venv/lib/python3.12/site-packages/pip/_vendor/idna/idnadata.py +.venv/lib/python3.12/site-packages/pip/_vendor/idna/intranges.py +.venv/lib/python3.12/site-packages/pip/_vendor/idna/package_data.py +.venv/lib/python3.12/site-packages/pip/_vendor/idna/py.typed +.venv/lib/python3.12/site-packages/pip/_vendor/idna/uts46data.py +.venv/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/codec.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/compat.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/core.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/idnadata.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/intranges.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/package_data.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/uts46data.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/msgpack/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/msgpack/exceptions.py +.venv/lib/python3.12/site-packages/pip/_vendor/msgpack/ext.py +.venv/lib/python3.12/site-packages/pip/_vendor/msgpack/fallback.py +.venv/lib/python3.12/site-packages/pip/_vendor/msgpack/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/msgpack/__pycache__/exceptions.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/msgpack/__pycache__/ext.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/msgpack/__pycache__/fallback.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/_elffile.py +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/_manylinux.py +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/_musllinux.py +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/_parser.py +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/_structures.py +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/_tokenizer.py +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/markers.py +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/metadata.py +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/py.typed +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/requirements.py +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/specifiers.py +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/tags.py +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/utils.py +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/version.py +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/_elffile.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/_manylinux.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/_musllinux.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/_parser.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/_structures.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/_tokenizer.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/markers.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/metadata.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/requirements.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/specifiers.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/tags.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/utils.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/version.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/licenses/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/licenses/_spdx.py +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/licenses/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/packaging/licenses/__pycache__/_spdx.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/__main__.py +.venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/android.py +.venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/api.py +.venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/macos.py +.venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/py.typed +.venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/unix.py +.venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/version.py +.venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/windows.py +.venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/__pycache__/__main__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/__pycache__/android.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/__pycache__/api.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/__pycache__/macos.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/__pycache__/unix.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/__pycache__/version.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/__pycache__/windows.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/__main__.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/cmdline.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/console.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/filter.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatter.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/lexer.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/modeline.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/plugin.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/regexopt.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/scanner.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/sphinxext.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/style.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/token.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/unistring.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/util.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/__main__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/cmdline.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/console.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/filter.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/formatter.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/lexer.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/modeline.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/plugin.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/regexopt.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/scanner.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/sphinxext.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/style.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/token.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/unistring.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/util.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/filters/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/filters/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/_mapping.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/bbcode.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/groff.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/html.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/img.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/irc.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/latex.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/other.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/pangomarkup.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/rtf.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/svg.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/terminal.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/terminal256.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/_mapping.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/bbcode.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/groff.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/html.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/img.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/irc.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/latex.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/other.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/pangomarkup.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/rtf.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/svg.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/terminal.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/terminal256.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/lexers/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/lexers/_mapping.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/lexers/python.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/lexers/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/lexers/__pycache__/_mapping.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/lexers/__pycache__/python.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/styles/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/styles/_mapping.py +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/styles/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pygments/styles/__pycache__/_mapping.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_impl.py +.venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/py.typed +.venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/__pycache__/_impl.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py +.venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/__pycache__/_in_process.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/requests/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/requests/__version__.py +.venv/lib/python3.12/site-packages/pip/_vendor/requests/_internal_utils.py +.venv/lib/python3.12/site-packages/pip/_vendor/requests/adapters.py +.venv/lib/python3.12/site-packages/pip/_vendor/requests/api.py +.venv/lib/python3.12/site-packages/pip/_vendor/requests/auth.py +.venv/lib/python3.12/site-packages/pip/_vendor/requests/certs.py +.venv/lib/python3.12/site-packages/pip/_vendor/requests/compat.py +.venv/lib/python3.12/site-packages/pip/_vendor/requests/cookies.py +.venv/lib/python3.12/site-packages/pip/_vendor/requests/exceptions.py +.venv/lib/python3.12/site-packages/pip/_vendor/requests/help.py +.venv/lib/python3.12/site-packages/pip/_vendor/requests/hooks.py +.venv/lib/python3.12/site-packages/pip/_vendor/requests/models.py +.venv/lib/python3.12/site-packages/pip/_vendor/requests/packages.py +.venv/lib/python3.12/site-packages/pip/_vendor/requests/sessions.py +.venv/lib/python3.12/site-packages/pip/_vendor/requests/status_codes.py +.venv/lib/python3.12/site-packages/pip/_vendor/requests/structures.py +.venv/lib/python3.12/site-packages/pip/_vendor/requests/utils.py +.venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/__version__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/_internal_utils.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/adapters.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/api.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/auth.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/certs.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/compat.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/cookies.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/exceptions.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/help.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/hooks.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/models.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/packages.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/sessions.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/status_codes.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/structures.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/utils.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/resolvelib/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/resolvelib/providers.py +.venv/lib/python3.12/site-packages/pip/_vendor/resolvelib/py.typed +.venv/lib/python3.12/site-packages/pip/_vendor/resolvelib/reporters.py +.venv/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers.py +.venv/lib/python3.12/site-packages/pip/_vendor/resolvelib/structs.py +.venv/lib/python3.12/site-packages/pip/_vendor/resolvelib/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/resolvelib/__pycache__/providers.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/resolvelib/__pycache__/reporters.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/resolvelib/__pycache__/resolvers.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/resolvelib/__pycache__/structs.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/resolvelib/compat/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/resolvelib/compat/collections_abc.py +.venv/lib/python3.12/site-packages/pip/_vendor/resolvelib/compat/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/resolvelib/compat/__pycache__/collections_abc.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__main__.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/_cell_widths.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/_emoji_codes.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/_emoji_replace.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/_export_format.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/_extension.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/_fileno.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/_inspect.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/_log_render.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/_loop.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/_null_file.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/_palettes.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/_pick.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/_ratio.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/_spinners.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/_stack.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/_timer.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/_win32_console.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/_windows_renderer.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/_windows.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/_wrap.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/abc.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/align.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/ansi.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/bar.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/box.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/cells.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/color_triplet.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/color.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/columns.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/console.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/constrain.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/containers.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/control.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/default_styles.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/diagnose.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/emoji.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/errors.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/file_proxy.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/filesize.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/highlighter.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/json.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/jupyter.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/layout.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/live_render.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/live.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/logging.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/markup.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/measure.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/padding.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/pager.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/palette.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/panel.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/pretty.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/progress_bar.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/progress.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/prompt.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/protocol.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/py.typed +.venv/lib/python3.12/site-packages/pip/_vendor/rich/region.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/repr.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/rule.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/scope.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/screen.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/segment.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/spinner.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/status.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/style.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/styled.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/syntax.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/table.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/terminal_theme.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/text.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/theme.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/themes.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/traceback.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/tree.py +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/__main__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_cell_widths.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_emoji_codes.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_emoji_replace.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_export_format.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_extension.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_fileno.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_inspect.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_log_render.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_loop.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_null_file.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_palettes.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_pick.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_ratio.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_spinners.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_stack.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_timer.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_win32_console.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_windows_renderer.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_windows.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_wrap.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/abc.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/align.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/ansi.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/bar.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/box.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/cells.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/color_triplet.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/color.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/columns.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/console.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/constrain.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/containers.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/control.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/default_styles.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/diagnose.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/emoji.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/errors.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/file_proxy.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/filesize.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/highlighter.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/json.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/jupyter.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/layout.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/live_render.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/live.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/logging.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/markup.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/measure.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/padding.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/pager.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/palette.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/panel.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/pretty.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/progress_bar.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/progress.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/prompt.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/protocol.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/region.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/repr.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/rule.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/scope.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/screen.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/segment.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/spinner.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/status.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/style.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/styled.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/syntax.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/table.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/terminal_theme.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/text.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/theme.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/themes.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/traceback.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/tree.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/tomli/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/tomli/_parser.py +.venv/lib/python3.12/site-packages/pip/_vendor/tomli/_re.py +.venv/lib/python3.12/site-packages/pip/_vendor/tomli/_types.py +.venv/lib/python3.12/site-packages/pip/_vendor/tomli/py.typed +.venv/lib/python3.12/site-packages/pip/_vendor/tomli/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/tomli/__pycache__/_parser.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/tomli/__pycache__/_re.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/tomli/__pycache__/_types.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/truststore/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/truststore/_api.py +.venv/lib/python3.12/site-packages/pip/_vendor/truststore/_macos.py +.venv/lib/python3.12/site-packages/pip/_vendor/truststore/_openssl.py +.venv/lib/python3.12/site-packages/pip/_vendor/truststore/_ssl_constants.py +.venv/lib/python3.12/site-packages/pip/_vendor/truststore/_windows.py +.venv/lib/python3.12/site-packages/pip/_vendor/truststore/py.typed +.venv/lib/python3.12/site-packages/pip/_vendor/truststore/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/truststore/__pycache__/_api.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/truststore/__pycache__/_macos.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/truststore/__pycache__/_openssl.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/truststore/__pycache__/_ssl_constants.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/truststore/__pycache__/_windows.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/_collections.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/_version.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/connection.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/connectionpool.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/exceptions.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/fields.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/filepost.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/poolmanager.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/request.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/response.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/_collections.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/_version.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/connection.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/connectionpool.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/exceptions.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/fields.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/filepost.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/poolmanager.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/request.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/response.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/_appengine_environ.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/appengine.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/securetransport.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/socks.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/__pycache__/_appengine_environ.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/__pycache__/appengine.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/__pycache__/ntlmpool.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/__pycache__/pyopenssl.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/__pycache__/securetransport.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/__pycache__/socks.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__pycache__/bindings.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__pycache__/low_level.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/packages/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/packages/six.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/packages/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/packages/__pycache__/six.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/packages/backports/weakref_finalize.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/packages/backports/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/packages/backports/__pycache__/makefile.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/packages/backports/__pycache__/weakref_finalize.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__init__.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/connection.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/proxy.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/queue.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/request.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/response.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/retry.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/ssl_.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/ssl_match_hostname.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/ssltransport.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/timeout.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/url.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/wait.py +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/connection.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/proxy.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/queue.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/request.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/response.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/retry.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/ssl_.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/ssl_match_hostname.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/ssltransport.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/timeout.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/url.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/wait.cpython-312.pyc +.venv/lib/python3.12/site-packages/pip-25.0.1.dist-info/AUTHORS.txt +.venv/lib/python3.12/site-packages/pip-25.0.1.dist-info/entry_points.txt +.venv/lib/python3.12/site-packages/pip-25.0.1.dist-info/INSTALLER +.venv/lib/python3.12/site-packages/pip-25.0.1.dist-info/LICENSE.txt +.venv/lib/python3.12/site-packages/pip-25.0.1.dist-info/METADATA +.venv/lib/python3.12/site-packages/pip-25.0.1.dist-info/RECORD +.venv/lib/python3.12/site-packages/pip-25.0.1.dist-info/REQUESTED +.venv/lib/python3.12/site-packages/pip-25.0.1.dist-info/top_level.txt +.venv/lib/python3.12/site-packages/pip-25.0.1.dist-info/WHEEL +.venv/lib/python3.12/site-packages/playwright/__init__.py +.venv/lib/python3.12/site-packages/playwright/__main__.py +.venv/lib/python3.12/site-packages/playwright/_repo_version.py +.venv/lib/python3.12/site-packages/playwright/py.typed +.venv/lib/python3.12/site-packages/playwright/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/__pycache__/__main__.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/__pycache__/_repo_version.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__init__.py +.venv/lib/python3.12/site-packages/playwright/_impl/_accessibility.py +.venv/lib/python3.12/site-packages/playwright/_impl/_api_structures.py +.venv/lib/python3.12/site-packages/playwright/_impl/_artifact.py +.venv/lib/python3.12/site-packages/playwright/_impl/_assertions.py +.venv/lib/python3.12/site-packages/playwright/_impl/_async_base.py +.venv/lib/python3.12/site-packages/playwright/_impl/_browser_context.py +.venv/lib/python3.12/site-packages/playwright/_impl/_browser_type.py +.venv/lib/python3.12/site-packages/playwright/_impl/_browser.py +.venv/lib/python3.12/site-packages/playwright/_impl/_cdp_session.py +.venv/lib/python3.12/site-packages/playwright/_impl/_clock.py +.venv/lib/python3.12/site-packages/playwright/_impl/_connection.py +.venv/lib/python3.12/site-packages/playwright/_impl/_console_message.py +.venv/lib/python3.12/site-packages/playwright/_impl/_dialog.py +.venv/lib/python3.12/site-packages/playwright/_impl/_download.py +.venv/lib/python3.12/site-packages/playwright/_impl/_driver.py +.venv/lib/python3.12/site-packages/playwright/_impl/_element_handle.py +.venv/lib/python3.12/site-packages/playwright/_impl/_errors.py +.venv/lib/python3.12/site-packages/playwright/_impl/_event_context_manager.py +.venv/lib/python3.12/site-packages/playwright/_impl/_fetch.py +.venv/lib/python3.12/site-packages/playwright/_impl/_file_chooser.py +.venv/lib/python3.12/site-packages/playwright/_impl/_frame.py +.venv/lib/python3.12/site-packages/playwright/_impl/_glob.py +.venv/lib/python3.12/site-packages/playwright/_impl/_greenlets.py +.venv/lib/python3.12/site-packages/playwright/_impl/_har_router.py +.venv/lib/python3.12/site-packages/playwright/_impl/_helper.py +.venv/lib/python3.12/site-packages/playwright/_impl/_impl_to_api_mapping.py +.venv/lib/python3.12/site-packages/playwright/_impl/_input.py +.venv/lib/python3.12/site-packages/playwright/_impl/_js_handle.py +.venv/lib/python3.12/site-packages/playwright/_impl/_json_pipe.py +.venv/lib/python3.12/site-packages/playwright/_impl/_local_utils.py +.venv/lib/python3.12/site-packages/playwright/_impl/_locator.py +.venv/lib/python3.12/site-packages/playwright/_impl/_map.py +.venv/lib/python3.12/site-packages/playwright/_impl/_network.py +.venv/lib/python3.12/site-packages/playwright/_impl/_object_factory.py +.venv/lib/python3.12/site-packages/playwright/_impl/_page.py +.venv/lib/python3.12/site-packages/playwright/_impl/_path_utils.py +.venv/lib/python3.12/site-packages/playwright/_impl/_playwright.py +.venv/lib/python3.12/site-packages/playwright/_impl/_selectors.py +.venv/lib/python3.12/site-packages/playwright/_impl/_set_input_files_helpers.py +.venv/lib/python3.12/site-packages/playwright/_impl/_str_utils.py +.venv/lib/python3.12/site-packages/playwright/_impl/_stream.py +.venv/lib/python3.12/site-packages/playwright/_impl/_sync_base.py +.venv/lib/python3.12/site-packages/playwright/_impl/_tracing.py +.venv/lib/python3.12/site-packages/playwright/_impl/_transport.py +.venv/lib/python3.12/site-packages/playwright/_impl/_video.py +.venv/lib/python3.12/site-packages/playwright/_impl/_waiter.py +.venv/lib/python3.12/site-packages/playwright/_impl/_web_error.py +.venv/lib/python3.12/site-packages/playwright/_impl/_writable_stream.py +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_accessibility.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_api_structures.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_artifact.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_assertions.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_async_base.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_browser_context.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_browser_type.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_browser.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_cdp_session.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_clock.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_connection.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_console_message.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_dialog.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_download.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_driver.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_element_handle.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_errors.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_event_context_manager.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_fetch.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_file_chooser.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_frame.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_glob.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_greenlets.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_har_router.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_helper.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_impl_to_api_mapping.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_input.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_js_handle.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_json_pipe.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_local_utils.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_locator.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_map.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_network.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_object_factory.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_page.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_path_utils.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_playwright.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_selectors.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_set_input_files_helpers.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_str_utils.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_stream.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_sync_base.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_tracing.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_transport.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_video.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_waiter.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_web_error.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pycache__/_writable_stream.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pyinstaller/__init__.py +.venv/lib/python3.12/site-packages/playwright/_impl/__pyinstaller/hook-playwright.async_api.py +.venv/lib/python3.12/site-packages/playwright/_impl/__pyinstaller/hook-playwright.sync_api.py +.venv/lib/python3.12/site-packages/playwright/_impl/__pyinstaller/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pyinstaller/__pycache__/hook-playwright.async_api.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/_impl/__pyinstaller/__pycache__/hook-playwright.sync_api.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/async_api/__init__.py +.venv/lib/python3.12/site-packages/playwright/async_api/_context_manager.py +.venv/lib/python3.12/site-packages/playwright/async_api/_generated.py +.venv/lib/python3.12/site-packages/playwright/async_api/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/async_api/__pycache__/_context_manager.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/async_api/__pycache__/_generated.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/driver/LICENSE +.venv/lib/python3.12/site-packages/playwright/driver/node +.venv/lib/python3.12/site-packages/playwright/driver/README.md +.venv/lib/python3.12/site-packages/playwright/driver/package/api.json +.venv/lib/python3.12/site-packages/playwright/driver/package/browsers.json +.venv/lib/python3.12/site-packages/playwright/driver/package/cli.js +.venv/lib/python3.12/site-packages/playwright/driver/package/index.d.ts +.venv/lib/python3.12/site-packages/playwright/driver/package/index.js +.venv/lib/python3.12/site-packages/playwright/driver/package/index.mjs +.venv/lib/python3.12/site-packages/playwright/driver/package/package.json +.venv/lib/python3.12/site-packages/playwright/driver/package/protocol.yml +.venv/lib/python3.12/site-packages/playwright/driver/package/README.md +.venv/lib/python3.12/site-packages/playwright/driver/package/ThirdPartyNotices.txt +.venv/lib/python3.12/site-packages/playwright/driver/package/bin/install_media_pack.ps1 +.venv/lib/python3.12/site-packages/playwright/driver/package/bin/reinstall_chrome_beta_linux.sh +.venv/lib/python3.12/site-packages/playwright/driver/package/bin/reinstall_chrome_beta_mac.sh +.venv/lib/python3.12/site-packages/playwright/driver/package/bin/reinstall_chrome_beta_win.ps1 +.venv/lib/python3.12/site-packages/playwright/driver/package/bin/reinstall_chrome_stable_linux.sh +.venv/lib/python3.12/site-packages/playwright/driver/package/bin/reinstall_chrome_stable_mac.sh +.venv/lib/python3.12/site-packages/playwright/driver/package/bin/reinstall_chrome_stable_win.ps1 +.venv/lib/python3.12/site-packages/playwright/driver/package/bin/reinstall_msedge_beta_linux.sh +.venv/lib/python3.12/site-packages/playwright/driver/package/bin/reinstall_msedge_beta_mac.sh +.venv/lib/python3.12/site-packages/playwright/driver/package/bin/reinstall_msedge_beta_win.ps1 +.venv/lib/python3.12/site-packages/playwright/driver/package/bin/reinstall_msedge_dev_linux.sh +.venv/lib/python3.12/site-packages/playwright/driver/package/bin/reinstall_msedge_dev_mac.sh +.venv/lib/python3.12/site-packages/playwright/driver/package/bin/reinstall_msedge_dev_win.ps1 +.venv/lib/python3.12/site-packages/playwright/driver/package/bin/reinstall_msedge_stable_linux.sh +.venv/lib/python3.12/site-packages/playwright/driver/package/bin/reinstall_msedge_stable_mac.sh +.venv/lib/python3.12/site-packages/playwright/driver/package/bin/reinstall_msedge_stable_win.ps1 +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/androidServerImpl.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/browserServerImpl.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/inprocess.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/inProcessFactory.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/outofprocess.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utilsBundle.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/zipBundle.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/zipBundleImpl.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/cli/driver.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/cli/program.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/cli/programWithTestStub.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/accessibility.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/android.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/api.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/artifact.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/browser.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/browserContext.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/browserType.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/cdpSession.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/channelOwner.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/clientHelper.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/clientInstrumentation.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/clientStackTrace.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/clock.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/connection.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/consoleMessage.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/coverage.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/dialog.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/download.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/electron.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/elementHandle.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/errors.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/eventEmitter.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/events.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/fetch.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/fileChooser.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/fileUtils.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/frame.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/harRouter.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/input.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/jsHandle.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/jsonPipe.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/localUtils.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/locator.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/network.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/page.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/platform.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/playwright.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/selectors.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/stream.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/timeoutSettings.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/tracing.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/types.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/video.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/waiter.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/webError.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/webSocket.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/worker.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/client/writableStream.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/generated/clockSource.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/generated/consoleApiSource.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/generated/injectedScriptSource.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/generated/pollingRecorderSource.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/generated/utilityScriptSource.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/generated/webSocketMockSource.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/protocol/debug.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/protocol/serializers.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/protocol/validator.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/protocol/validatorPrimitives.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/remote/playwrightConnection.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/remote/playwrightServer.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/accessibility.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/artifact.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/browser.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/browserContext.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/browserType.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/callLog.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/clock.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/console.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/cookieStore.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/debugController.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/debugger.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/deviceDescriptors.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/deviceDescriptorsSource.json +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dialog.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dom.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/download.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/errors.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/fetch.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/fileChooser.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/fileUploadUtils.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/formData.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/frames.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/frameSelectors.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/harBackend.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/helper.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/index.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/input.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/instrumentation.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/javascript.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/launchApp.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/localUtils.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/macEditingCommands.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/network.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/page.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/pipeTransport.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/playwright.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/progress.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/protocolError.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/recorder.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/screenshotter.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/selectors.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/socksClientCertificatesInterceptor.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/socksInterceptor.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/storageScript.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/timeoutSettings.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/transport.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/types.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/usKeyboardLayout.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/android/android.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/android/backendAdb.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/bidi/bidiBrowser.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/bidi/bidiChromium.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/bidi/bidiConnection.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/bidi/bidiExecutionContext.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/bidi/bidiFirefox.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/bidi/bidiInput.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/bidi/bidiNetworkManager.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/bidi/bidiOverCdp.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/bidi/bidiPage.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/bidi/bidiPdf.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/bidi/third_party/bidiDeserializer.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/bidi/third_party/bidiKeyboard.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/bidi/third_party/bidiProtocol.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/bidi/third_party/bidiSerializer.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/bidi/third_party/firefoxPrefs.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/chromium/appIcon.png +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/chromium/chromium.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/chromium/chromiumSwitches.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/chromium/crAccessibility.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/chromium/crBrowser.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/chromium/crConnection.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/chromium/crCoverage.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/chromium/crDevTools.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/chromium/crDragDrop.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/chromium/crExecutionContext.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/chromium/crInput.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/chromium/crNetworkManager.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/chromium/crPage.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/chromium/crPdf.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/chromium/crProtocolHelper.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/chromium/crServiceWorker.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/chromium/defaultFontFamilies.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/chromium/videoRecorder.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/codegen/csharp.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/codegen/java.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/codegen/javascript.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/codegen/jsonl.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/codegen/language.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/codegen/languages.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/codegen/python.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/codegen/types.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/androidDispatcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/artifactDispatcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/browserContextDispatcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/browserDispatcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/browserTypeDispatcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/cdpSessionDispatcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/debugControllerDispatcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/dialogDispatcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/dispatcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/electronDispatcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/elementHandlerDispatcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/frameDispatcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/jsHandleDispatcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/jsonPipeDispatcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/localUtilsDispatcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/networkDispatchers.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/pageDispatcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/playwrightDispatcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/selectorsDispatcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/streamDispatcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/tracingDispatcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/webSocketRouteDispatcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/dispatchers/writableStreamDispatcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/electron/electron.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/electron/loader.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/firefox/ffAccessibility.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/firefox/ffBrowser.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/firefox/ffConnection.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/firefox/ffExecutionContext.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/firefox/ffInput.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/firefox/ffNetworkManager.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/firefox/ffPage.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/firefox/firefox.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/har/harRecorder.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/har/harTracer.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/isomorphic/utilityScriptSerializers.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/recorder/chat.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/recorder/contextRecorder.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/recorder/recorderApp.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/recorder/recorderCollection.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/recorder/recorderFrontend.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/recorder/recorderRunner.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/recorder/recorderUtils.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/recorder/throttledFile.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/registry/browserFetcher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/registry/dependencies.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/registry/index.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/registry/nativeDeps.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/registry/oopDownloadBrowserMain.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/trace/recorder/snapshotter.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/trace/recorder/snapshotterInjected.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/trace/recorder/tracing.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/trace/test/inMemorySnapshotter.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/trace/viewer/traceViewer.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/ascii.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/comparators.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/crypto.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/debug.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/debugLogger.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/env.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/eventsHelper.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/expectUtils.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/fileUtils.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/happyEyeballs.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/hostPlatform.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/httpServer.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/linuxUtils.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/network.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/nodePlatform.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/pipeTransport.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/processLauncher.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/profiler.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/socksProxy.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/spawnAsync.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/task.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/userAgent.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/wsServer.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/zipFile.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/zones.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/image_tools/colorUtils.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/image_tools/compare.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/image_tools/imageChannel.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/utils/image_tools/stats.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/webkit/webkit.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/webkit/wkAccessibility.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/webkit/wkBrowser.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/webkit/wkConnection.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/webkit/wkExecutionContext.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/webkit/wkInput.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/webkit/wkInterceptableRequest.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/webkit/wkPage.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/webkit/wkProvisionalPage.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/server/webkit/wkWorkers.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/third_party/pixelmatch.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils/isomorphic/ariaSnapshot.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils/isomorphic/assert.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils/isomorphic/colors.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils/isomorphic/cssParser.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils/isomorphic/cssTokenizer.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils/isomorphic/headers.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils/isomorphic/locatorGenerators.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils/isomorphic/locatorParser.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils/isomorphic/locatorUtils.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils/isomorphic/manualPromise.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils/isomorphic/mimeType.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils/isomorphic/multimap.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils/isomorphic/rtti.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils/isomorphic/selectorParser.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils/isomorphic/semaphore.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils/isomorphic/stackTrace.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils/isomorphic/stringUtils.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils/isomorphic/time.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils/isomorphic/timeoutRunner.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils/isomorphic/traceUtils.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils/isomorphic/types.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utils/isomorphic/urlMatch.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utilsBundleImpl/index.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/utilsBundleImpl/xdg-open +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/htmlReport/index.html +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/recorder/index.html +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/recorder/playwright-logo.svg +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/recorder/assets/codeMirrorModule-B9YMkrwa.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/recorder/assets/codeMirrorModule-C3UTv-Ge.css +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/recorder/assets/index-eHBmevrY.css +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/recorder/assets/index-ELPgmkwA.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/traceViewer/codeMirrorModule.C3UTv-Ge.css +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/traceViewer/defaultSettingsView.5fN5lw10.css +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/traceViewer/index.CFOW-Ezb.css +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/traceViewer/index.CUq7VgrV.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/traceViewer/index.html +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/traceViewer/playwright-logo.svg +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/traceViewer/snapshot.html +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/traceViewer/sw.bundle.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/traceViewer/uiMode.BatfzHMG.css +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/traceViewer/uiMode.CHJSAD7F.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/traceViewer/uiMode.html +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/traceViewer/xtermModule.Beg8tuEN.css +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/traceViewer/assets/codeMirrorModule-DpJ-EmBQ.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/traceViewer/assets/defaultSettingsView-DTenqiGw.js +.venv/lib/python3.12/site-packages/playwright/driver/package/lib/vite/traceViewer/assets/xtermModule-BoAIEibi.js +.venv/lib/python3.12/site-packages/playwright/driver/package/types/protocol.d.ts +.venv/lib/python3.12/site-packages/playwright/driver/package/types/structs.d.ts +.venv/lib/python3.12/site-packages/playwright/driver/package/types/types.d.ts +.venv/lib/python3.12/site-packages/playwright/sync_api/__init__.py +.venv/lib/python3.12/site-packages/playwright/sync_api/_context_manager.py +.venv/lib/python3.12/site-packages/playwright/sync_api/_generated.py +.venv/lib/python3.12/site-packages/playwright/sync_api/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/sync_api/__pycache__/_context_manager.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright/sync_api/__pycache__/_generated.cpython-312.pyc +.venv/lib/python3.12/site-packages/playwright-1.51.0.dist-info/entry_points.txt +.venv/lib/python3.12/site-packages/playwright-1.51.0.dist-info/INSTALLER +.venv/lib/python3.12/site-packages/playwright-1.51.0.dist-info/LICENSE +.venv/lib/python3.12/site-packages/playwright-1.51.0.dist-info/METADATA +.venv/lib/python3.12/site-packages/playwright-1.51.0.dist-info/RECORD +.venv/lib/python3.12/site-packages/playwright-1.51.0.dist-info/REQUESTED +.venv/lib/python3.12/site-packages/playwright-1.51.0.dist-info/top_level.txt +.venv/lib/python3.12/site-packages/playwright-1.51.0.dist-info/WHEEL +.venv/lib/python3.12/site-packages/pyee/__init__.py +.venv/lib/python3.12/site-packages/pyee/asyncio.py +.venv/lib/python3.12/site-packages/pyee/base.py +.venv/lib/python3.12/site-packages/pyee/cls.py +.venv/lib/python3.12/site-packages/pyee/executor.py +.venv/lib/python3.12/site-packages/pyee/py.typed +.venv/lib/python3.12/site-packages/pyee/trio.py +.venv/lib/python3.12/site-packages/pyee/twisted.py +.venv/lib/python3.12/site-packages/pyee/uplift.py +.venv/lib/python3.12/site-packages/pyee/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/pyee/__pycache__/asyncio.cpython-312.pyc +.venv/lib/python3.12/site-packages/pyee/__pycache__/base.cpython-312.pyc +.venv/lib/python3.12/site-packages/pyee/__pycache__/cls.cpython-312.pyc +.venv/lib/python3.12/site-packages/pyee/__pycache__/executor.cpython-312.pyc +.venv/lib/python3.12/site-packages/pyee/__pycache__/trio.cpython-312.pyc +.venv/lib/python3.12/site-packages/pyee/__pycache__/twisted.cpython-312.pyc +.venv/lib/python3.12/site-packages/pyee/__pycache__/uplift.cpython-312.pyc +.venv/lib/python3.12/site-packages/pyee-12.1.1.dist-info/INSTALLER +.venv/lib/python3.12/site-packages/pyee-12.1.1.dist-info/LICENSE +.venv/lib/python3.12/site-packages/pyee-12.1.1.dist-info/METADATA +.venv/lib/python3.12/site-packages/pyee-12.1.1.dist-info/RECORD +.venv/lib/python3.12/site-packages/pyee-12.1.1.dist-info/top_level.txt +.venv/lib/python3.12/site-packages/pyee-12.1.1.dist-info/WHEEL +.venv/lib/python3.12/site-packages/requests/__init__.py +.venv/lib/python3.12/site-packages/requests/__version__.py +.venv/lib/python3.12/site-packages/requests/_internal_utils.py +.venv/lib/python3.12/site-packages/requests/adapters.py +.venv/lib/python3.12/site-packages/requests/api.py +.venv/lib/python3.12/site-packages/requests/auth.py +.venv/lib/python3.12/site-packages/requests/certs.py +.venv/lib/python3.12/site-packages/requests/compat.py +.venv/lib/python3.12/site-packages/requests/cookies.py +.venv/lib/python3.12/site-packages/requests/exceptions.py +.venv/lib/python3.12/site-packages/requests/help.py +.venv/lib/python3.12/site-packages/requests/hooks.py +.venv/lib/python3.12/site-packages/requests/models.py +.venv/lib/python3.12/site-packages/requests/packages.py +.venv/lib/python3.12/site-packages/requests/sessions.py +.venv/lib/python3.12/site-packages/requests/status_codes.py +.venv/lib/python3.12/site-packages/requests/structures.py +.venv/lib/python3.12/site-packages/requests/utils.py +.venv/lib/python3.12/site-packages/requests/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/requests/__pycache__/__version__.cpython-312.pyc +.venv/lib/python3.12/site-packages/requests/__pycache__/_internal_utils.cpython-312.pyc +.venv/lib/python3.12/site-packages/requests/__pycache__/adapters.cpython-312.pyc +.venv/lib/python3.12/site-packages/requests/__pycache__/api.cpython-312.pyc +.venv/lib/python3.12/site-packages/requests/__pycache__/auth.cpython-312.pyc +.venv/lib/python3.12/site-packages/requests/__pycache__/certs.cpython-312.pyc +.venv/lib/python3.12/site-packages/requests/__pycache__/compat.cpython-312.pyc +.venv/lib/python3.12/site-packages/requests/__pycache__/cookies.cpython-312.pyc +.venv/lib/python3.12/site-packages/requests/__pycache__/exceptions.cpython-312.pyc +.venv/lib/python3.12/site-packages/requests/__pycache__/help.cpython-312.pyc +.venv/lib/python3.12/site-packages/requests/__pycache__/hooks.cpython-312.pyc +.venv/lib/python3.12/site-packages/requests/__pycache__/models.cpython-312.pyc +.venv/lib/python3.12/site-packages/requests/__pycache__/packages.cpython-312.pyc +.venv/lib/python3.12/site-packages/requests/__pycache__/sessions.cpython-312.pyc +.venv/lib/python3.12/site-packages/requests/__pycache__/status_codes.cpython-312.pyc +.venv/lib/python3.12/site-packages/requests/__pycache__/structures.cpython-312.pyc +.venv/lib/python3.12/site-packages/requests/__pycache__/utils.cpython-312.pyc +.venv/lib/python3.12/site-packages/requests-2.32.3.dist-info/INSTALLER +.venv/lib/python3.12/site-packages/requests-2.32.3.dist-info/LICENSE +.venv/lib/python3.12/site-packages/requests-2.32.3.dist-info/METADATA +.venv/lib/python3.12/site-packages/requests-2.32.3.dist-info/RECORD +.venv/lib/python3.12/site-packages/requests-2.32.3.dist-info/REQUESTED +.venv/lib/python3.12/site-packages/requests-2.32.3.dist-info/top_level.txt +.venv/lib/python3.12/site-packages/requests-2.32.3.dist-info/WHEEL +.venv/lib/python3.12/site-packages/soupsieve/__init__.py +.venv/lib/python3.12/site-packages/soupsieve/__meta__.py +.venv/lib/python3.12/site-packages/soupsieve/css_match.py +.venv/lib/python3.12/site-packages/soupsieve/css_parser.py +.venv/lib/python3.12/site-packages/soupsieve/css_types.py +.venv/lib/python3.12/site-packages/soupsieve/pretty.py +.venv/lib/python3.12/site-packages/soupsieve/py.typed +.venv/lib/python3.12/site-packages/soupsieve/util.py +.venv/lib/python3.12/site-packages/soupsieve/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/soupsieve/__pycache__/__meta__.cpython-312.pyc +.venv/lib/python3.12/site-packages/soupsieve/__pycache__/css_match.cpython-312.pyc +.venv/lib/python3.12/site-packages/soupsieve/__pycache__/css_parser.cpython-312.pyc +.venv/lib/python3.12/site-packages/soupsieve/__pycache__/css_types.cpython-312.pyc +.venv/lib/python3.12/site-packages/soupsieve/__pycache__/pretty.cpython-312.pyc +.venv/lib/python3.12/site-packages/soupsieve/__pycache__/util.cpython-312.pyc +.venv/lib/python3.12/site-packages/soupsieve-2.6.dist-info/INSTALLER +.venv/lib/python3.12/site-packages/soupsieve-2.6.dist-info/METADATA +.venv/lib/python3.12/site-packages/soupsieve-2.6.dist-info/RECORD +.venv/lib/python3.12/site-packages/soupsieve-2.6.dist-info/WHEEL +.venv/lib/python3.12/site-packages/soupsieve-2.6.dist-info/licenses/LICENSE.md +.venv/lib/python3.12/site-packages/typing_extensions-4.13.1.dist-info/INSTALLER +.venv/lib/python3.12/site-packages/typing_extensions-4.13.1.dist-info/METADATA +.venv/lib/python3.12/site-packages/typing_extensions-4.13.1.dist-info/RECORD +.venv/lib/python3.12/site-packages/typing_extensions-4.13.1.dist-info/WHEEL +.venv/lib/python3.12/site-packages/typing_extensions-4.13.1.dist-info/licenses/LICENSE +.venv/lib/python3.12/site-packages/urllib3/__init__.py +.venv/lib/python3.12/site-packages/urllib3/_base_connection.py +.venv/lib/python3.12/site-packages/urllib3/_collections.py +.venv/lib/python3.12/site-packages/urllib3/_request_methods.py +.venv/lib/python3.12/site-packages/urllib3/_version.py +.venv/lib/python3.12/site-packages/urllib3/connection.py +.venv/lib/python3.12/site-packages/urllib3/connectionpool.py +.venv/lib/python3.12/site-packages/urllib3/exceptions.py +.venv/lib/python3.12/site-packages/urllib3/fields.py +.venv/lib/python3.12/site-packages/urllib3/filepost.py +.venv/lib/python3.12/site-packages/urllib3/poolmanager.py +.venv/lib/python3.12/site-packages/urllib3/py.typed +.venv/lib/python3.12/site-packages/urllib3/response.py +.venv/lib/python3.12/site-packages/urllib3/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/__pycache__/_base_connection.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/__pycache__/_collections.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/__pycache__/_request_methods.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/__pycache__/_version.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/__pycache__/connection.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/__pycache__/connectionpool.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/__pycache__/exceptions.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/__pycache__/fields.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/__pycache__/filepost.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/__pycache__/poolmanager.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/__pycache__/response.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/contrib/__init__.py +.venv/lib/python3.12/site-packages/urllib3/contrib/pyopenssl.py +.venv/lib/python3.12/site-packages/urllib3/contrib/socks.py +.venv/lib/python3.12/site-packages/urllib3/contrib/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/contrib/__pycache__/pyopenssl.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/contrib/__pycache__/socks.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/contrib/emscripten/__init__.py +.venv/lib/python3.12/site-packages/urllib3/contrib/emscripten/connection.py +.venv/lib/python3.12/site-packages/urllib3/contrib/emscripten/emscripten_fetch_worker.js +.venv/lib/python3.12/site-packages/urllib3/contrib/emscripten/fetch.py +.venv/lib/python3.12/site-packages/urllib3/contrib/emscripten/request.py +.venv/lib/python3.12/site-packages/urllib3/contrib/emscripten/response.py +.venv/lib/python3.12/site-packages/urllib3/contrib/emscripten/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/contrib/emscripten/__pycache__/connection.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/contrib/emscripten/__pycache__/fetch.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/contrib/emscripten/__pycache__/request.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/contrib/emscripten/__pycache__/response.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/http2/__init__.py +.venv/lib/python3.12/site-packages/urllib3/http2/connection.py +.venv/lib/python3.12/site-packages/urllib3/http2/probe.py +.venv/lib/python3.12/site-packages/urllib3/http2/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/http2/__pycache__/connection.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/http2/__pycache__/probe.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/util/__init__.py +.venv/lib/python3.12/site-packages/urllib3/util/connection.py +.venv/lib/python3.12/site-packages/urllib3/util/proxy.py +.venv/lib/python3.12/site-packages/urllib3/util/request.py +.venv/lib/python3.12/site-packages/urllib3/util/response.py +.venv/lib/python3.12/site-packages/urllib3/util/retry.py +.venv/lib/python3.12/site-packages/urllib3/util/ssl_.py +.venv/lib/python3.12/site-packages/urllib3/util/ssl_match_hostname.py +.venv/lib/python3.12/site-packages/urllib3/util/ssltransport.py +.venv/lib/python3.12/site-packages/urllib3/util/timeout.py +.venv/lib/python3.12/site-packages/urllib3/util/url.py +.venv/lib/python3.12/site-packages/urllib3/util/util.py +.venv/lib/python3.12/site-packages/urllib3/util/wait.py +.venv/lib/python3.12/site-packages/urllib3/util/__pycache__/__init__.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/util/__pycache__/connection.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/util/__pycache__/proxy.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/util/__pycache__/request.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/util/__pycache__/response.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/util/__pycache__/retry.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/util/__pycache__/ssl_.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/util/__pycache__/ssl_match_hostname.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/util/__pycache__/ssltransport.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/util/__pycache__/timeout.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/util/__pycache__/url.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/util/__pycache__/util.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3/util/__pycache__/wait.cpython-312.pyc +.venv/lib/python3.12/site-packages/urllib3-2.3.0.dist-info/INSTALLER +.venv/lib/python3.12/site-packages/urllib3-2.3.0.dist-info/METADATA +.venv/lib/python3.12/site-packages/urllib3-2.3.0.dist-info/RECORD +.venv/lib/python3.12/site-packages/urllib3-2.3.0.dist-info/WHEEL +.venv/lib/python3.12/site-packages/urllib3-2.3.0.dist-info/licenses/LICENSE.txt diff --git a/pine-script-intellij-plugin/.gitignore b/pine-script-intellij-plugin/.gitignore new file mode 100644 index 0000000..2bf8959 --- /dev/null +++ b/pine-script-intellij-plugin/.gitignore @@ -0,0 +1,31 @@ +# IntelliJ IDEA +.idea/ +*.iml +*.iws +*.ipr +out/ + +# Gradle +.gradle/ +build/ + +# Java +*.class +*.jar +*.war +*.ear + +# Log files +*.log + +# OS-specific files +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db + +# Ignore the .venv folder +.venv \ No newline at end of file diff --git a/pine-script-intellij-plugin/BUILDING.md b/pine-script-intellij-plugin/BUILDING.md new file mode 100644 index 0000000..340a785 --- /dev/null +++ b/pine-script-intellij-plugin/BUILDING.md @@ -0,0 +1,67 @@ +# Building the Pine Script JetBrains Plugin + +This document describes how to build the Pine Script plugin for JetBrains IDEs. + +## Prerequisites + +- Java JDK 17 or newer +- Git + +## Building from Source + +1. Clone the repository: + ```bash + git clone https://github.com/yourusername/pine-script-intellij-plugin.git + cd pine-script-intellij-plugin + ``` + +2. Build the plugin: + ```bash + ./gradlew buildPlugin + ``` + + This will generate the plugin ZIP file in the `build/distributions` directory. + +## Installing the Plugin from the ZIP File + +1. Open your JetBrains IDE (IntelliJ IDEA, WebStorm, etc.) +2. Go to **Settings/Preferences → Plugins** +3. Click on the gear icon and select **Install Plugin from Disk...** +4. Select the ZIP file from `build/distributions` +5. Restart your IDE + +## Development Workflow + +### Running the Plugin in Development Mode + +To run the plugin in a separate IntelliJ IDEA instance: + +```bash +./gradlew runIde +``` + +This will start a new IntelliJ IDEA instance with the plugin installed. + +### Testing + +To run the tests: + +```bash +./gradlew test +``` + +### Continuous Integration + +The project is set up to use GitHub Actions for CI. The workflow will build and test the plugin on every push. + +## Troubleshooting + +- **Problem**: Gradle fails to build + **Solution**: Make sure you have JDK 17 or newer installed and set as the project SDK in your IDE. + +- **Problem**: The plugin doesn't show up after installation + **Solution**: Make sure to restart your IDE after installing the plugin. + +## Documentation + +For more information about developing JetBrains plugins, see the [JetBrains Platform SDK Documentation](https://plugins.jetbrains.com/docs/intellij/welcome.html). \ No newline at end of file diff --git a/pine-script-intellij-plugin/README.md b/pine-script-intellij-plugin/README.md new file mode 100644 index 0000000..4f0a2a5 --- /dev/null +++ b/pine-script-intellij-plugin/README.md @@ -0,0 +1,73 @@ +# Pine Script Plugin for JetBrains IDEs + +This plugin provides Pine Script language support for JetBrains IDEs (IntelliJ IDEA, WebStorm, PyCharm, etc.). + +## Features + +- Syntax highlighting for Pine Script files (`.pine`, `.ps`, `.pinescript`) +- Code completion for built-in functions, variables, and methods +- Parameter information for function calls +- Color preview in editor +- Documentation on hover +- New Pine Script file templates (Indicator, Strategy, Library) + +## Installation + +### From JetBrains Marketplace + +1. Open your JetBrains IDE +2. Go to Settings/Preferences → Plugins +3. Click on "Browse repositories..." +4. Search for "Pine Script" +5. Install the plugin +6. Restart your IDE + +### Manual Installation + +1. Download the plugin from [Releases](https://github.com/yourusername/pine-script-intellij-plugin/releases) +2. Open your JetBrains IDE +3. Go to Settings/Preferences → Plugins +4. Click on the gear icon +5. Select "Install Plugin from Disk..." +6. Choose the downloaded ZIP file +7. Restart your IDE + +## Usage + +### Creating New Pine Script Files + +1. Right-click in the Project window +2. Select New → Pine Script File +3. Choose the type of file (Indicator, Strategy, Library, or Empty) +4. Enter the name of the file +5. Click OK + +### Features + +- **Syntax Highlighting**: Pine Script keywords, functions, and variables are highlighted automatically. +- **Code Completion**: Press Ctrl+Space to see completion suggestions as you type. +- **Parameter Info**: Press Ctrl+P inside function parentheses to see parameter information. +- **Documentation**: Hover over a function or keyword to see its documentation. +- **Color Preview**: Hex colors and color.NAME values show a color preview in the editor gutter. + +## Building from Source + +```bash +git clone https://github.com/yourusername/pine-script-intellij-plugin.git +cd pine-script-intellij-plugin +./gradlew buildPlugin +``` + +The plugin will be built in `build/distributions/`. + +## Contributing + +Contributions are welcome! Please feel free to submit a Pull Request. + +## License + +This plugin is released under the MIT License. See the [LICENSE](LICENSE) file for details. + +## Acknowledgements + +This plugin was inspired by the [Pine Script VS Code Plugin](https://github.com/FFriZ/Pine-Script-v5-VS-Code). \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/META-INF/filewatcher.xml b/pine-script-intellij-plugin/bin/main/META-INF/filewatcher.xml new file mode 100644 index 0000000..16651ad --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/META-INF/filewatcher.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/META-INF/pine-script.xml b/pine-script-intellij-plugin/bin/main/META-INF/pine-script.xml new file mode 100644 index 0000000..65eae69 --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/META-INF/pine-script.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/META-INF/plugin.xml b/pine-script-intellij-plugin/bin/main/META-INF/plugin.xml new file mode 100644 index 0000000..423911b --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/META-INF/plugin.xml @@ -0,0 +1,84 @@ + + com.pinescript.plugin + Pine Script + Pine Script + + Pine Script language support for JetBrains IDEs.

+

Features:

+ + ]]>
+ + com.intellij.modules.platform + org.jetbrains.plugins.textmate + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/META-INF/plugin.xml.bak b/pine-script-intellij-plugin/bin/main/META-INF/plugin.xml.bak new file mode 100644 index 0000000..023f814 --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/META-INF/plugin.xml.bak @@ -0,0 +1,53 @@ + + com.pinescript.plugin + Pine Script + Pine Script + + Pine Script language support for JetBrains IDEs.

+

Features:

+ + ]]>
+ + com.intellij.modules.platform + org.jetbrains.plugins.textmate + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/META-INF/plugin.xml.bak2 b/pine-script-intellij-plugin/bin/main/META-INF/plugin.xml.bak2 new file mode 100644 index 0000000..590ba17 --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/META-INF/plugin.xml.bak2 @@ -0,0 +1,54 @@ + + com.pinescript.plugin + Pine Script + Pine Script + + Pine Script language support for JetBrains IDEs.

+

Features:

+ + ]]>
+ + com.intellij.modules.platform + org.jetbrains.plugins.textmate + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/PineScriptAutoPopup.properties b/pine-script-intellij-plugin/bin/main/PineScriptAutoPopup.properties new file mode 100644 index 0000000..fef5dec --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/PineScriptAutoPopup.properties @@ -0,0 +1,4 @@ +# Define characters that should trigger auto-popup in Pine Script +# The dot character is used for namespace member completion +# Parenthesis and comma are used for function parameter completion +autoPopupChars=.,( \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/autoPopup.properties b/pine-script-intellij-plugin/bin/main/autoPopup.properties new file mode 100644 index 0000000..ef2452e --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/autoPopup.properties @@ -0,0 +1,3 @@ +# Characters that trigger autocompletion in Pine Script +# This includes dot for member access, parenthesis for function calls, and comma for function parameters +auto.popup.chars=.,( \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptColorSettingsPage.java.bak b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptColorSettingsPage.java.bak new file mode 100644 index 0000000..11af1e4 --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptColorSettingsPage.java.bak @@ -0,0 +1,108 @@ +package com.pinescript.plugin.editor; + +import com.intellij.openapi.editor.colors.TextAttributesKey; +import com.intellij.openapi.fileTypes.SyntaxHighlighter; +import com.intellij.openapi.options.colors.AttributesDescriptor; +import com.intellij.openapi.options.colors.ColorDescriptor; +import com.intellij.openapi.options.colors.ColorSettingsPage; +import com.pinescript.plugin.language.PineScriptIcons; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import javax.swing.*; +import java.util.Map; + +public class PineScriptColorSettingsPage implements ColorSettingsPage { + private static final AttributesDescriptor[] DESCRIPTORS = new AttributesDescriptor[]{ + new AttributesDescriptor("Keywords", PineScriptSyntaxHighlighter.KEYWORD), + new AttributesDescriptor("Identifiers", PineScriptSyntaxHighlighter.IDENTIFIER), + new AttributesDescriptor("Comments", PineScriptSyntaxHighlighter.COMMENT), + new AttributesDescriptor("Strings", PineScriptSyntaxHighlighter.STRING), + new AttributesDescriptor("Numbers", PineScriptSyntaxHighlighter.NUMBER), + new AttributesDescriptor("Operators", PineScriptSyntaxHighlighter.OPERATOR), + new AttributesDescriptor("Parentheses", PineScriptSyntaxHighlighter.PARENTHESES), + new AttributesDescriptor("Brackets", PineScriptSyntaxHighlighter.BRACKETS), + new AttributesDescriptor("Braces", PineScriptSyntaxHighlighter.BRACES), + new AttributesDescriptor("Commas", PineScriptSyntaxHighlighter.COMMA), + new AttributesDescriptor("Dots", PineScriptSyntaxHighlighter.DOT), + new AttributesDescriptor("Semicolons", PineScriptSyntaxHighlighter.SEMICOLON), + new AttributesDescriptor("Functions", PineScriptSyntaxHighlighter.FUNCTION), + new AttributesDescriptor("Namespaces", PineScriptSyntaxHighlighter.NAMESPACE), + new AttributesDescriptor("Types", PineScriptSyntaxHighlighter.TYPE), + new AttributesDescriptor("Boolean Values", PineScriptSyntaxHighlighter.TRUE_FALSE), + new AttributesDescriptor("NA Values", PineScriptSyntaxHighlighter.NA), + new AttributesDescriptor("Color Constants", PineScriptSyntaxHighlighter.COLOR_CONSTANT), + new AttributesDescriptor("Exit Labels", PineScriptSyntaxHighlighter.EXIT_LABEL), + new AttributesDescriptor("Built-in Variables", PineScriptSyntaxHighlighter.BUILT_IN_VARIABLE) + }; + + @Nullable + @Override + public Icon getIcon() { + return PineScriptIcons.FILE; + } + + @NotNull + @Override + public SyntaxHighlighter getHighlighter() { + return new PineScriptSyntaxHighlighter(); + } + + @NotNull + @Override + public String getDemoText() { + return """ + // This is a comment + //@version=5 + indicator("My Script", overlay=true) + + var float myVar = 3.14 + myValue = na + isTrue = true + isFalse = false + + myFunction(param1, param2) => + result = math.max(param1, param2) + result + + if (ta.crossover(close, open)) + label.new(bar_index, high, text="Crossover", color=color.green) + + plot(close, color=color.blue, title="Close") + plot(open, color=color.red, title="Open") + + if (low <= trailStop) + strategy.exit("Long TS Exit", from_entry=entry_id, stop=trailStop) + + if (high >= trailStop) + strategy.exit("Short TS Exit", from_entry=entry_id, stop=trailStop) + + // Demonstrate built-in variables + alertCondition(close > open, title="Price Up", message="Price moved up") + """; + } + + @Nullable + @Override + public Map getAdditionalHighlightingTagToDescriptorMap() { + return null; + } + + @NotNull + @Override + public AttributesDescriptor[] getAttributeDescriptors() { + return DESCRIPTORS; + } + + @NotNull + @Override + public ColorDescriptor[] getColorDescriptors() { + return ColorDescriptor.EMPTY_ARRAY; + } + + @NotNull + @Override + public String getDisplayName() { + return "Pine Script"; + } +} \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak new file mode 100644 index 0000000..fb3f47b --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak @@ -0,0 +1,160 @@ +package com.pinescript.plugin.editor; + +import com.intellij.lexer.Lexer; +import com.intellij.openapi.editor.DefaultLanguageHighlighterColors; +import com.intellij.openapi.editor.HighlighterColors; +import com.intellij.openapi.editor.colors.TextAttributesKey; +import com.intellij.openapi.editor.markup.TextAttributes; +import com.intellij.openapi.fileTypes.SyntaxHighlighterBase; +import com.intellij.psi.TokenType; +import com.intellij.psi.tree.IElementType; +import com.intellij.psi.tree.TokenSet; +import com.pinescript.plugin.language.PineScriptLexer; +import com.pinescript.plugin.psi.PineScriptTokenTypes; +import org.jetbrains.annotations.NotNull; + +import java.awt.*; + +import static com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey; + +public class PineScriptSyntaxHighlighter extends SyntaxHighlighterBase { + // TradingView-like colors based on the screenshot + private static final Color KEYWORD_COLOR = new Color(66, 165, 245); // Blue for keywords (var, if) + private static final Color STRING_COLOR = new Color(198, 120, 93); // Orange-brown for strings + private static final Color NUMBER_COLOR = new Color(182, 232, 184); // Light green for numbers + private static final Color COMMENT_COLOR = new Color(118, 185, 0); // Green for comments + private static final Color FUNCTION_COLOR = new Color(255, 215, 95); // Yellow for functions + private static final Color OPERATOR_COLOR = new Color(202, 202, 202); // Light gray for operators + private static final Color IDENTIFIER_COLOR = new Color(242, 242, 242); // White/very light gray for identifiers/variables + private static final Color TYPE_COLOR = new Color(66, 165, 245); // Blue for types (float, bool) + private static final Color NAMESPACE_COLOR = new Color(96, 205, 200); // Teal for namespaces + private static final Color BUILT_IN_VAR_COLOR = new Color(255, 215, 95); // Yellow for built-in variables (open, high, low, close) + + // Special colors for specific elements + private static final Color TRUE_FALSE_COLOR = new Color(66, 165, 245); // Blue for true/false + private static final Color NA_COLOR = new Color(66, 165, 245); // Blue for na values + private static final Color PLOT_COLOR_RED = new Color(255, 105, 95); // Red for plot color + private static final Color PLOT_COLOR_BLUE = new Color(107, 165, 220); // Blue for plot color + private static final Color COLOR_CONSTANTS = new Color(198, 120, 93); // Orange-brown for color constants + private static final Color EXIT_LABEL_COLOR = new Color(255, 105, 95); // Red for exit labels + + // Create TextAttributes with TradingView-like colors + private static final TextAttributes KEYWORD_ATTRIBUTES = new TextAttributes(KEYWORD_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes STRING_ATTRIBUTES = new TextAttributes(STRING_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NUMBER_ATTRIBUTES = new TextAttributes(NUMBER_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes COMMENT_ATTRIBUTES = new TextAttributes(COMMENT_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes FUNCTION_ATTRIBUTES = new TextAttributes(FUNCTION_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes OPERATOR_ATTRIBUTES = new TextAttributes(OPERATOR_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes IDENTIFIER_ATTRIBUTES = new TextAttributes(IDENTIFIER_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes TYPE_ATTRIBUTES = new TextAttributes(TYPE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NAMESPACE_ATTRIBUTES = new TextAttributes(NAMESPACE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes TRUE_FALSE_ATTRIBUTES = new TextAttributes(TRUE_FALSE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NA_ATTRIBUTES = new TextAttributes(NA_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes COLOR_CONSTANT_ATTRIBUTES = new TextAttributes(COLOR_CONSTANTS, null, null, null, Font.PLAIN); + private static final TextAttributes EXIT_LABEL_ATTRIBUTES = new TextAttributes(EXIT_LABEL_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes BUILT_IN_VAR_ATTRIBUTES = new TextAttributes(BUILT_IN_VAR_COLOR, null, null, null, Font.PLAIN); + + // Create TextAttributesKey with custom attributes + public static final TextAttributesKey KEYWORD = createTextAttributesKey("PINE_SCRIPT_KEYWORD", KEYWORD_ATTRIBUTES); + public static final TextAttributesKey STRING = createTextAttributesKey("PINE_SCRIPT_STRING", STRING_ATTRIBUTES); + public static final TextAttributesKey NUMBER = createTextAttributesKey("PINE_SCRIPT_NUMBER", NUMBER_ATTRIBUTES); + public static final TextAttributesKey COMMENT = createTextAttributesKey("PINE_SCRIPT_COMMENT", COMMENT_ATTRIBUTES); + public static final TextAttributesKey FUNCTION = createTextAttributesKey("PINE_SCRIPT_FUNCTION", FUNCTION_ATTRIBUTES); + public static final TextAttributesKey OPERATOR = createTextAttributesKey("PINE_SCRIPT_OPERATOR", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey IDENTIFIER = createTextAttributesKey("PINE_SCRIPT_IDENTIFIER", IDENTIFIER_ATTRIBUTES); + public static final TextAttributesKey TYPE = createTextAttributesKey("PINE_SCRIPT_TYPE", TYPE_ATTRIBUTES); + public static final TextAttributesKey NAMESPACE = createTextAttributesKey("PINE_SCRIPT_NAMESPACE", NAMESPACE_ATTRIBUTES); + public static final TextAttributesKey TRUE_FALSE = createTextAttributesKey("PINE_SCRIPT_TRUE_FALSE", TRUE_FALSE_ATTRIBUTES); + public static final TextAttributesKey NA = createTextAttributesKey("PINE_SCRIPT_NA", NA_ATTRIBUTES); + public static final TextAttributesKey COLOR_CONSTANT = createTextAttributesKey("PINE_SCRIPT_COLOR_CONSTANT", COLOR_CONSTANT_ATTRIBUTES); + public static final TextAttributesKey EXIT_LABEL = createTextAttributesKey("PINE_SCRIPT_EXIT_LABEL", EXIT_LABEL_ATTRIBUTES); + public static final TextAttributesKey BUILT_IN_VARIABLE = createTextAttributesKey("PINE_SCRIPT_BUILT_IN_VARIABLE", BUILT_IN_VAR_ATTRIBUTES); + + // Use default colors for these + public static final TextAttributesKey PARENTHESES = createTextAttributesKey("PINE_SCRIPT_PARENTHESES", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BRACKETS = createTextAttributesKey("PINE_SCRIPT_BRACKETS", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BRACES = createTextAttributesKey("PINE_SCRIPT_BRACES", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey COMMA = createTextAttributesKey("PINE_SCRIPT_COMMA", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey DOT = createTextAttributesKey("PINE_SCRIPT_DOT", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey SEMICOLON = createTextAttributesKey("PINE_SCRIPT_SEMICOLON", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BAD_CHARACTER = createTextAttributesKey("PINE_SCRIPT_BAD_CHARACTER", HighlighterColors.BAD_CHARACTER); + + // Token sets for more efficient handling + private static final TokenSet KEYWORD_TOKENS = TokenSet.create(PineScriptTokenTypes.KEYWORD); + private static final TokenSet STRING_TOKENS = TokenSet.create(PineScriptTokenTypes.STRING); + private static final TokenSet NUMBER_TOKENS = TokenSet.create(PineScriptTokenTypes.NUMBER); + private static final TokenSet COMMENT_TOKENS = TokenSet.create(PineScriptTokenTypes.COMMENT); + private static final TokenSet FUNCTION_TOKENS = TokenSet.create(PineScriptTokenTypes.FUNCTION); + private static final TokenSet OPERATOR_TOKENS = TokenSet.create(PineScriptTokenTypes.OPERATOR); + private static final TokenSet IDENTIFIER_TOKENS = TokenSet.create(PineScriptTokenTypes.IDENTIFIER); + private static final TokenSet TYPE_TOKENS = TokenSet.create(PineScriptTokenTypes.TYPE); + private static final TokenSet NAMESPACE_TOKENS = TokenSet.create(PineScriptTokenTypes.NAMESPACE); + private static final TokenSet TRUE_FALSE_TOKENS = TokenSet.create(PineScriptTokenTypes.TRUE_FALSE); + private static final TokenSet NA_TOKENS = TokenSet.create(PineScriptTokenTypes.NA); + private static final TokenSet COLOR_CONSTANT_TOKENS = TokenSet.create(PineScriptTokenTypes.COLOR_CONSTANT); + private static final TokenSet EXIT_LABEL_TOKENS = TokenSet.create(PineScriptTokenTypes.EXIT_LABEL); + private static final TokenSet BUILT_IN_VAR_TOKENS = TokenSet.create(PineScriptTokenTypes.BUILT_IN_VARIABLE); + private static final TokenSet BAD_CHAR_TOKENS = TokenSet.create(TokenType.BAD_CHARACTER); + + @NotNull + @Override + public Lexer getHighlightingLexer() { + return new PineScriptLexer(); + } + + @Override + public TextAttributesKey @NotNull [] getTokenHighlights(IElementType tokenType) { + if (tokenType == null) return TextAttributesKey.EMPTY_ARRAY; + + if (KEYWORD_TOKENS.contains(tokenType)) { + return pack(KEYWORD); + } else if (IDENTIFIER_TOKENS.contains(tokenType)) { + return pack(IDENTIFIER); + } else if (COMMENT_TOKENS.contains(tokenType)) { + return pack(COMMENT); + } else if (STRING_TOKENS.contains(tokenType)) { + return pack(STRING); + } else if (NUMBER_TOKENS.contains(tokenType)) { + return pack(NUMBER); + } else if (OPERATOR_TOKENS.contains(tokenType)) { + return pack(OPERATOR); + } else if (FUNCTION_TOKENS.contains(tokenType)) { + // Only highlight as function if it's a function token + return pack(FUNCTION); + } else if (NAMESPACE_TOKENS.contains(tokenType)) { + return pack(NAMESPACE); + } else if (TYPE_TOKENS.contains(tokenType)) { + return pack(TYPE); + } else if (TRUE_FALSE_TOKENS.contains(tokenType)) { + return pack(TRUE_FALSE); + } else if (NA_TOKENS.contains(tokenType)) { + return pack(NA); + } else if (COLOR_CONSTANT_TOKENS.contains(tokenType)) { + return pack(COLOR_CONSTANT); + } else if (EXIT_LABEL_TOKENS.contains(tokenType)) { + return pack(EXIT_LABEL); + } else if (BUILT_IN_VAR_TOKENS.contains(tokenType)) { + return pack(BUILT_IN_VARIABLE); + } else if (BAD_CHAR_TOKENS.contains(tokenType)) { + return pack(BAD_CHARACTER); + } + + // Handle punctuation + if (tokenType.equals(PineScriptTokenTypes.LPAREN) || tokenType.equals(PineScriptTokenTypes.RPAREN)) { + return pack(PARENTHESES); + } else if (tokenType.equals(PineScriptTokenTypes.LBRACKET) || tokenType.equals(PineScriptTokenTypes.RBRACKET)) { + return pack(BRACKETS); + } else if (tokenType.equals(PineScriptTokenTypes.LBRACE) || tokenType.equals(PineScriptTokenTypes.RBRACE)) { + return pack(BRACES); + } else if (tokenType.equals(PineScriptTokenTypes.COMMA)) { + return pack(COMMA); + } else if (tokenType.equals(PineScriptTokenTypes.DOT)) { + return pack(DOT); + } else if (tokenType.equals(PineScriptTokenTypes.SEMICOLON)) { + return pack(SEMICOLON); + } + + // Default to identifier color for any unmatched tokens that might be variables + return pack(IDENTIFIER); + } +} \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak10 b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak10 new file mode 100644 index 0000000..7fc4dd6 --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak10 @@ -0,0 +1,160 @@ +package com.pinescript.plugin.editor; + +import com.intellij.lexer.Lexer; +import com.intellij.openapi.editor.DefaultLanguageHighlighterColors; +import com.intellij.openapi.editor.HighlighterColors; +import com.intellij.openapi.editor.colors.TextAttributesKey; +import com.intellij.openapi.editor.markup.TextAttributes; +import com.intellij.openapi.fileTypes.SyntaxHighlighterBase; +import com.intellij.psi.TokenType; +import com.intellij.psi.tree.IElementType; +import com.intellij.psi.tree.TokenSet; +import com.pinescript.plugin.language.PineScriptLexer; +import com.pinescript.plugin.psi.PineScriptTokenTypes; +import org.jetbrains.annotations.NotNull; + +import java.awt.*; + +import static com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey; + +public class PineScriptSyntaxHighlighter extends SyntaxHighlighterBase { + // TradingView-like colors based on the screenshot + private static final Color KEYWORD_COLOR = new Color(83, 169, 149); // Green for keywords // Blue for keywords (var, if) + private static final Color STRING_COLOR = new Color(80, 140, 70); // Warm green for strings // Orange-brown for strings + private static final Color NUMBER_COLOR = new Color(230, 133, 55); // Orange for numbers // Light green for numbers + private static final Color COMMENT_COLOR = new Color(156, 156, 156); // Grey for comments // Green for comments + private static final Color FUNCTION_COLOR = new Color(56, 97, 246); // Blue for functions // Yellow for functions + private static final Color OPERATOR_COLOR = new Color(83, 169, 149); // Green for operators // Light gray for operators + private static final Color IDENTIFIER_COLOR = new Color(46, 46, 46); // Black for variables // White/very light gray for identifiers/variables + private static final Color TYPE_COLOR = new Color(188, 57, 50); // Red-Orange for types // Blue for types (float, bool) + private static final Color NAMESPACE_COLOR = new Color(83, 169, 149); // Green for namespaces // Teal for namespaces + private static final Color BUILT_IN_VAR_COLOR = new Color(255, 215, 95); // Yellow for built-in variables (open, high, low, close) + + // Special colors for specific elements + private static final Color TRUE_FALSE_COLOR = new Color(66, 165, 245); // Blue for true/false + private static final Color NA_COLOR = new Color(66, 165, 245); // Blue for na values + private static final Color PLOT_COLOR_RED = new Color(255, 105, 95); // Red for plot color + private static final Color PLOT_COLOR_BLUE = new Color(107, 165, 220); // Blue for plot color + private static final Color COLOR_CONSTANTS = new Color(198, 120, 93); // Orange-brown for color constants + private static final Color EXIT_LABEL_COLOR = new Color(255, 105, 95); // Red for exit labels + + // Create TextAttributes with TradingView-like colors + private static final TextAttributes KEYWORD_ATTRIBUTES = new TextAttributes(KEYWORD_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes STRING_ATTRIBUTES = new TextAttributes(STRING_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NUMBER_ATTRIBUTES = new TextAttributes(NUMBER_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes COMMENT_ATTRIBUTES = new TextAttributes(COMMENT_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes FUNCTION_ATTRIBUTES = new TextAttributes(FUNCTION_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes OPERATOR_ATTRIBUTES = new TextAttributes(OPERATOR_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes IDENTIFIER_ATTRIBUTES = new TextAttributes(IDENTIFIER_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes TYPE_ATTRIBUTES = new TextAttributes(TYPE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NAMESPACE_ATTRIBUTES = new TextAttributes(NAMESPACE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes TRUE_FALSE_ATTRIBUTES = new TextAttributes(TRUE_FALSE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NA_ATTRIBUTES = new TextAttributes(NA_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes COLOR_CONSTANT_ATTRIBUTES = new TextAttributes(COLOR_CONSTANTS, null, null, null, Font.PLAIN); + private static final TextAttributes EXIT_LABEL_ATTRIBUTES = new TextAttributes(EXIT_LABEL_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes BUILT_IN_VAR_ATTRIBUTES = new TextAttributes(BUILT_IN_VAR_COLOR, null, null, null, Font.PLAIN); + + // Create TextAttributesKey with custom attributes + public static final TextAttributesKey KEYWORD = createTextAttributesKey("PINE_SCRIPT_KEYWORD", KEYWORD_ATTRIBUTES); + public static final TextAttributesKey STRING = createTextAttributesKey("PINE_SCRIPT_STRING", STRING_ATTRIBUTES); + public static final TextAttributesKey NUMBER = createTextAttributesKey("PINE_SCRIPT_NUMBER", NUMBER_ATTRIBUTES); + public static final TextAttributesKey COMMENT = createTextAttributesKey("PINE_SCRIPT_COMMENT", COMMENT_ATTRIBUTES); + public static final TextAttributesKey FUNCTION = createTextAttributesKey("PINE_SCRIPT_FUNCTION", FUNCTION_ATTRIBUTES); + public static final TextAttributesKey OPERATOR = createTextAttributesKey("PINE_SCRIPT_OPERATOR", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey IDENTIFIER = createTextAttributesKey("PINE_SCRIPT_IDENTIFIER", IDENTIFIER_ATTRIBUTES); + public static final TextAttributesKey TYPE = createTextAttributesKey("PINE_SCRIPT_TYPE", TYPE_ATTRIBUTES); + public static final TextAttributesKey NAMESPACE = createTextAttributesKey("PINE_SCRIPT_NAMESPACE", NAMESPACE_ATTRIBUTES); + public static final TextAttributesKey TRUE_FALSE = createTextAttributesKey("PINE_SCRIPT_TRUE_FALSE", TRUE_FALSE_ATTRIBUTES); + public static final TextAttributesKey NA = createTextAttributesKey("PINE_SCRIPT_NA", NA_ATTRIBUTES); + public static final TextAttributesKey COLOR_CONSTANT = createTextAttributesKey("PINE_SCRIPT_COLOR_CONSTANT", COLOR_CONSTANT_ATTRIBUTES); + public static final TextAttributesKey EXIT_LABEL = createTextAttributesKey("PINE_SCRIPT_EXIT_LABEL", EXIT_LABEL_ATTRIBUTES); + public static final TextAttributesKey BUILT_IN_VARIABLE = createTextAttributesKey("PINE_SCRIPT_BUILT_IN_VARIABLE", BUILT_IN_VAR_ATTRIBUTES); + + // Use default colors for these + public static final TextAttributesKey PARENTHESES = createTextAttributesKey("PINE_SCRIPT_PARENTHESES", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BRACKETS = createTextAttributesKey("PINE_SCRIPT_BRACKETS", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BRACES = createTextAttributesKey("PINE_SCRIPT_BRACES", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey COMMA = createTextAttributesKey("PINE_SCRIPT_COMMA", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey DOT = createTextAttributesKey("PINE_SCRIPT_DOT", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey SEMICOLON = createTextAttributesKey("PINE_SCRIPT_SEMICOLON", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BAD_CHARACTER = createTextAttributesKey("PINE_SCRIPT_BAD_CHARACTER", HighlighterColors.BAD_CHARACTER); + + // Token sets for more efficient handling + private static final TokenSet KEYWORD_TOKENS = TokenSet.create(PineScriptTokenTypes.KEYWORD); + private static final TokenSet STRING_TOKENS = TokenSet.create(PineScriptTokenTypes.STRING); + private static final TokenSet NUMBER_TOKENS = TokenSet.create(PineScriptTokenTypes.NUMBER); + private static final TokenSet COMMENT_TOKENS = TokenSet.create(PineScriptTokenTypes.COMMENT); + private static final TokenSet FUNCTION_TOKENS = TokenSet.create(PineScriptTokenTypes.FUNCTION); + private static final TokenSet OPERATOR_TOKENS = TokenSet.create(PineScriptTokenTypes.OPERATOR); + private static final TokenSet IDENTIFIER_TOKENS = TokenSet.create(PineScriptTokenTypes.IDENTIFIER); + private static final TokenSet TYPE_TOKENS = TokenSet.create(PineScriptTokenTypes.TYPE); + private static final TokenSet NAMESPACE_TOKENS = TokenSet.create(PineScriptTokenTypes.NAMESPACE); + private static final TokenSet TRUE_FALSE_TOKENS = TokenSet.create(PineScriptTokenTypes.TRUE_FALSE); + private static final TokenSet NA_TOKENS = TokenSet.create(PineScriptTokenTypes.NA); + private static final TokenSet COLOR_CONSTANT_TOKENS = TokenSet.create(PineScriptTokenTypes.COLOR_CONSTANT); + private static final TokenSet EXIT_LABEL_TOKENS = TokenSet.create(PineScriptTokenTypes.EXIT_LABEL); + private static final TokenSet BUILT_IN_VAR_TOKENS = TokenSet.create(PineScriptTokenTypes.BUILT_IN_VARIABLE); + private static final TokenSet BAD_CHAR_TOKENS = TokenSet.create(TokenType.BAD_CHARACTER); + + @NotNull + @Override + public Lexer getHighlightingLexer() { + return new PineScriptLexer(); + } + + @Override + public TextAttributesKey @NotNull [] getTokenHighlights(IElementType tokenType) { + if (tokenType == null) return TextAttributesKey.EMPTY_ARRAY; + + if (KEYWORD_TOKENS.contains(tokenType)) { + return pack(KEYWORD); + } else if (IDENTIFIER_TOKENS.contains(tokenType)) { + return pack(IDENTIFIER); + } else if (COMMENT_TOKENS.contains(tokenType)) { + return pack(COMMENT); + } else if (STRING_TOKENS.contains(tokenType)) { + return pack(STRING); + } else if (NUMBER_TOKENS.contains(tokenType)) { + return pack(NUMBER); + } else if (OPERATOR_TOKENS.contains(tokenType)) { + return pack(OPERATOR); + } else if (FUNCTION_TOKENS.contains(tokenType)) { + // Only highlight as function if it's a function token + return pack(FUNCTION); + } else if (NAMESPACE_TOKENS.contains(tokenType)) { + return pack(NAMESPACE); + } else if (TYPE_TOKENS.contains(tokenType)) { + return pack(TYPE); + } else if (TRUE_FALSE_TOKENS.contains(tokenType)) { + return pack(TRUE_FALSE); + } else if (NA_TOKENS.contains(tokenType)) { + return pack(NA); + } else if (COLOR_CONSTANT_TOKENS.contains(tokenType)) { + return pack(COLOR_CONSTANT); + } else if (EXIT_LABEL_TOKENS.contains(tokenType)) { + return pack(EXIT_LABEL); + } else if (BUILT_IN_VAR_TOKENS.contains(tokenType)) { + return pack(BUILT_IN_VARIABLE); + } else if (BAD_CHAR_TOKENS.contains(tokenType)) { + return pack(BAD_CHARACTER); + } + + // Handle punctuation + if (tokenType.equals(PineScriptTokenTypes.LPAREN) || tokenType.equals(PineScriptTokenTypes.RPAREN)) { + return pack(PARENTHESES); + } else if (tokenType.equals(PineScriptTokenTypes.LBRACKET) || tokenType.equals(PineScriptTokenTypes.RBRACKET)) { + return pack(BRACKETS); + } else if (tokenType.equals(PineScriptTokenTypes.LBRACE) || tokenType.equals(PineScriptTokenTypes.RBRACE)) { + return pack(BRACES); + } else if (tokenType.equals(PineScriptTokenTypes.COMMA)) { + return pack(COMMA); + } else if (tokenType.equals(PineScriptTokenTypes.DOT)) { + return pack(DOT); + } else if (tokenType.equals(PineScriptTokenTypes.SEMICOLON)) { + return pack(SEMICOLON); + } + + // Default to identifier color for any unmatched tokens that might be variables + return pack(IDENTIFIER); + } +} \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak2 b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak2 new file mode 100644 index 0000000..749a343 --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak2 @@ -0,0 +1,160 @@ +package com.pinescript.plugin.editor; + +import com.intellij.lexer.Lexer; +import com.intellij.openapi.editor.DefaultLanguageHighlighterColors; +import com.intellij.openapi.editor.HighlighterColors; +import com.intellij.openapi.editor.colors.TextAttributesKey; +import com.intellij.openapi.editor.markup.TextAttributes; +import com.intellij.openapi.fileTypes.SyntaxHighlighterBase; +import com.intellij.psi.TokenType; +import com.intellij.psi.tree.IElementType; +import com.intellij.psi.tree.TokenSet; +import com.pinescript.plugin.language.PineScriptLexer; +import com.pinescript.plugin.psi.PineScriptTokenTypes; +import org.jetbrains.annotations.NotNull; + +import java.awt.*; + +import static com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey; + +public class PineScriptSyntaxHighlighter extends SyntaxHighlighterBase { + // TradingView-like colors based on the screenshot + private static final Color KEYWORD_COLOR = new Color(83, 169, 149); // Green for keywords // Blue for keywords (var, if) + private static final Color STRING_COLOR = new Color(198, 120, 93); // Orange-brown for strings + private static final Color NUMBER_COLOR = new Color(182, 232, 184); // Light green for numbers + private static final Color COMMENT_COLOR = new Color(118, 185, 0); // Green for comments + private static final Color FUNCTION_COLOR = new Color(255, 215, 95); // Yellow for functions + private static final Color OPERATOR_COLOR = new Color(202, 202, 202); // Light gray for operators + private static final Color IDENTIFIER_COLOR = new Color(242, 242, 242); // White/very light gray for identifiers/variables + private static final Color TYPE_COLOR = new Color(66, 165, 245); // Blue for types (float, bool) + private static final Color NAMESPACE_COLOR = new Color(96, 205, 200); // Teal for namespaces + private static final Color BUILT_IN_VAR_COLOR = new Color(255, 215, 95); // Yellow for built-in variables (open, high, low, close) + + // Special colors for specific elements + private static final Color TRUE_FALSE_COLOR = new Color(66, 165, 245); // Blue for true/false + private static final Color NA_COLOR = new Color(66, 165, 245); // Blue for na values + private static final Color PLOT_COLOR_RED = new Color(255, 105, 95); // Red for plot color + private static final Color PLOT_COLOR_BLUE = new Color(107, 165, 220); // Blue for plot color + private static final Color COLOR_CONSTANTS = new Color(198, 120, 93); // Orange-brown for color constants + private static final Color EXIT_LABEL_COLOR = new Color(255, 105, 95); // Red for exit labels + + // Create TextAttributes with TradingView-like colors + private static final TextAttributes KEYWORD_ATTRIBUTES = new TextAttributes(KEYWORD_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes STRING_ATTRIBUTES = new TextAttributes(STRING_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NUMBER_ATTRIBUTES = new TextAttributes(NUMBER_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes COMMENT_ATTRIBUTES = new TextAttributes(COMMENT_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes FUNCTION_ATTRIBUTES = new TextAttributes(FUNCTION_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes OPERATOR_ATTRIBUTES = new TextAttributes(OPERATOR_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes IDENTIFIER_ATTRIBUTES = new TextAttributes(IDENTIFIER_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes TYPE_ATTRIBUTES = new TextAttributes(TYPE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NAMESPACE_ATTRIBUTES = new TextAttributes(NAMESPACE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes TRUE_FALSE_ATTRIBUTES = new TextAttributes(TRUE_FALSE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NA_ATTRIBUTES = new TextAttributes(NA_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes COLOR_CONSTANT_ATTRIBUTES = new TextAttributes(COLOR_CONSTANTS, null, null, null, Font.PLAIN); + private static final TextAttributes EXIT_LABEL_ATTRIBUTES = new TextAttributes(EXIT_LABEL_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes BUILT_IN_VAR_ATTRIBUTES = new TextAttributes(BUILT_IN_VAR_COLOR, null, null, null, Font.PLAIN); + + // Create TextAttributesKey with custom attributes + public static final TextAttributesKey KEYWORD = createTextAttributesKey("PINE_SCRIPT_KEYWORD", KEYWORD_ATTRIBUTES); + public static final TextAttributesKey STRING = createTextAttributesKey("PINE_SCRIPT_STRING", STRING_ATTRIBUTES); + public static final TextAttributesKey NUMBER = createTextAttributesKey("PINE_SCRIPT_NUMBER", NUMBER_ATTRIBUTES); + public static final TextAttributesKey COMMENT = createTextAttributesKey("PINE_SCRIPT_COMMENT", COMMENT_ATTRIBUTES); + public static final TextAttributesKey FUNCTION = createTextAttributesKey("PINE_SCRIPT_FUNCTION", FUNCTION_ATTRIBUTES); + public static final TextAttributesKey OPERATOR = createTextAttributesKey("PINE_SCRIPT_OPERATOR", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey IDENTIFIER = createTextAttributesKey("PINE_SCRIPT_IDENTIFIER", IDENTIFIER_ATTRIBUTES); + public static final TextAttributesKey TYPE = createTextAttributesKey("PINE_SCRIPT_TYPE", TYPE_ATTRIBUTES); + public static final TextAttributesKey NAMESPACE = createTextAttributesKey("PINE_SCRIPT_NAMESPACE", NAMESPACE_ATTRIBUTES); + public static final TextAttributesKey TRUE_FALSE = createTextAttributesKey("PINE_SCRIPT_TRUE_FALSE", TRUE_FALSE_ATTRIBUTES); + public static final TextAttributesKey NA = createTextAttributesKey("PINE_SCRIPT_NA", NA_ATTRIBUTES); + public static final TextAttributesKey COLOR_CONSTANT = createTextAttributesKey("PINE_SCRIPT_COLOR_CONSTANT", COLOR_CONSTANT_ATTRIBUTES); + public static final TextAttributesKey EXIT_LABEL = createTextAttributesKey("PINE_SCRIPT_EXIT_LABEL", EXIT_LABEL_ATTRIBUTES); + public static final TextAttributesKey BUILT_IN_VARIABLE = createTextAttributesKey("PINE_SCRIPT_BUILT_IN_VARIABLE", BUILT_IN_VAR_ATTRIBUTES); + + // Use default colors for these + public static final TextAttributesKey PARENTHESES = createTextAttributesKey("PINE_SCRIPT_PARENTHESES", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BRACKETS = createTextAttributesKey("PINE_SCRIPT_BRACKETS", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BRACES = createTextAttributesKey("PINE_SCRIPT_BRACES", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey COMMA = createTextAttributesKey("PINE_SCRIPT_COMMA", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey DOT = createTextAttributesKey("PINE_SCRIPT_DOT", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey SEMICOLON = createTextAttributesKey("PINE_SCRIPT_SEMICOLON", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BAD_CHARACTER = createTextAttributesKey("PINE_SCRIPT_BAD_CHARACTER", HighlighterColors.BAD_CHARACTER); + + // Token sets for more efficient handling + private static final TokenSet KEYWORD_TOKENS = TokenSet.create(PineScriptTokenTypes.KEYWORD); + private static final TokenSet STRING_TOKENS = TokenSet.create(PineScriptTokenTypes.STRING); + private static final TokenSet NUMBER_TOKENS = TokenSet.create(PineScriptTokenTypes.NUMBER); + private static final TokenSet COMMENT_TOKENS = TokenSet.create(PineScriptTokenTypes.COMMENT); + private static final TokenSet FUNCTION_TOKENS = TokenSet.create(PineScriptTokenTypes.FUNCTION); + private static final TokenSet OPERATOR_TOKENS = TokenSet.create(PineScriptTokenTypes.OPERATOR); + private static final TokenSet IDENTIFIER_TOKENS = TokenSet.create(PineScriptTokenTypes.IDENTIFIER); + private static final TokenSet TYPE_TOKENS = TokenSet.create(PineScriptTokenTypes.TYPE); + private static final TokenSet NAMESPACE_TOKENS = TokenSet.create(PineScriptTokenTypes.NAMESPACE); + private static final TokenSet TRUE_FALSE_TOKENS = TokenSet.create(PineScriptTokenTypes.TRUE_FALSE); + private static final TokenSet NA_TOKENS = TokenSet.create(PineScriptTokenTypes.NA); + private static final TokenSet COLOR_CONSTANT_TOKENS = TokenSet.create(PineScriptTokenTypes.COLOR_CONSTANT); + private static final TokenSet EXIT_LABEL_TOKENS = TokenSet.create(PineScriptTokenTypes.EXIT_LABEL); + private static final TokenSet BUILT_IN_VAR_TOKENS = TokenSet.create(PineScriptTokenTypes.BUILT_IN_VARIABLE); + private static final TokenSet BAD_CHAR_TOKENS = TokenSet.create(TokenType.BAD_CHARACTER); + + @NotNull + @Override + public Lexer getHighlightingLexer() { + return new PineScriptLexer(); + } + + @Override + public TextAttributesKey @NotNull [] getTokenHighlights(IElementType tokenType) { + if (tokenType == null) return TextAttributesKey.EMPTY_ARRAY; + + if (KEYWORD_TOKENS.contains(tokenType)) { + return pack(KEYWORD); + } else if (IDENTIFIER_TOKENS.contains(tokenType)) { + return pack(IDENTIFIER); + } else if (COMMENT_TOKENS.contains(tokenType)) { + return pack(COMMENT); + } else if (STRING_TOKENS.contains(tokenType)) { + return pack(STRING); + } else if (NUMBER_TOKENS.contains(tokenType)) { + return pack(NUMBER); + } else if (OPERATOR_TOKENS.contains(tokenType)) { + return pack(OPERATOR); + } else if (FUNCTION_TOKENS.contains(tokenType)) { + // Only highlight as function if it's a function token + return pack(FUNCTION); + } else if (NAMESPACE_TOKENS.contains(tokenType)) { + return pack(NAMESPACE); + } else if (TYPE_TOKENS.contains(tokenType)) { + return pack(TYPE); + } else if (TRUE_FALSE_TOKENS.contains(tokenType)) { + return pack(TRUE_FALSE); + } else if (NA_TOKENS.contains(tokenType)) { + return pack(NA); + } else if (COLOR_CONSTANT_TOKENS.contains(tokenType)) { + return pack(COLOR_CONSTANT); + } else if (EXIT_LABEL_TOKENS.contains(tokenType)) { + return pack(EXIT_LABEL); + } else if (BUILT_IN_VAR_TOKENS.contains(tokenType)) { + return pack(BUILT_IN_VARIABLE); + } else if (BAD_CHAR_TOKENS.contains(tokenType)) { + return pack(BAD_CHARACTER); + } + + // Handle punctuation + if (tokenType.equals(PineScriptTokenTypes.LPAREN) || tokenType.equals(PineScriptTokenTypes.RPAREN)) { + return pack(PARENTHESES); + } else if (tokenType.equals(PineScriptTokenTypes.LBRACKET) || tokenType.equals(PineScriptTokenTypes.RBRACKET)) { + return pack(BRACKETS); + } else if (tokenType.equals(PineScriptTokenTypes.LBRACE) || tokenType.equals(PineScriptTokenTypes.RBRACE)) { + return pack(BRACES); + } else if (tokenType.equals(PineScriptTokenTypes.COMMA)) { + return pack(COMMA); + } else if (tokenType.equals(PineScriptTokenTypes.DOT)) { + return pack(DOT); + } else if (tokenType.equals(PineScriptTokenTypes.SEMICOLON)) { + return pack(SEMICOLON); + } + + // Default to identifier color for any unmatched tokens that might be variables + return pack(IDENTIFIER); + } +} \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak3 b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak3 new file mode 100644 index 0000000..59442fe --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak3 @@ -0,0 +1,160 @@ +package com.pinescript.plugin.editor; + +import com.intellij.lexer.Lexer; +import com.intellij.openapi.editor.DefaultLanguageHighlighterColors; +import com.intellij.openapi.editor.HighlighterColors; +import com.intellij.openapi.editor.colors.TextAttributesKey; +import com.intellij.openapi.editor.markup.TextAttributes; +import com.intellij.openapi.fileTypes.SyntaxHighlighterBase; +import com.intellij.psi.TokenType; +import com.intellij.psi.tree.IElementType; +import com.intellij.psi.tree.TokenSet; +import com.pinescript.plugin.language.PineScriptLexer; +import com.pinescript.plugin.psi.PineScriptTokenTypes; +import org.jetbrains.annotations.NotNull; + +import java.awt.*; + +import static com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey; + +public class PineScriptSyntaxHighlighter extends SyntaxHighlighterBase { + // TradingView-like colors based on the screenshot + private static final Color KEYWORD_COLOR = new Color(83, 169, 149); // Green for keywords // Blue for keywords (var, if) + private static final Color STRING_COLOR = new Color(80, 140, 70); // Warm green for strings // Orange-brown for strings + private static final Color NUMBER_COLOR = new Color(182, 232, 184); // Light green for numbers + private static final Color COMMENT_COLOR = new Color(118, 185, 0); // Green for comments + private static final Color FUNCTION_COLOR = new Color(255, 215, 95); // Yellow for functions + private static final Color OPERATOR_COLOR = new Color(202, 202, 202); // Light gray for operators + private static final Color IDENTIFIER_COLOR = new Color(242, 242, 242); // White/very light gray for identifiers/variables + private static final Color TYPE_COLOR = new Color(66, 165, 245); // Blue for types (float, bool) + private static final Color NAMESPACE_COLOR = new Color(96, 205, 200); // Teal for namespaces + private static final Color BUILT_IN_VAR_COLOR = new Color(255, 215, 95); // Yellow for built-in variables (open, high, low, close) + + // Special colors for specific elements + private static final Color TRUE_FALSE_COLOR = new Color(66, 165, 245); // Blue for true/false + private static final Color NA_COLOR = new Color(66, 165, 245); // Blue for na values + private static final Color PLOT_COLOR_RED = new Color(255, 105, 95); // Red for plot color + private static final Color PLOT_COLOR_BLUE = new Color(107, 165, 220); // Blue for plot color + private static final Color COLOR_CONSTANTS = new Color(198, 120, 93); // Orange-brown for color constants + private static final Color EXIT_LABEL_COLOR = new Color(255, 105, 95); // Red for exit labels + + // Create TextAttributes with TradingView-like colors + private static final TextAttributes KEYWORD_ATTRIBUTES = new TextAttributes(KEYWORD_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes STRING_ATTRIBUTES = new TextAttributes(STRING_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NUMBER_ATTRIBUTES = new TextAttributes(NUMBER_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes COMMENT_ATTRIBUTES = new TextAttributes(COMMENT_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes FUNCTION_ATTRIBUTES = new TextAttributes(FUNCTION_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes OPERATOR_ATTRIBUTES = new TextAttributes(OPERATOR_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes IDENTIFIER_ATTRIBUTES = new TextAttributes(IDENTIFIER_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes TYPE_ATTRIBUTES = new TextAttributes(TYPE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NAMESPACE_ATTRIBUTES = new TextAttributes(NAMESPACE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes TRUE_FALSE_ATTRIBUTES = new TextAttributes(TRUE_FALSE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NA_ATTRIBUTES = new TextAttributes(NA_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes COLOR_CONSTANT_ATTRIBUTES = new TextAttributes(COLOR_CONSTANTS, null, null, null, Font.PLAIN); + private static final TextAttributes EXIT_LABEL_ATTRIBUTES = new TextAttributes(EXIT_LABEL_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes BUILT_IN_VAR_ATTRIBUTES = new TextAttributes(BUILT_IN_VAR_COLOR, null, null, null, Font.PLAIN); + + // Create TextAttributesKey with custom attributes + public static final TextAttributesKey KEYWORD = createTextAttributesKey("PINE_SCRIPT_KEYWORD", KEYWORD_ATTRIBUTES); + public static final TextAttributesKey STRING = createTextAttributesKey("PINE_SCRIPT_STRING", STRING_ATTRIBUTES); + public static final TextAttributesKey NUMBER = createTextAttributesKey("PINE_SCRIPT_NUMBER", NUMBER_ATTRIBUTES); + public static final TextAttributesKey COMMENT = createTextAttributesKey("PINE_SCRIPT_COMMENT", COMMENT_ATTRIBUTES); + public static final TextAttributesKey FUNCTION = createTextAttributesKey("PINE_SCRIPT_FUNCTION", FUNCTION_ATTRIBUTES); + public static final TextAttributesKey OPERATOR = createTextAttributesKey("PINE_SCRIPT_OPERATOR", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey IDENTIFIER = createTextAttributesKey("PINE_SCRIPT_IDENTIFIER", IDENTIFIER_ATTRIBUTES); + public static final TextAttributesKey TYPE = createTextAttributesKey("PINE_SCRIPT_TYPE", TYPE_ATTRIBUTES); + public static final TextAttributesKey NAMESPACE = createTextAttributesKey("PINE_SCRIPT_NAMESPACE", NAMESPACE_ATTRIBUTES); + public static final TextAttributesKey TRUE_FALSE = createTextAttributesKey("PINE_SCRIPT_TRUE_FALSE", TRUE_FALSE_ATTRIBUTES); + public static final TextAttributesKey NA = createTextAttributesKey("PINE_SCRIPT_NA", NA_ATTRIBUTES); + public static final TextAttributesKey COLOR_CONSTANT = createTextAttributesKey("PINE_SCRIPT_COLOR_CONSTANT", COLOR_CONSTANT_ATTRIBUTES); + public static final TextAttributesKey EXIT_LABEL = createTextAttributesKey("PINE_SCRIPT_EXIT_LABEL", EXIT_LABEL_ATTRIBUTES); + public static final TextAttributesKey BUILT_IN_VARIABLE = createTextAttributesKey("PINE_SCRIPT_BUILT_IN_VARIABLE", BUILT_IN_VAR_ATTRIBUTES); + + // Use default colors for these + public static final TextAttributesKey PARENTHESES = createTextAttributesKey("PINE_SCRIPT_PARENTHESES", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BRACKETS = createTextAttributesKey("PINE_SCRIPT_BRACKETS", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BRACES = createTextAttributesKey("PINE_SCRIPT_BRACES", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey COMMA = createTextAttributesKey("PINE_SCRIPT_COMMA", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey DOT = createTextAttributesKey("PINE_SCRIPT_DOT", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey SEMICOLON = createTextAttributesKey("PINE_SCRIPT_SEMICOLON", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BAD_CHARACTER = createTextAttributesKey("PINE_SCRIPT_BAD_CHARACTER", HighlighterColors.BAD_CHARACTER); + + // Token sets for more efficient handling + private static final TokenSet KEYWORD_TOKENS = TokenSet.create(PineScriptTokenTypes.KEYWORD); + private static final TokenSet STRING_TOKENS = TokenSet.create(PineScriptTokenTypes.STRING); + private static final TokenSet NUMBER_TOKENS = TokenSet.create(PineScriptTokenTypes.NUMBER); + private static final TokenSet COMMENT_TOKENS = TokenSet.create(PineScriptTokenTypes.COMMENT); + private static final TokenSet FUNCTION_TOKENS = TokenSet.create(PineScriptTokenTypes.FUNCTION); + private static final TokenSet OPERATOR_TOKENS = TokenSet.create(PineScriptTokenTypes.OPERATOR); + private static final TokenSet IDENTIFIER_TOKENS = TokenSet.create(PineScriptTokenTypes.IDENTIFIER); + private static final TokenSet TYPE_TOKENS = TokenSet.create(PineScriptTokenTypes.TYPE); + private static final TokenSet NAMESPACE_TOKENS = TokenSet.create(PineScriptTokenTypes.NAMESPACE); + private static final TokenSet TRUE_FALSE_TOKENS = TokenSet.create(PineScriptTokenTypes.TRUE_FALSE); + private static final TokenSet NA_TOKENS = TokenSet.create(PineScriptTokenTypes.NA); + private static final TokenSet COLOR_CONSTANT_TOKENS = TokenSet.create(PineScriptTokenTypes.COLOR_CONSTANT); + private static final TokenSet EXIT_LABEL_TOKENS = TokenSet.create(PineScriptTokenTypes.EXIT_LABEL); + private static final TokenSet BUILT_IN_VAR_TOKENS = TokenSet.create(PineScriptTokenTypes.BUILT_IN_VARIABLE); + private static final TokenSet BAD_CHAR_TOKENS = TokenSet.create(TokenType.BAD_CHARACTER); + + @NotNull + @Override + public Lexer getHighlightingLexer() { + return new PineScriptLexer(); + } + + @Override + public TextAttributesKey @NotNull [] getTokenHighlights(IElementType tokenType) { + if (tokenType == null) return TextAttributesKey.EMPTY_ARRAY; + + if (KEYWORD_TOKENS.contains(tokenType)) { + return pack(KEYWORD); + } else if (IDENTIFIER_TOKENS.contains(tokenType)) { + return pack(IDENTIFIER); + } else if (COMMENT_TOKENS.contains(tokenType)) { + return pack(COMMENT); + } else if (STRING_TOKENS.contains(tokenType)) { + return pack(STRING); + } else if (NUMBER_TOKENS.contains(tokenType)) { + return pack(NUMBER); + } else if (OPERATOR_TOKENS.contains(tokenType)) { + return pack(OPERATOR); + } else if (FUNCTION_TOKENS.contains(tokenType)) { + // Only highlight as function if it's a function token + return pack(FUNCTION); + } else if (NAMESPACE_TOKENS.contains(tokenType)) { + return pack(NAMESPACE); + } else if (TYPE_TOKENS.contains(tokenType)) { + return pack(TYPE); + } else if (TRUE_FALSE_TOKENS.contains(tokenType)) { + return pack(TRUE_FALSE); + } else if (NA_TOKENS.contains(tokenType)) { + return pack(NA); + } else if (COLOR_CONSTANT_TOKENS.contains(tokenType)) { + return pack(COLOR_CONSTANT); + } else if (EXIT_LABEL_TOKENS.contains(tokenType)) { + return pack(EXIT_LABEL); + } else if (BUILT_IN_VAR_TOKENS.contains(tokenType)) { + return pack(BUILT_IN_VARIABLE); + } else if (BAD_CHAR_TOKENS.contains(tokenType)) { + return pack(BAD_CHARACTER); + } + + // Handle punctuation + if (tokenType.equals(PineScriptTokenTypes.LPAREN) || tokenType.equals(PineScriptTokenTypes.RPAREN)) { + return pack(PARENTHESES); + } else if (tokenType.equals(PineScriptTokenTypes.LBRACKET) || tokenType.equals(PineScriptTokenTypes.RBRACKET)) { + return pack(BRACKETS); + } else if (tokenType.equals(PineScriptTokenTypes.LBRACE) || tokenType.equals(PineScriptTokenTypes.RBRACE)) { + return pack(BRACES); + } else if (tokenType.equals(PineScriptTokenTypes.COMMA)) { + return pack(COMMA); + } else if (tokenType.equals(PineScriptTokenTypes.DOT)) { + return pack(DOT); + } else if (tokenType.equals(PineScriptTokenTypes.SEMICOLON)) { + return pack(SEMICOLON); + } + + // Default to identifier color for any unmatched tokens that might be variables + return pack(IDENTIFIER); + } +} \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak4 b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak4 new file mode 100644 index 0000000..8744aa3 --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak4 @@ -0,0 +1,160 @@ +package com.pinescript.plugin.editor; + +import com.intellij.lexer.Lexer; +import com.intellij.openapi.editor.DefaultLanguageHighlighterColors; +import com.intellij.openapi.editor.HighlighterColors; +import com.intellij.openapi.editor.colors.TextAttributesKey; +import com.intellij.openapi.editor.markup.TextAttributes; +import com.intellij.openapi.fileTypes.SyntaxHighlighterBase; +import com.intellij.psi.TokenType; +import com.intellij.psi.tree.IElementType; +import com.intellij.psi.tree.TokenSet; +import com.pinescript.plugin.language.PineScriptLexer; +import com.pinescript.plugin.psi.PineScriptTokenTypes; +import org.jetbrains.annotations.NotNull; + +import java.awt.*; + +import static com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey; + +public class PineScriptSyntaxHighlighter extends SyntaxHighlighterBase { + // TradingView-like colors based on the screenshot + private static final Color KEYWORD_COLOR = new Color(83, 169, 149); // Green for keywords // Blue for keywords (var, if) + private static final Color STRING_COLOR = new Color(80, 140, 70); // Warm green for strings // Orange-brown for strings + private static final Color NUMBER_COLOR = new Color(230, 133, 55); // Orange for numbers // Light green for numbers + private static final Color COMMENT_COLOR = new Color(118, 185, 0); // Green for comments + private static final Color FUNCTION_COLOR = new Color(255, 215, 95); // Yellow for functions + private static final Color OPERATOR_COLOR = new Color(202, 202, 202); // Light gray for operators + private static final Color IDENTIFIER_COLOR = new Color(242, 242, 242); // White/very light gray for identifiers/variables + private static final Color TYPE_COLOR = new Color(66, 165, 245); // Blue for types (float, bool) + private static final Color NAMESPACE_COLOR = new Color(96, 205, 200); // Teal for namespaces + private static final Color BUILT_IN_VAR_COLOR = new Color(255, 215, 95); // Yellow for built-in variables (open, high, low, close) + + // Special colors for specific elements + private static final Color TRUE_FALSE_COLOR = new Color(66, 165, 245); // Blue for true/false + private static final Color NA_COLOR = new Color(66, 165, 245); // Blue for na values + private static final Color PLOT_COLOR_RED = new Color(255, 105, 95); // Red for plot color + private static final Color PLOT_COLOR_BLUE = new Color(107, 165, 220); // Blue for plot color + private static final Color COLOR_CONSTANTS = new Color(198, 120, 93); // Orange-brown for color constants + private static final Color EXIT_LABEL_COLOR = new Color(255, 105, 95); // Red for exit labels + + // Create TextAttributes with TradingView-like colors + private static final TextAttributes KEYWORD_ATTRIBUTES = new TextAttributes(KEYWORD_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes STRING_ATTRIBUTES = new TextAttributes(STRING_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NUMBER_ATTRIBUTES = new TextAttributes(NUMBER_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes COMMENT_ATTRIBUTES = new TextAttributes(COMMENT_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes FUNCTION_ATTRIBUTES = new TextAttributes(FUNCTION_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes OPERATOR_ATTRIBUTES = new TextAttributes(OPERATOR_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes IDENTIFIER_ATTRIBUTES = new TextAttributes(IDENTIFIER_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes TYPE_ATTRIBUTES = new TextAttributes(TYPE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NAMESPACE_ATTRIBUTES = new TextAttributes(NAMESPACE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes TRUE_FALSE_ATTRIBUTES = new TextAttributes(TRUE_FALSE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NA_ATTRIBUTES = new TextAttributes(NA_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes COLOR_CONSTANT_ATTRIBUTES = new TextAttributes(COLOR_CONSTANTS, null, null, null, Font.PLAIN); + private static final TextAttributes EXIT_LABEL_ATTRIBUTES = new TextAttributes(EXIT_LABEL_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes BUILT_IN_VAR_ATTRIBUTES = new TextAttributes(BUILT_IN_VAR_COLOR, null, null, null, Font.PLAIN); + + // Create TextAttributesKey with custom attributes + public static final TextAttributesKey KEYWORD = createTextAttributesKey("PINE_SCRIPT_KEYWORD", KEYWORD_ATTRIBUTES); + public static final TextAttributesKey STRING = createTextAttributesKey("PINE_SCRIPT_STRING", STRING_ATTRIBUTES); + public static final TextAttributesKey NUMBER = createTextAttributesKey("PINE_SCRIPT_NUMBER", NUMBER_ATTRIBUTES); + public static final TextAttributesKey COMMENT = createTextAttributesKey("PINE_SCRIPT_COMMENT", COMMENT_ATTRIBUTES); + public static final TextAttributesKey FUNCTION = createTextAttributesKey("PINE_SCRIPT_FUNCTION", FUNCTION_ATTRIBUTES); + public static final TextAttributesKey OPERATOR = createTextAttributesKey("PINE_SCRIPT_OPERATOR", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey IDENTIFIER = createTextAttributesKey("PINE_SCRIPT_IDENTIFIER", IDENTIFIER_ATTRIBUTES); + public static final TextAttributesKey TYPE = createTextAttributesKey("PINE_SCRIPT_TYPE", TYPE_ATTRIBUTES); + public static final TextAttributesKey NAMESPACE = createTextAttributesKey("PINE_SCRIPT_NAMESPACE", NAMESPACE_ATTRIBUTES); + public static final TextAttributesKey TRUE_FALSE = createTextAttributesKey("PINE_SCRIPT_TRUE_FALSE", TRUE_FALSE_ATTRIBUTES); + public static final TextAttributesKey NA = createTextAttributesKey("PINE_SCRIPT_NA", NA_ATTRIBUTES); + public static final TextAttributesKey COLOR_CONSTANT = createTextAttributesKey("PINE_SCRIPT_COLOR_CONSTANT", COLOR_CONSTANT_ATTRIBUTES); + public static final TextAttributesKey EXIT_LABEL = createTextAttributesKey("PINE_SCRIPT_EXIT_LABEL", EXIT_LABEL_ATTRIBUTES); + public static final TextAttributesKey BUILT_IN_VARIABLE = createTextAttributesKey("PINE_SCRIPT_BUILT_IN_VARIABLE", BUILT_IN_VAR_ATTRIBUTES); + + // Use default colors for these + public static final TextAttributesKey PARENTHESES = createTextAttributesKey("PINE_SCRIPT_PARENTHESES", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BRACKETS = createTextAttributesKey("PINE_SCRIPT_BRACKETS", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BRACES = createTextAttributesKey("PINE_SCRIPT_BRACES", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey COMMA = createTextAttributesKey("PINE_SCRIPT_COMMA", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey DOT = createTextAttributesKey("PINE_SCRIPT_DOT", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey SEMICOLON = createTextAttributesKey("PINE_SCRIPT_SEMICOLON", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BAD_CHARACTER = createTextAttributesKey("PINE_SCRIPT_BAD_CHARACTER", HighlighterColors.BAD_CHARACTER); + + // Token sets for more efficient handling + private static final TokenSet KEYWORD_TOKENS = TokenSet.create(PineScriptTokenTypes.KEYWORD); + private static final TokenSet STRING_TOKENS = TokenSet.create(PineScriptTokenTypes.STRING); + private static final TokenSet NUMBER_TOKENS = TokenSet.create(PineScriptTokenTypes.NUMBER); + private static final TokenSet COMMENT_TOKENS = TokenSet.create(PineScriptTokenTypes.COMMENT); + private static final TokenSet FUNCTION_TOKENS = TokenSet.create(PineScriptTokenTypes.FUNCTION); + private static final TokenSet OPERATOR_TOKENS = TokenSet.create(PineScriptTokenTypes.OPERATOR); + private static final TokenSet IDENTIFIER_TOKENS = TokenSet.create(PineScriptTokenTypes.IDENTIFIER); + private static final TokenSet TYPE_TOKENS = TokenSet.create(PineScriptTokenTypes.TYPE); + private static final TokenSet NAMESPACE_TOKENS = TokenSet.create(PineScriptTokenTypes.NAMESPACE); + private static final TokenSet TRUE_FALSE_TOKENS = TokenSet.create(PineScriptTokenTypes.TRUE_FALSE); + private static final TokenSet NA_TOKENS = TokenSet.create(PineScriptTokenTypes.NA); + private static final TokenSet COLOR_CONSTANT_TOKENS = TokenSet.create(PineScriptTokenTypes.COLOR_CONSTANT); + private static final TokenSet EXIT_LABEL_TOKENS = TokenSet.create(PineScriptTokenTypes.EXIT_LABEL); + private static final TokenSet BUILT_IN_VAR_TOKENS = TokenSet.create(PineScriptTokenTypes.BUILT_IN_VARIABLE); + private static final TokenSet BAD_CHAR_TOKENS = TokenSet.create(TokenType.BAD_CHARACTER); + + @NotNull + @Override + public Lexer getHighlightingLexer() { + return new PineScriptLexer(); + } + + @Override + public TextAttributesKey @NotNull [] getTokenHighlights(IElementType tokenType) { + if (tokenType == null) return TextAttributesKey.EMPTY_ARRAY; + + if (KEYWORD_TOKENS.contains(tokenType)) { + return pack(KEYWORD); + } else if (IDENTIFIER_TOKENS.contains(tokenType)) { + return pack(IDENTIFIER); + } else if (COMMENT_TOKENS.contains(tokenType)) { + return pack(COMMENT); + } else if (STRING_TOKENS.contains(tokenType)) { + return pack(STRING); + } else if (NUMBER_TOKENS.contains(tokenType)) { + return pack(NUMBER); + } else if (OPERATOR_TOKENS.contains(tokenType)) { + return pack(OPERATOR); + } else if (FUNCTION_TOKENS.contains(tokenType)) { + // Only highlight as function if it's a function token + return pack(FUNCTION); + } else if (NAMESPACE_TOKENS.contains(tokenType)) { + return pack(NAMESPACE); + } else if (TYPE_TOKENS.contains(tokenType)) { + return pack(TYPE); + } else if (TRUE_FALSE_TOKENS.contains(tokenType)) { + return pack(TRUE_FALSE); + } else if (NA_TOKENS.contains(tokenType)) { + return pack(NA); + } else if (COLOR_CONSTANT_TOKENS.contains(tokenType)) { + return pack(COLOR_CONSTANT); + } else if (EXIT_LABEL_TOKENS.contains(tokenType)) { + return pack(EXIT_LABEL); + } else if (BUILT_IN_VAR_TOKENS.contains(tokenType)) { + return pack(BUILT_IN_VARIABLE); + } else if (BAD_CHAR_TOKENS.contains(tokenType)) { + return pack(BAD_CHARACTER); + } + + // Handle punctuation + if (tokenType.equals(PineScriptTokenTypes.LPAREN) || tokenType.equals(PineScriptTokenTypes.RPAREN)) { + return pack(PARENTHESES); + } else if (tokenType.equals(PineScriptTokenTypes.LBRACKET) || tokenType.equals(PineScriptTokenTypes.RBRACKET)) { + return pack(BRACKETS); + } else if (tokenType.equals(PineScriptTokenTypes.LBRACE) || tokenType.equals(PineScriptTokenTypes.RBRACE)) { + return pack(BRACES); + } else if (tokenType.equals(PineScriptTokenTypes.COMMA)) { + return pack(COMMA); + } else if (tokenType.equals(PineScriptTokenTypes.DOT)) { + return pack(DOT); + } else if (tokenType.equals(PineScriptTokenTypes.SEMICOLON)) { + return pack(SEMICOLON); + } + + // Default to identifier color for any unmatched tokens that might be variables + return pack(IDENTIFIER); + } +} \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak5 b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak5 new file mode 100644 index 0000000..b3b4272 --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak5 @@ -0,0 +1,160 @@ +package com.pinescript.plugin.editor; + +import com.intellij.lexer.Lexer; +import com.intellij.openapi.editor.DefaultLanguageHighlighterColors; +import com.intellij.openapi.editor.HighlighterColors; +import com.intellij.openapi.editor.colors.TextAttributesKey; +import com.intellij.openapi.editor.markup.TextAttributes; +import com.intellij.openapi.fileTypes.SyntaxHighlighterBase; +import com.intellij.psi.TokenType; +import com.intellij.psi.tree.IElementType; +import com.intellij.psi.tree.TokenSet; +import com.pinescript.plugin.language.PineScriptLexer; +import com.pinescript.plugin.psi.PineScriptTokenTypes; +import org.jetbrains.annotations.NotNull; + +import java.awt.*; + +import static com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey; + +public class PineScriptSyntaxHighlighter extends SyntaxHighlighterBase { + // TradingView-like colors based on the screenshot + private static final Color KEYWORD_COLOR = new Color(83, 169, 149); // Green for keywords // Blue for keywords (var, if) + private static final Color STRING_COLOR = new Color(80, 140, 70); // Warm green for strings // Orange-brown for strings + private static final Color NUMBER_COLOR = new Color(230, 133, 55); // Orange for numbers // Light green for numbers + private static final Color COMMENT_COLOR = new Color(156, 156, 156); // Grey for comments // Green for comments + private static final Color FUNCTION_COLOR = new Color(255, 215, 95); // Yellow for functions + private static final Color OPERATOR_COLOR = new Color(202, 202, 202); // Light gray for operators + private static final Color IDENTIFIER_COLOR = new Color(242, 242, 242); // White/very light gray for identifiers/variables + private static final Color TYPE_COLOR = new Color(66, 165, 245); // Blue for types (float, bool) + private static final Color NAMESPACE_COLOR = new Color(96, 205, 200); // Teal for namespaces + private static final Color BUILT_IN_VAR_COLOR = new Color(255, 215, 95); // Yellow for built-in variables (open, high, low, close) + + // Special colors for specific elements + private static final Color TRUE_FALSE_COLOR = new Color(66, 165, 245); // Blue for true/false + private static final Color NA_COLOR = new Color(66, 165, 245); // Blue for na values + private static final Color PLOT_COLOR_RED = new Color(255, 105, 95); // Red for plot color + private static final Color PLOT_COLOR_BLUE = new Color(107, 165, 220); // Blue for plot color + private static final Color COLOR_CONSTANTS = new Color(198, 120, 93); // Orange-brown for color constants + private static final Color EXIT_LABEL_COLOR = new Color(255, 105, 95); // Red for exit labels + + // Create TextAttributes with TradingView-like colors + private static final TextAttributes KEYWORD_ATTRIBUTES = new TextAttributes(KEYWORD_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes STRING_ATTRIBUTES = new TextAttributes(STRING_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NUMBER_ATTRIBUTES = new TextAttributes(NUMBER_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes COMMENT_ATTRIBUTES = new TextAttributes(COMMENT_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes FUNCTION_ATTRIBUTES = new TextAttributes(FUNCTION_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes OPERATOR_ATTRIBUTES = new TextAttributes(OPERATOR_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes IDENTIFIER_ATTRIBUTES = new TextAttributes(IDENTIFIER_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes TYPE_ATTRIBUTES = new TextAttributes(TYPE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NAMESPACE_ATTRIBUTES = new TextAttributes(NAMESPACE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes TRUE_FALSE_ATTRIBUTES = new TextAttributes(TRUE_FALSE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NA_ATTRIBUTES = new TextAttributes(NA_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes COLOR_CONSTANT_ATTRIBUTES = new TextAttributes(COLOR_CONSTANTS, null, null, null, Font.PLAIN); + private static final TextAttributes EXIT_LABEL_ATTRIBUTES = new TextAttributes(EXIT_LABEL_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes BUILT_IN_VAR_ATTRIBUTES = new TextAttributes(BUILT_IN_VAR_COLOR, null, null, null, Font.PLAIN); + + // Create TextAttributesKey with custom attributes + public static final TextAttributesKey KEYWORD = createTextAttributesKey("PINE_SCRIPT_KEYWORD", KEYWORD_ATTRIBUTES); + public static final TextAttributesKey STRING = createTextAttributesKey("PINE_SCRIPT_STRING", STRING_ATTRIBUTES); + public static final TextAttributesKey NUMBER = createTextAttributesKey("PINE_SCRIPT_NUMBER", NUMBER_ATTRIBUTES); + public static final TextAttributesKey COMMENT = createTextAttributesKey("PINE_SCRIPT_COMMENT", COMMENT_ATTRIBUTES); + public static final TextAttributesKey FUNCTION = createTextAttributesKey("PINE_SCRIPT_FUNCTION", FUNCTION_ATTRIBUTES); + public static final TextAttributesKey OPERATOR = createTextAttributesKey("PINE_SCRIPT_OPERATOR", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey IDENTIFIER = createTextAttributesKey("PINE_SCRIPT_IDENTIFIER", IDENTIFIER_ATTRIBUTES); + public static final TextAttributesKey TYPE = createTextAttributesKey("PINE_SCRIPT_TYPE", TYPE_ATTRIBUTES); + public static final TextAttributesKey NAMESPACE = createTextAttributesKey("PINE_SCRIPT_NAMESPACE", NAMESPACE_ATTRIBUTES); + public static final TextAttributesKey TRUE_FALSE = createTextAttributesKey("PINE_SCRIPT_TRUE_FALSE", TRUE_FALSE_ATTRIBUTES); + public static final TextAttributesKey NA = createTextAttributesKey("PINE_SCRIPT_NA", NA_ATTRIBUTES); + public static final TextAttributesKey COLOR_CONSTANT = createTextAttributesKey("PINE_SCRIPT_COLOR_CONSTANT", COLOR_CONSTANT_ATTRIBUTES); + public static final TextAttributesKey EXIT_LABEL = createTextAttributesKey("PINE_SCRIPT_EXIT_LABEL", EXIT_LABEL_ATTRIBUTES); + public static final TextAttributesKey BUILT_IN_VARIABLE = createTextAttributesKey("PINE_SCRIPT_BUILT_IN_VARIABLE", BUILT_IN_VAR_ATTRIBUTES); + + // Use default colors for these + public static final TextAttributesKey PARENTHESES = createTextAttributesKey("PINE_SCRIPT_PARENTHESES", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BRACKETS = createTextAttributesKey("PINE_SCRIPT_BRACKETS", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BRACES = createTextAttributesKey("PINE_SCRIPT_BRACES", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey COMMA = createTextAttributesKey("PINE_SCRIPT_COMMA", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey DOT = createTextAttributesKey("PINE_SCRIPT_DOT", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey SEMICOLON = createTextAttributesKey("PINE_SCRIPT_SEMICOLON", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BAD_CHARACTER = createTextAttributesKey("PINE_SCRIPT_BAD_CHARACTER", HighlighterColors.BAD_CHARACTER); + + // Token sets for more efficient handling + private static final TokenSet KEYWORD_TOKENS = TokenSet.create(PineScriptTokenTypes.KEYWORD); + private static final TokenSet STRING_TOKENS = TokenSet.create(PineScriptTokenTypes.STRING); + private static final TokenSet NUMBER_TOKENS = TokenSet.create(PineScriptTokenTypes.NUMBER); + private static final TokenSet COMMENT_TOKENS = TokenSet.create(PineScriptTokenTypes.COMMENT); + private static final TokenSet FUNCTION_TOKENS = TokenSet.create(PineScriptTokenTypes.FUNCTION); + private static final TokenSet OPERATOR_TOKENS = TokenSet.create(PineScriptTokenTypes.OPERATOR); + private static final TokenSet IDENTIFIER_TOKENS = TokenSet.create(PineScriptTokenTypes.IDENTIFIER); + private static final TokenSet TYPE_TOKENS = TokenSet.create(PineScriptTokenTypes.TYPE); + private static final TokenSet NAMESPACE_TOKENS = TokenSet.create(PineScriptTokenTypes.NAMESPACE); + private static final TokenSet TRUE_FALSE_TOKENS = TokenSet.create(PineScriptTokenTypes.TRUE_FALSE); + private static final TokenSet NA_TOKENS = TokenSet.create(PineScriptTokenTypes.NA); + private static final TokenSet COLOR_CONSTANT_TOKENS = TokenSet.create(PineScriptTokenTypes.COLOR_CONSTANT); + private static final TokenSet EXIT_LABEL_TOKENS = TokenSet.create(PineScriptTokenTypes.EXIT_LABEL); + private static final TokenSet BUILT_IN_VAR_TOKENS = TokenSet.create(PineScriptTokenTypes.BUILT_IN_VARIABLE); + private static final TokenSet BAD_CHAR_TOKENS = TokenSet.create(TokenType.BAD_CHARACTER); + + @NotNull + @Override + public Lexer getHighlightingLexer() { + return new PineScriptLexer(); + } + + @Override + public TextAttributesKey @NotNull [] getTokenHighlights(IElementType tokenType) { + if (tokenType == null) return TextAttributesKey.EMPTY_ARRAY; + + if (KEYWORD_TOKENS.contains(tokenType)) { + return pack(KEYWORD); + } else if (IDENTIFIER_TOKENS.contains(tokenType)) { + return pack(IDENTIFIER); + } else if (COMMENT_TOKENS.contains(tokenType)) { + return pack(COMMENT); + } else if (STRING_TOKENS.contains(tokenType)) { + return pack(STRING); + } else if (NUMBER_TOKENS.contains(tokenType)) { + return pack(NUMBER); + } else if (OPERATOR_TOKENS.contains(tokenType)) { + return pack(OPERATOR); + } else if (FUNCTION_TOKENS.contains(tokenType)) { + // Only highlight as function if it's a function token + return pack(FUNCTION); + } else if (NAMESPACE_TOKENS.contains(tokenType)) { + return pack(NAMESPACE); + } else if (TYPE_TOKENS.contains(tokenType)) { + return pack(TYPE); + } else if (TRUE_FALSE_TOKENS.contains(tokenType)) { + return pack(TRUE_FALSE); + } else if (NA_TOKENS.contains(tokenType)) { + return pack(NA); + } else if (COLOR_CONSTANT_TOKENS.contains(tokenType)) { + return pack(COLOR_CONSTANT); + } else if (EXIT_LABEL_TOKENS.contains(tokenType)) { + return pack(EXIT_LABEL); + } else if (BUILT_IN_VAR_TOKENS.contains(tokenType)) { + return pack(BUILT_IN_VARIABLE); + } else if (BAD_CHAR_TOKENS.contains(tokenType)) { + return pack(BAD_CHARACTER); + } + + // Handle punctuation + if (tokenType.equals(PineScriptTokenTypes.LPAREN) || tokenType.equals(PineScriptTokenTypes.RPAREN)) { + return pack(PARENTHESES); + } else if (tokenType.equals(PineScriptTokenTypes.LBRACKET) || tokenType.equals(PineScriptTokenTypes.RBRACKET)) { + return pack(BRACKETS); + } else if (tokenType.equals(PineScriptTokenTypes.LBRACE) || tokenType.equals(PineScriptTokenTypes.RBRACE)) { + return pack(BRACES); + } else if (tokenType.equals(PineScriptTokenTypes.COMMA)) { + return pack(COMMA); + } else if (tokenType.equals(PineScriptTokenTypes.DOT)) { + return pack(DOT); + } else if (tokenType.equals(PineScriptTokenTypes.SEMICOLON)) { + return pack(SEMICOLON); + } + + // Default to identifier color for any unmatched tokens that might be variables + return pack(IDENTIFIER); + } +} \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak6 b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak6 new file mode 100644 index 0000000..f995fc3 --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak6 @@ -0,0 +1,160 @@ +package com.pinescript.plugin.editor; + +import com.intellij.lexer.Lexer; +import com.intellij.openapi.editor.DefaultLanguageHighlighterColors; +import com.intellij.openapi.editor.HighlighterColors; +import com.intellij.openapi.editor.colors.TextAttributesKey; +import com.intellij.openapi.editor.markup.TextAttributes; +import com.intellij.openapi.fileTypes.SyntaxHighlighterBase; +import com.intellij.psi.TokenType; +import com.intellij.psi.tree.IElementType; +import com.intellij.psi.tree.TokenSet; +import com.pinescript.plugin.language.PineScriptLexer; +import com.pinescript.plugin.psi.PineScriptTokenTypes; +import org.jetbrains.annotations.NotNull; + +import java.awt.*; + +import static com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey; + +public class PineScriptSyntaxHighlighter extends SyntaxHighlighterBase { + // TradingView-like colors based on the screenshot + private static final Color KEYWORD_COLOR = new Color(83, 169, 149); // Green for keywords // Blue for keywords (var, if) + private static final Color STRING_COLOR = new Color(80, 140, 70); // Warm green for strings // Orange-brown for strings + private static final Color NUMBER_COLOR = new Color(230, 133, 55); // Orange for numbers // Light green for numbers + private static final Color COMMENT_COLOR = new Color(156, 156, 156); // Grey for comments // Green for comments + private static final Color FUNCTION_COLOR = new Color(56, 97, 246); // Blue for functions // Yellow for functions + private static final Color OPERATOR_COLOR = new Color(202, 202, 202); // Light gray for operators + private static final Color IDENTIFIER_COLOR = new Color(242, 242, 242); // White/very light gray for identifiers/variables + private static final Color TYPE_COLOR = new Color(66, 165, 245); // Blue for types (float, bool) + private static final Color NAMESPACE_COLOR = new Color(96, 205, 200); // Teal for namespaces + private static final Color BUILT_IN_VAR_COLOR = new Color(255, 215, 95); // Yellow for built-in variables (open, high, low, close) + + // Special colors for specific elements + private static final Color TRUE_FALSE_COLOR = new Color(66, 165, 245); // Blue for true/false + private static final Color NA_COLOR = new Color(66, 165, 245); // Blue for na values + private static final Color PLOT_COLOR_RED = new Color(255, 105, 95); // Red for plot color + private static final Color PLOT_COLOR_BLUE = new Color(107, 165, 220); // Blue for plot color + private static final Color COLOR_CONSTANTS = new Color(198, 120, 93); // Orange-brown for color constants + private static final Color EXIT_LABEL_COLOR = new Color(255, 105, 95); // Red for exit labels + + // Create TextAttributes with TradingView-like colors + private static final TextAttributes KEYWORD_ATTRIBUTES = new TextAttributes(KEYWORD_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes STRING_ATTRIBUTES = new TextAttributes(STRING_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NUMBER_ATTRIBUTES = new TextAttributes(NUMBER_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes COMMENT_ATTRIBUTES = new TextAttributes(COMMENT_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes FUNCTION_ATTRIBUTES = new TextAttributes(FUNCTION_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes OPERATOR_ATTRIBUTES = new TextAttributes(OPERATOR_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes IDENTIFIER_ATTRIBUTES = new TextAttributes(IDENTIFIER_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes TYPE_ATTRIBUTES = new TextAttributes(TYPE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NAMESPACE_ATTRIBUTES = new TextAttributes(NAMESPACE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes TRUE_FALSE_ATTRIBUTES = new TextAttributes(TRUE_FALSE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NA_ATTRIBUTES = new TextAttributes(NA_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes COLOR_CONSTANT_ATTRIBUTES = new TextAttributes(COLOR_CONSTANTS, null, null, null, Font.PLAIN); + private static final TextAttributes EXIT_LABEL_ATTRIBUTES = new TextAttributes(EXIT_LABEL_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes BUILT_IN_VAR_ATTRIBUTES = new TextAttributes(BUILT_IN_VAR_COLOR, null, null, null, Font.PLAIN); + + // Create TextAttributesKey with custom attributes + public static final TextAttributesKey KEYWORD = createTextAttributesKey("PINE_SCRIPT_KEYWORD", KEYWORD_ATTRIBUTES); + public static final TextAttributesKey STRING = createTextAttributesKey("PINE_SCRIPT_STRING", STRING_ATTRIBUTES); + public static final TextAttributesKey NUMBER = createTextAttributesKey("PINE_SCRIPT_NUMBER", NUMBER_ATTRIBUTES); + public static final TextAttributesKey COMMENT = createTextAttributesKey("PINE_SCRIPT_COMMENT", COMMENT_ATTRIBUTES); + public static final TextAttributesKey FUNCTION = createTextAttributesKey("PINE_SCRIPT_FUNCTION", FUNCTION_ATTRIBUTES); + public static final TextAttributesKey OPERATOR = createTextAttributesKey("PINE_SCRIPT_OPERATOR", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey IDENTIFIER = createTextAttributesKey("PINE_SCRIPT_IDENTIFIER", IDENTIFIER_ATTRIBUTES); + public static final TextAttributesKey TYPE = createTextAttributesKey("PINE_SCRIPT_TYPE", TYPE_ATTRIBUTES); + public static final TextAttributesKey NAMESPACE = createTextAttributesKey("PINE_SCRIPT_NAMESPACE", NAMESPACE_ATTRIBUTES); + public static final TextAttributesKey TRUE_FALSE = createTextAttributesKey("PINE_SCRIPT_TRUE_FALSE", TRUE_FALSE_ATTRIBUTES); + public static final TextAttributesKey NA = createTextAttributesKey("PINE_SCRIPT_NA", NA_ATTRIBUTES); + public static final TextAttributesKey COLOR_CONSTANT = createTextAttributesKey("PINE_SCRIPT_COLOR_CONSTANT", COLOR_CONSTANT_ATTRIBUTES); + public static final TextAttributesKey EXIT_LABEL = createTextAttributesKey("PINE_SCRIPT_EXIT_LABEL", EXIT_LABEL_ATTRIBUTES); + public static final TextAttributesKey BUILT_IN_VARIABLE = createTextAttributesKey("PINE_SCRIPT_BUILT_IN_VARIABLE", BUILT_IN_VAR_ATTRIBUTES); + + // Use default colors for these + public static final TextAttributesKey PARENTHESES = createTextAttributesKey("PINE_SCRIPT_PARENTHESES", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BRACKETS = createTextAttributesKey("PINE_SCRIPT_BRACKETS", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BRACES = createTextAttributesKey("PINE_SCRIPT_BRACES", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey COMMA = createTextAttributesKey("PINE_SCRIPT_COMMA", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey DOT = createTextAttributesKey("PINE_SCRIPT_DOT", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey SEMICOLON = createTextAttributesKey("PINE_SCRIPT_SEMICOLON", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BAD_CHARACTER = createTextAttributesKey("PINE_SCRIPT_BAD_CHARACTER", HighlighterColors.BAD_CHARACTER); + + // Token sets for more efficient handling + private static final TokenSet KEYWORD_TOKENS = TokenSet.create(PineScriptTokenTypes.KEYWORD); + private static final TokenSet STRING_TOKENS = TokenSet.create(PineScriptTokenTypes.STRING); + private static final TokenSet NUMBER_TOKENS = TokenSet.create(PineScriptTokenTypes.NUMBER); + private static final TokenSet COMMENT_TOKENS = TokenSet.create(PineScriptTokenTypes.COMMENT); + private static final TokenSet FUNCTION_TOKENS = TokenSet.create(PineScriptTokenTypes.FUNCTION); + private static final TokenSet OPERATOR_TOKENS = TokenSet.create(PineScriptTokenTypes.OPERATOR); + private static final TokenSet IDENTIFIER_TOKENS = TokenSet.create(PineScriptTokenTypes.IDENTIFIER); + private static final TokenSet TYPE_TOKENS = TokenSet.create(PineScriptTokenTypes.TYPE); + private static final TokenSet NAMESPACE_TOKENS = TokenSet.create(PineScriptTokenTypes.NAMESPACE); + private static final TokenSet TRUE_FALSE_TOKENS = TokenSet.create(PineScriptTokenTypes.TRUE_FALSE); + private static final TokenSet NA_TOKENS = TokenSet.create(PineScriptTokenTypes.NA); + private static final TokenSet COLOR_CONSTANT_TOKENS = TokenSet.create(PineScriptTokenTypes.COLOR_CONSTANT); + private static final TokenSet EXIT_LABEL_TOKENS = TokenSet.create(PineScriptTokenTypes.EXIT_LABEL); + private static final TokenSet BUILT_IN_VAR_TOKENS = TokenSet.create(PineScriptTokenTypes.BUILT_IN_VARIABLE); + private static final TokenSet BAD_CHAR_TOKENS = TokenSet.create(TokenType.BAD_CHARACTER); + + @NotNull + @Override + public Lexer getHighlightingLexer() { + return new PineScriptLexer(); + } + + @Override + public TextAttributesKey @NotNull [] getTokenHighlights(IElementType tokenType) { + if (tokenType == null) return TextAttributesKey.EMPTY_ARRAY; + + if (KEYWORD_TOKENS.contains(tokenType)) { + return pack(KEYWORD); + } else if (IDENTIFIER_TOKENS.contains(tokenType)) { + return pack(IDENTIFIER); + } else if (COMMENT_TOKENS.contains(tokenType)) { + return pack(COMMENT); + } else if (STRING_TOKENS.contains(tokenType)) { + return pack(STRING); + } else if (NUMBER_TOKENS.contains(tokenType)) { + return pack(NUMBER); + } else if (OPERATOR_TOKENS.contains(tokenType)) { + return pack(OPERATOR); + } else if (FUNCTION_TOKENS.contains(tokenType)) { + // Only highlight as function if it's a function token + return pack(FUNCTION); + } else if (NAMESPACE_TOKENS.contains(tokenType)) { + return pack(NAMESPACE); + } else if (TYPE_TOKENS.contains(tokenType)) { + return pack(TYPE); + } else if (TRUE_FALSE_TOKENS.contains(tokenType)) { + return pack(TRUE_FALSE); + } else if (NA_TOKENS.contains(tokenType)) { + return pack(NA); + } else if (COLOR_CONSTANT_TOKENS.contains(tokenType)) { + return pack(COLOR_CONSTANT); + } else if (EXIT_LABEL_TOKENS.contains(tokenType)) { + return pack(EXIT_LABEL); + } else if (BUILT_IN_VAR_TOKENS.contains(tokenType)) { + return pack(BUILT_IN_VARIABLE); + } else if (BAD_CHAR_TOKENS.contains(tokenType)) { + return pack(BAD_CHARACTER); + } + + // Handle punctuation + if (tokenType.equals(PineScriptTokenTypes.LPAREN) || tokenType.equals(PineScriptTokenTypes.RPAREN)) { + return pack(PARENTHESES); + } else if (tokenType.equals(PineScriptTokenTypes.LBRACKET) || tokenType.equals(PineScriptTokenTypes.RBRACKET)) { + return pack(BRACKETS); + } else if (tokenType.equals(PineScriptTokenTypes.LBRACE) || tokenType.equals(PineScriptTokenTypes.RBRACE)) { + return pack(BRACES); + } else if (tokenType.equals(PineScriptTokenTypes.COMMA)) { + return pack(COMMA); + } else if (tokenType.equals(PineScriptTokenTypes.DOT)) { + return pack(DOT); + } else if (tokenType.equals(PineScriptTokenTypes.SEMICOLON)) { + return pack(SEMICOLON); + } + + // Default to identifier color for any unmatched tokens that might be variables + return pack(IDENTIFIER); + } +} \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak7 b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak7 new file mode 100644 index 0000000..cbe3e0c --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak7 @@ -0,0 +1,160 @@ +package com.pinescript.plugin.editor; + +import com.intellij.lexer.Lexer; +import com.intellij.openapi.editor.DefaultLanguageHighlighterColors; +import com.intellij.openapi.editor.HighlighterColors; +import com.intellij.openapi.editor.colors.TextAttributesKey; +import com.intellij.openapi.editor.markup.TextAttributes; +import com.intellij.openapi.fileTypes.SyntaxHighlighterBase; +import com.intellij.psi.TokenType; +import com.intellij.psi.tree.IElementType; +import com.intellij.psi.tree.TokenSet; +import com.pinescript.plugin.language.PineScriptLexer; +import com.pinescript.plugin.psi.PineScriptTokenTypes; +import org.jetbrains.annotations.NotNull; + +import java.awt.*; + +import static com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey; + +public class PineScriptSyntaxHighlighter extends SyntaxHighlighterBase { + // TradingView-like colors based on the screenshot + private static final Color KEYWORD_COLOR = new Color(83, 169, 149); // Green for keywords // Blue for keywords (var, if) + private static final Color STRING_COLOR = new Color(80, 140, 70); // Warm green for strings // Orange-brown for strings + private static final Color NUMBER_COLOR = new Color(230, 133, 55); // Orange for numbers // Light green for numbers + private static final Color COMMENT_COLOR = new Color(156, 156, 156); // Grey for comments // Green for comments + private static final Color FUNCTION_COLOR = new Color(56, 97, 246); // Blue for functions // Yellow for functions + private static final Color OPERATOR_COLOR = new Color(83, 169, 149); // Green for operators // Light gray for operators + private static final Color IDENTIFIER_COLOR = new Color(242, 242, 242); // White/very light gray for identifiers/variables + private static final Color TYPE_COLOR = new Color(66, 165, 245); // Blue for types (float, bool) + private static final Color NAMESPACE_COLOR = new Color(96, 205, 200); // Teal for namespaces + private static final Color BUILT_IN_VAR_COLOR = new Color(255, 215, 95); // Yellow for built-in variables (open, high, low, close) + + // Special colors for specific elements + private static final Color TRUE_FALSE_COLOR = new Color(66, 165, 245); // Blue for true/false + private static final Color NA_COLOR = new Color(66, 165, 245); // Blue for na values + private static final Color PLOT_COLOR_RED = new Color(255, 105, 95); // Red for plot color + private static final Color PLOT_COLOR_BLUE = new Color(107, 165, 220); // Blue for plot color + private static final Color COLOR_CONSTANTS = new Color(198, 120, 93); // Orange-brown for color constants + private static final Color EXIT_LABEL_COLOR = new Color(255, 105, 95); // Red for exit labels + + // Create TextAttributes with TradingView-like colors + private static final TextAttributes KEYWORD_ATTRIBUTES = new TextAttributes(KEYWORD_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes STRING_ATTRIBUTES = new TextAttributes(STRING_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NUMBER_ATTRIBUTES = new TextAttributes(NUMBER_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes COMMENT_ATTRIBUTES = new TextAttributes(COMMENT_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes FUNCTION_ATTRIBUTES = new TextAttributes(FUNCTION_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes OPERATOR_ATTRIBUTES = new TextAttributes(OPERATOR_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes IDENTIFIER_ATTRIBUTES = new TextAttributes(IDENTIFIER_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes TYPE_ATTRIBUTES = new TextAttributes(TYPE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NAMESPACE_ATTRIBUTES = new TextAttributes(NAMESPACE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes TRUE_FALSE_ATTRIBUTES = new TextAttributes(TRUE_FALSE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NA_ATTRIBUTES = new TextAttributes(NA_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes COLOR_CONSTANT_ATTRIBUTES = new TextAttributes(COLOR_CONSTANTS, null, null, null, Font.PLAIN); + private static final TextAttributes EXIT_LABEL_ATTRIBUTES = new TextAttributes(EXIT_LABEL_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes BUILT_IN_VAR_ATTRIBUTES = new TextAttributes(BUILT_IN_VAR_COLOR, null, null, null, Font.PLAIN); + + // Create TextAttributesKey with custom attributes + public static final TextAttributesKey KEYWORD = createTextAttributesKey("PINE_SCRIPT_KEYWORD", KEYWORD_ATTRIBUTES); + public static final TextAttributesKey STRING = createTextAttributesKey("PINE_SCRIPT_STRING", STRING_ATTRIBUTES); + public static final TextAttributesKey NUMBER = createTextAttributesKey("PINE_SCRIPT_NUMBER", NUMBER_ATTRIBUTES); + public static final TextAttributesKey COMMENT = createTextAttributesKey("PINE_SCRIPT_COMMENT", COMMENT_ATTRIBUTES); + public static final TextAttributesKey FUNCTION = createTextAttributesKey("PINE_SCRIPT_FUNCTION", FUNCTION_ATTRIBUTES); + public static final TextAttributesKey OPERATOR = createTextAttributesKey("PINE_SCRIPT_OPERATOR", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey IDENTIFIER = createTextAttributesKey("PINE_SCRIPT_IDENTIFIER", IDENTIFIER_ATTRIBUTES); + public static final TextAttributesKey TYPE = createTextAttributesKey("PINE_SCRIPT_TYPE", TYPE_ATTRIBUTES); + public static final TextAttributesKey NAMESPACE = createTextAttributesKey("PINE_SCRIPT_NAMESPACE", NAMESPACE_ATTRIBUTES); + public static final TextAttributesKey TRUE_FALSE = createTextAttributesKey("PINE_SCRIPT_TRUE_FALSE", TRUE_FALSE_ATTRIBUTES); + public static final TextAttributesKey NA = createTextAttributesKey("PINE_SCRIPT_NA", NA_ATTRIBUTES); + public static final TextAttributesKey COLOR_CONSTANT = createTextAttributesKey("PINE_SCRIPT_COLOR_CONSTANT", COLOR_CONSTANT_ATTRIBUTES); + public static final TextAttributesKey EXIT_LABEL = createTextAttributesKey("PINE_SCRIPT_EXIT_LABEL", EXIT_LABEL_ATTRIBUTES); + public static final TextAttributesKey BUILT_IN_VARIABLE = createTextAttributesKey("PINE_SCRIPT_BUILT_IN_VARIABLE", BUILT_IN_VAR_ATTRIBUTES); + + // Use default colors for these + public static final TextAttributesKey PARENTHESES = createTextAttributesKey("PINE_SCRIPT_PARENTHESES", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BRACKETS = createTextAttributesKey("PINE_SCRIPT_BRACKETS", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BRACES = createTextAttributesKey("PINE_SCRIPT_BRACES", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey COMMA = createTextAttributesKey("PINE_SCRIPT_COMMA", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey DOT = createTextAttributesKey("PINE_SCRIPT_DOT", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey SEMICOLON = createTextAttributesKey("PINE_SCRIPT_SEMICOLON", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BAD_CHARACTER = createTextAttributesKey("PINE_SCRIPT_BAD_CHARACTER", HighlighterColors.BAD_CHARACTER); + + // Token sets for more efficient handling + private static final TokenSet KEYWORD_TOKENS = TokenSet.create(PineScriptTokenTypes.KEYWORD); + private static final TokenSet STRING_TOKENS = TokenSet.create(PineScriptTokenTypes.STRING); + private static final TokenSet NUMBER_TOKENS = TokenSet.create(PineScriptTokenTypes.NUMBER); + private static final TokenSet COMMENT_TOKENS = TokenSet.create(PineScriptTokenTypes.COMMENT); + private static final TokenSet FUNCTION_TOKENS = TokenSet.create(PineScriptTokenTypes.FUNCTION); + private static final TokenSet OPERATOR_TOKENS = TokenSet.create(PineScriptTokenTypes.OPERATOR); + private static final TokenSet IDENTIFIER_TOKENS = TokenSet.create(PineScriptTokenTypes.IDENTIFIER); + private static final TokenSet TYPE_TOKENS = TokenSet.create(PineScriptTokenTypes.TYPE); + private static final TokenSet NAMESPACE_TOKENS = TokenSet.create(PineScriptTokenTypes.NAMESPACE); + private static final TokenSet TRUE_FALSE_TOKENS = TokenSet.create(PineScriptTokenTypes.TRUE_FALSE); + private static final TokenSet NA_TOKENS = TokenSet.create(PineScriptTokenTypes.NA); + private static final TokenSet COLOR_CONSTANT_TOKENS = TokenSet.create(PineScriptTokenTypes.COLOR_CONSTANT); + private static final TokenSet EXIT_LABEL_TOKENS = TokenSet.create(PineScriptTokenTypes.EXIT_LABEL); + private static final TokenSet BUILT_IN_VAR_TOKENS = TokenSet.create(PineScriptTokenTypes.BUILT_IN_VARIABLE); + private static final TokenSet BAD_CHAR_TOKENS = TokenSet.create(TokenType.BAD_CHARACTER); + + @NotNull + @Override + public Lexer getHighlightingLexer() { + return new PineScriptLexer(); + } + + @Override + public TextAttributesKey @NotNull [] getTokenHighlights(IElementType tokenType) { + if (tokenType == null) return TextAttributesKey.EMPTY_ARRAY; + + if (KEYWORD_TOKENS.contains(tokenType)) { + return pack(KEYWORD); + } else if (IDENTIFIER_TOKENS.contains(tokenType)) { + return pack(IDENTIFIER); + } else if (COMMENT_TOKENS.contains(tokenType)) { + return pack(COMMENT); + } else if (STRING_TOKENS.contains(tokenType)) { + return pack(STRING); + } else if (NUMBER_TOKENS.contains(tokenType)) { + return pack(NUMBER); + } else if (OPERATOR_TOKENS.contains(tokenType)) { + return pack(OPERATOR); + } else if (FUNCTION_TOKENS.contains(tokenType)) { + // Only highlight as function if it's a function token + return pack(FUNCTION); + } else if (NAMESPACE_TOKENS.contains(tokenType)) { + return pack(NAMESPACE); + } else if (TYPE_TOKENS.contains(tokenType)) { + return pack(TYPE); + } else if (TRUE_FALSE_TOKENS.contains(tokenType)) { + return pack(TRUE_FALSE); + } else if (NA_TOKENS.contains(tokenType)) { + return pack(NA); + } else if (COLOR_CONSTANT_TOKENS.contains(tokenType)) { + return pack(COLOR_CONSTANT); + } else if (EXIT_LABEL_TOKENS.contains(tokenType)) { + return pack(EXIT_LABEL); + } else if (BUILT_IN_VAR_TOKENS.contains(tokenType)) { + return pack(BUILT_IN_VARIABLE); + } else if (BAD_CHAR_TOKENS.contains(tokenType)) { + return pack(BAD_CHARACTER); + } + + // Handle punctuation + if (tokenType.equals(PineScriptTokenTypes.LPAREN) || tokenType.equals(PineScriptTokenTypes.RPAREN)) { + return pack(PARENTHESES); + } else if (tokenType.equals(PineScriptTokenTypes.LBRACKET) || tokenType.equals(PineScriptTokenTypes.RBRACKET)) { + return pack(BRACKETS); + } else if (tokenType.equals(PineScriptTokenTypes.LBRACE) || tokenType.equals(PineScriptTokenTypes.RBRACE)) { + return pack(BRACES); + } else if (tokenType.equals(PineScriptTokenTypes.COMMA)) { + return pack(COMMA); + } else if (tokenType.equals(PineScriptTokenTypes.DOT)) { + return pack(DOT); + } else if (tokenType.equals(PineScriptTokenTypes.SEMICOLON)) { + return pack(SEMICOLON); + } + + // Default to identifier color for any unmatched tokens that might be variables + return pack(IDENTIFIER); + } +} \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak8 b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak8 new file mode 100644 index 0000000..6ddb920 --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak8 @@ -0,0 +1,160 @@ +package com.pinescript.plugin.editor; + +import com.intellij.lexer.Lexer; +import com.intellij.openapi.editor.DefaultLanguageHighlighterColors; +import com.intellij.openapi.editor.HighlighterColors; +import com.intellij.openapi.editor.colors.TextAttributesKey; +import com.intellij.openapi.editor.markup.TextAttributes; +import com.intellij.openapi.fileTypes.SyntaxHighlighterBase; +import com.intellij.psi.TokenType; +import com.intellij.psi.tree.IElementType; +import com.intellij.psi.tree.TokenSet; +import com.pinescript.plugin.language.PineScriptLexer; +import com.pinescript.plugin.psi.PineScriptTokenTypes; +import org.jetbrains.annotations.NotNull; + +import java.awt.*; + +import static com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey; + +public class PineScriptSyntaxHighlighter extends SyntaxHighlighterBase { + // TradingView-like colors based on the screenshot + private static final Color KEYWORD_COLOR = new Color(83, 169, 149); // Green for keywords // Blue for keywords (var, if) + private static final Color STRING_COLOR = new Color(80, 140, 70); // Warm green for strings // Orange-brown for strings + private static final Color NUMBER_COLOR = new Color(230, 133, 55); // Orange for numbers // Light green for numbers + private static final Color COMMENT_COLOR = new Color(156, 156, 156); // Grey for comments // Green for comments + private static final Color FUNCTION_COLOR = new Color(56, 97, 246); // Blue for functions // Yellow for functions + private static final Color OPERATOR_COLOR = new Color(83, 169, 149); // Green for operators // Light gray for operators + private static final Color IDENTIFIER_COLOR = new Color(46, 46, 46); // Black for variables // White/very light gray for identifiers/variables + private static final Color TYPE_COLOR = new Color(66, 165, 245); // Blue for types (float, bool) + private static final Color NAMESPACE_COLOR = new Color(96, 205, 200); // Teal for namespaces + private static final Color BUILT_IN_VAR_COLOR = new Color(255, 215, 95); // Yellow for built-in variables (open, high, low, close) + + // Special colors for specific elements + private static final Color TRUE_FALSE_COLOR = new Color(66, 165, 245); // Blue for true/false + private static final Color NA_COLOR = new Color(66, 165, 245); // Blue for na values + private static final Color PLOT_COLOR_RED = new Color(255, 105, 95); // Red for plot color + private static final Color PLOT_COLOR_BLUE = new Color(107, 165, 220); // Blue for plot color + private static final Color COLOR_CONSTANTS = new Color(198, 120, 93); // Orange-brown for color constants + private static final Color EXIT_LABEL_COLOR = new Color(255, 105, 95); // Red for exit labels + + // Create TextAttributes with TradingView-like colors + private static final TextAttributes KEYWORD_ATTRIBUTES = new TextAttributes(KEYWORD_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes STRING_ATTRIBUTES = new TextAttributes(STRING_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NUMBER_ATTRIBUTES = new TextAttributes(NUMBER_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes COMMENT_ATTRIBUTES = new TextAttributes(COMMENT_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes FUNCTION_ATTRIBUTES = new TextAttributes(FUNCTION_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes OPERATOR_ATTRIBUTES = new TextAttributes(OPERATOR_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes IDENTIFIER_ATTRIBUTES = new TextAttributes(IDENTIFIER_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes TYPE_ATTRIBUTES = new TextAttributes(TYPE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NAMESPACE_ATTRIBUTES = new TextAttributes(NAMESPACE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes TRUE_FALSE_ATTRIBUTES = new TextAttributes(TRUE_FALSE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NA_ATTRIBUTES = new TextAttributes(NA_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes COLOR_CONSTANT_ATTRIBUTES = new TextAttributes(COLOR_CONSTANTS, null, null, null, Font.PLAIN); + private static final TextAttributes EXIT_LABEL_ATTRIBUTES = new TextAttributes(EXIT_LABEL_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes BUILT_IN_VAR_ATTRIBUTES = new TextAttributes(BUILT_IN_VAR_COLOR, null, null, null, Font.PLAIN); + + // Create TextAttributesKey with custom attributes + public static final TextAttributesKey KEYWORD = createTextAttributesKey("PINE_SCRIPT_KEYWORD", KEYWORD_ATTRIBUTES); + public static final TextAttributesKey STRING = createTextAttributesKey("PINE_SCRIPT_STRING", STRING_ATTRIBUTES); + public static final TextAttributesKey NUMBER = createTextAttributesKey("PINE_SCRIPT_NUMBER", NUMBER_ATTRIBUTES); + public static final TextAttributesKey COMMENT = createTextAttributesKey("PINE_SCRIPT_COMMENT", COMMENT_ATTRIBUTES); + public static final TextAttributesKey FUNCTION = createTextAttributesKey("PINE_SCRIPT_FUNCTION", FUNCTION_ATTRIBUTES); + public static final TextAttributesKey OPERATOR = createTextAttributesKey("PINE_SCRIPT_OPERATOR", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey IDENTIFIER = createTextAttributesKey("PINE_SCRIPT_IDENTIFIER", IDENTIFIER_ATTRIBUTES); + public static final TextAttributesKey TYPE = createTextAttributesKey("PINE_SCRIPT_TYPE", TYPE_ATTRIBUTES); + public static final TextAttributesKey NAMESPACE = createTextAttributesKey("PINE_SCRIPT_NAMESPACE", NAMESPACE_ATTRIBUTES); + public static final TextAttributesKey TRUE_FALSE = createTextAttributesKey("PINE_SCRIPT_TRUE_FALSE", TRUE_FALSE_ATTRIBUTES); + public static final TextAttributesKey NA = createTextAttributesKey("PINE_SCRIPT_NA", NA_ATTRIBUTES); + public static final TextAttributesKey COLOR_CONSTANT = createTextAttributesKey("PINE_SCRIPT_COLOR_CONSTANT", COLOR_CONSTANT_ATTRIBUTES); + public static final TextAttributesKey EXIT_LABEL = createTextAttributesKey("PINE_SCRIPT_EXIT_LABEL", EXIT_LABEL_ATTRIBUTES); + public static final TextAttributesKey BUILT_IN_VARIABLE = createTextAttributesKey("PINE_SCRIPT_BUILT_IN_VARIABLE", BUILT_IN_VAR_ATTRIBUTES); + + // Use default colors for these + public static final TextAttributesKey PARENTHESES = createTextAttributesKey("PINE_SCRIPT_PARENTHESES", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BRACKETS = createTextAttributesKey("PINE_SCRIPT_BRACKETS", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BRACES = createTextAttributesKey("PINE_SCRIPT_BRACES", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey COMMA = createTextAttributesKey("PINE_SCRIPT_COMMA", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey DOT = createTextAttributesKey("PINE_SCRIPT_DOT", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey SEMICOLON = createTextAttributesKey("PINE_SCRIPT_SEMICOLON", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BAD_CHARACTER = createTextAttributesKey("PINE_SCRIPT_BAD_CHARACTER", HighlighterColors.BAD_CHARACTER); + + // Token sets for more efficient handling + private static final TokenSet KEYWORD_TOKENS = TokenSet.create(PineScriptTokenTypes.KEYWORD); + private static final TokenSet STRING_TOKENS = TokenSet.create(PineScriptTokenTypes.STRING); + private static final TokenSet NUMBER_TOKENS = TokenSet.create(PineScriptTokenTypes.NUMBER); + private static final TokenSet COMMENT_TOKENS = TokenSet.create(PineScriptTokenTypes.COMMENT); + private static final TokenSet FUNCTION_TOKENS = TokenSet.create(PineScriptTokenTypes.FUNCTION); + private static final TokenSet OPERATOR_TOKENS = TokenSet.create(PineScriptTokenTypes.OPERATOR); + private static final TokenSet IDENTIFIER_TOKENS = TokenSet.create(PineScriptTokenTypes.IDENTIFIER); + private static final TokenSet TYPE_TOKENS = TokenSet.create(PineScriptTokenTypes.TYPE); + private static final TokenSet NAMESPACE_TOKENS = TokenSet.create(PineScriptTokenTypes.NAMESPACE); + private static final TokenSet TRUE_FALSE_TOKENS = TokenSet.create(PineScriptTokenTypes.TRUE_FALSE); + private static final TokenSet NA_TOKENS = TokenSet.create(PineScriptTokenTypes.NA); + private static final TokenSet COLOR_CONSTANT_TOKENS = TokenSet.create(PineScriptTokenTypes.COLOR_CONSTANT); + private static final TokenSet EXIT_LABEL_TOKENS = TokenSet.create(PineScriptTokenTypes.EXIT_LABEL); + private static final TokenSet BUILT_IN_VAR_TOKENS = TokenSet.create(PineScriptTokenTypes.BUILT_IN_VARIABLE); + private static final TokenSet BAD_CHAR_TOKENS = TokenSet.create(TokenType.BAD_CHARACTER); + + @NotNull + @Override + public Lexer getHighlightingLexer() { + return new PineScriptLexer(); + } + + @Override + public TextAttributesKey @NotNull [] getTokenHighlights(IElementType tokenType) { + if (tokenType == null) return TextAttributesKey.EMPTY_ARRAY; + + if (KEYWORD_TOKENS.contains(tokenType)) { + return pack(KEYWORD); + } else if (IDENTIFIER_TOKENS.contains(tokenType)) { + return pack(IDENTIFIER); + } else if (COMMENT_TOKENS.contains(tokenType)) { + return pack(COMMENT); + } else if (STRING_TOKENS.contains(tokenType)) { + return pack(STRING); + } else if (NUMBER_TOKENS.contains(tokenType)) { + return pack(NUMBER); + } else if (OPERATOR_TOKENS.contains(tokenType)) { + return pack(OPERATOR); + } else if (FUNCTION_TOKENS.contains(tokenType)) { + // Only highlight as function if it's a function token + return pack(FUNCTION); + } else if (NAMESPACE_TOKENS.contains(tokenType)) { + return pack(NAMESPACE); + } else if (TYPE_TOKENS.contains(tokenType)) { + return pack(TYPE); + } else if (TRUE_FALSE_TOKENS.contains(tokenType)) { + return pack(TRUE_FALSE); + } else if (NA_TOKENS.contains(tokenType)) { + return pack(NA); + } else if (COLOR_CONSTANT_TOKENS.contains(tokenType)) { + return pack(COLOR_CONSTANT); + } else if (EXIT_LABEL_TOKENS.contains(tokenType)) { + return pack(EXIT_LABEL); + } else if (BUILT_IN_VAR_TOKENS.contains(tokenType)) { + return pack(BUILT_IN_VARIABLE); + } else if (BAD_CHAR_TOKENS.contains(tokenType)) { + return pack(BAD_CHARACTER); + } + + // Handle punctuation + if (tokenType.equals(PineScriptTokenTypes.LPAREN) || tokenType.equals(PineScriptTokenTypes.RPAREN)) { + return pack(PARENTHESES); + } else if (tokenType.equals(PineScriptTokenTypes.LBRACKET) || tokenType.equals(PineScriptTokenTypes.RBRACKET)) { + return pack(BRACKETS); + } else if (tokenType.equals(PineScriptTokenTypes.LBRACE) || tokenType.equals(PineScriptTokenTypes.RBRACE)) { + return pack(BRACES); + } else if (tokenType.equals(PineScriptTokenTypes.COMMA)) { + return pack(COMMA); + } else if (tokenType.equals(PineScriptTokenTypes.DOT)) { + return pack(DOT); + } else if (tokenType.equals(PineScriptTokenTypes.SEMICOLON)) { + return pack(SEMICOLON); + } + + // Default to identifier color for any unmatched tokens that might be variables + return pack(IDENTIFIER); + } +} \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak9 b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak9 new file mode 100644 index 0000000..34a498f --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/editor/PineScriptSyntaxHighlighter.java.bak9 @@ -0,0 +1,160 @@ +package com.pinescript.plugin.editor; + +import com.intellij.lexer.Lexer; +import com.intellij.openapi.editor.DefaultLanguageHighlighterColors; +import com.intellij.openapi.editor.HighlighterColors; +import com.intellij.openapi.editor.colors.TextAttributesKey; +import com.intellij.openapi.editor.markup.TextAttributes; +import com.intellij.openapi.fileTypes.SyntaxHighlighterBase; +import com.intellij.psi.TokenType; +import com.intellij.psi.tree.IElementType; +import com.intellij.psi.tree.TokenSet; +import com.pinescript.plugin.language.PineScriptLexer; +import com.pinescript.plugin.psi.PineScriptTokenTypes; +import org.jetbrains.annotations.NotNull; + +import java.awt.*; + +import static com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey; + +public class PineScriptSyntaxHighlighter extends SyntaxHighlighterBase { + // TradingView-like colors based on the screenshot + private static final Color KEYWORD_COLOR = new Color(83, 169, 149); // Green for keywords // Blue for keywords (var, if) + private static final Color STRING_COLOR = new Color(80, 140, 70); // Warm green for strings // Orange-brown for strings + private static final Color NUMBER_COLOR = new Color(230, 133, 55); // Orange for numbers // Light green for numbers + private static final Color COMMENT_COLOR = new Color(156, 156, 156); // Grey for comments // Green for comments + private static final Color FUNCTION_COLOR = new Color(56, 97, 246); // Blue for functions // Yellow for functions + private static final Color OPERATOR_COLOR = new Color(83, 169, 149); // Green for operators // Light gray for operators + private static final Color IDENTIFIER_COLOR = new Color(46, 46, 46); // Black for variables // White/very light gray for identifiers/variables + private static final Color TYPE_COLOR = new Color(188, 57, 50); // Red-Orange for types // Blue for types (float, bool) + private static final Color NAMESPACE_COLOR = new Color(96, 205, 200); // Teal for namespaces + private static final Color BUILT_IN_VAR_COLOR = new Color(255, 215, 95); // Yellow for built-in variables (open, high, low, close) + + // Special colors for specific elements + private static final Color TRUE_FALSE_COLOR = new Color(66, 165, 245); // Blue for true/false + private static final Color NA_COLOR = new Color(66, 165, 245); // Blue for na values + private static final Color PLOT_COLOR_RED = new Color(255, 105, 95); // Red for plot color + private static final Color PLOT_COLOR_BLUE = new Color(107, 165, 220); // Blue for plot color + private static final Color COLOR_CONSTANTS = new Color(198, 120, 93); // Orange-brown for color constants + private static final Color EXIT_LABEL_COLOR = new Color(255, 105, 95); // Red for exit labels + + // Create TextAttributes with TradingView-like colors + private static final TextAttributes KEYWORD_ATTRIBUTES = new TextAttributes(KEYWORD_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes STRING_ATTRIBUTES = new TextAttributes(STRING_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NUMBER_ATTRIBUTES = new TextAttributes(NUMBER_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes COMMENT_ATTRIBUTES = new TextAttributes(COMMENT_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes FUNCTION_ATTRIBUTES = new TextAttributes(FUNCTION_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes OPERATOR_ATTRIBUTES = new TextAttributes(OPERATOR_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes IDENTIFIER_ATTRIBUTES = new TextAttributes(IDENTIFIER_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes TYPE_ATTRIBUTES = new TextAttributes(TYPE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NAMESPACE_ATTRIBUTES = new TextAttributes(NAMESPACE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes TRUE_FALSE_ATTRIBUTES = new TextAttributes(TRUE_FALSE_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes NA_ATTRIBUTES = new TextAttributes(NA_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes COLOR_CONSTANT_ATTRIBUTES = new TextAttributes(COLOR_CONSTANTS, null, null, null, Font.PLAIN); + private static final TextAttributes EXIT_LABEL_ATTRIBUTES = new TextAttributes(EXIT_LABEL_COLOR, null, null, null, Font.PLAIN); + private static final TextAttributes BUILT_IN_VAR_ATTRIBUTES = new TextAttributes(BUILT_IN_VAR_COLOR, null, null, null, Font.PLAIN); + + // Create TextAttributesKey with custom attributes + public static final TextAttributesKey KEYWORD = createTextAttributesKey("PINE_SCRIPT_KEYWORD", KEYWORD_ATTRIBUTES); + public static final TextAttributesKey STRING = createTextAttributesKey("PINE_SCRIPT_STRING", STRING_ATTRIBUTES); + public static final TextAttributesKey NUMBER = createTextAttributesKey("PINE_SCRIPT_NUMBER", NUMBER_ATTRIBUTES); + public static final TextAttributesKey COMMENT = createTextAttributesKey("PINE_SCRIPT_COMMENT", COMMENT_ATTRIBUTES); + public static final TextAttributesKey FUNCTION = createTextAttributesKey("PINE_SCRIPT_FUNCTION", FUNCTION_ATTRIBUTES); + public static final TextAttributesKey OPERATOR = createTextAttributesKey("PINE_SCRIPT_OPERATOR", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey IDENTIFIER = createTextAttributesKey("PINE_SCRIPT_IDENTIFIER", IDENTIFIER_ATTRIBUTES); + public static final TextAttributesKey TYPE = createTextAttributesKey("PINE_SCRIPT_TYPE", TYPE_ATTRIBUTES); + public static final TextAttributesKey NAMESPACE = createTextAttributesKey("PINE_SCRIPT_NAMESPACE", NAMESPACE_ATTRIBUTES); + public static final TextAttributesKey TRUE_FALSE = createTextAttributesKey("PINE_SCRIPT_TRUE_FALSE", TRUE_FALSE_ATTRIBUTES); + public static final TextAttributesKey NA = createTextAttributesKey("PINE_SCRIPT_NA", NA_ATTRIBUTES); + public static final TextAttributesKey COLOR_CONSTANT = createTextAttributesKey("PINE_SCRIPT_COLOR_CONSTANT", COLOR_CONSTANT_ATTRIBUTES); + public static final TextAttributesKey EXIT_LABEL = createTextAttributesKey("PINE_SCRIPT_EXIT_LABEL", EXIT_LABEL_ATTRIBUTES); + public static final TextAttributesKey BUILT_IN_VARIABLE = createTextAttributesKey("PINE_SCRIPT_BUILT_IN_VARIABLE", BUILT_IN_VAR_ATTRIBUTES); + + // Use default colors for these + public static final TextAttributesKey PARENTHESES = createTextAttributesKey("PINE_SCRIPT_PARENTHESES", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BRACKETS = createTextAttributesKey("PINE_SCRIPT_BRACKETS", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BRACES = createTextAttributesKey("PINE_SCRIPT_BRACES", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey COMMA = createTextAttributesKey("PINE_SCRIPT_COMMA", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey DOT = createTextAttributesKey("PINE_SCRIPT_DOT", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey SEMICOLON = createTextAttributesKey("PINE_SCRIPT_SEMICOLON", OPERATOR_ATTRIBUTES); + public static final TextAttributesKey BAD_CHARACTER = createTextAttributesKey("PINE_SCRIPT_BAD_CHARACTER", HighlighterColors.BAD_CHARACTER); + + // Token sets for more efficient handling + private static final TokenSet KEYWORD_TOKENS = TokenSet.create(PineScriptTokenTypes.KEYWORD); + private static final TokenSet STRING_TOKENS = TokenSet.create(PineScriptTokenTypes.STRING); + private static final TokenSet NUMBER_TOKENS = TokenSet.create(PineScriptTokenTypes.NUMBER); + private static final TokenSet COMMENT_TOKENS = TokenSet.create(PineScriptTokenTypes.COMMENT); + private static final TokenSet FUNCTION_TOKENS = TokenSet.create(PineScriptTokenTypes.FUNCTION); + private static final TokenSet OPERATOR_TOKENS = TokenSet.create(PineScriptTokenTypes.OPERATOR); + private static final TokenSet IDENTIFIER_TOKENS = TokenSet.create(PineScriptTokenTypes.IDENTIFIER); + private static final TokenSet TYPE_TOKENS = TokenSet.create(PineScriptTokenTypes.TYPE); + private static final TokenSet NAMESPACE_TOKENS = TokenSet.create(PineScriptTokenTypes.NAMESPACE); + private static final TokenSet TRUE_FALSE_TOKENS = TokenSet.create(PineScriptTokenTypes.TRUE_FALSE); + private static final TokenSet NA_TOKENS = TokenSet.create(PineScriptTokenTypes.NA); + private static final TokenSet COLOR_CONSTANT_TOKENS = TokenSet.create(PineScriptTokenTypes.COLOR_CONSTANT); + private static final TokenSet EXIT_LABEL_TOKENS = TokenSet.create(PineScriptTokenTypes.EXIT_LABEL); + private static final TokenSet BUILT_IN_VAR_TOKENS = TokenSet.create(PineScriptTokenTypes.BUILT_IN_VARIABLE); + private static final TokenSet BAD_CHAR_TOKENS = TokenSet.create(TokenType.BAD_CHARACTER); + + @NotNull + @Override + public Lexer getHighlightingLexer() { + return new PineScriptLexer(); + } + + @Override + public TextAttributesKey @NotNull [] getTokenHighlights(IElementType tokenType) { + if (tokenType == null) return TextAttributesKey.EMPTY_ARRAY; + + if (KEYWORD_TOKENS.contains(tokenType)) { + return pack(KEYWORD); + } else if (IDENTIFIER_TOKENS.contains(tokenType)) { + return pack(IDENTIFIER); + } else if (COMMENT_TOKENS.contains(tokenType)) { + return pack(COMMENT); + } else if (STRING_TOKENS.contains(tokenType)) { + return pack(STRING); + } else if (NUMBER_TOKENS.contains(tokenType)) { + return pack(NUMBER); + } else if (OPERATOR_TOKENS.contains(tokenType)) { + return pack(OPERATOR); + } else if (FUNCTION_TOKENS.contains(tokenType)) { + // Only highlight as function if it's a function token + return pack(FUNCTION); + } else if (NAMESPACE_TOKENS.contains(tokenType)) { + return pack(NAMESPACE); + } else if (TYPE_TOKENS.contains(tokenType)) { + return pack(TYPE); + } else if (TRUE_FALSE_TOKENS.contains(tokenType)) { + return pack(TRUE_FALSE); + } else if (NA_TOKENS.contains(tokenType)) { + return pack(NA); + } else if (COLOR_CONSTANT_TOKENS.contains(tokenType)) { + return pack(COLOR_CONSTANT); + } else if (EXIT_LABEL_TOKENS.contains(tokenType)) { + return pack(EXIT_LABEL); + } else if (BUILT_IN_VAR_TOKENS.contains(tokenType)) { + return pack(BUILT_IN_VARIABLE); + } else if (BAD_CHAR_TOKENS.contains(tokenType)) { + return pack(BAD_CHARACTER); + } + + // Handle punctuation + if (tokenType.equals(PineScriptTokenTypes.LPAREN) || tokenType.equals(PineScriptTokenTypes.RPAREN)) { + return pack(PARENTHESES); + } else if (tokenType.equals(PineScriptTokenTypes.LBRACKET) || tokenType.equals(PineScriptTokenTypes.RBRACKET)) { + return pack(BRACKETS); + } else if (tokenType.equals(PineScriptTokenTypes.LBRACE) || tokenType.equals(PineScriptTokenTypes.RBRACE)) { + return pack(BRACES); + } else if (tokenType.equals(PineScriptTokenTypes.COMMA)) { + return pack(COMMA); + } else if (tokenType.equals(PineScriptTokenTypes.DOT)) { + return pack(DOT); + } else if (tokenType.equals(PineScriptTokenTypes.SEMICOLON)) { + return pack(SEMICOLON); + } + + // Default to identifier color for any unmatched tokens that might be variables + return pack(IDENTIFIER); + } +} \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/language/_PineScriptLexer.flex b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/language/_PineScriptLexer.flex new file mode 100644 index 0000000..fa00c3f --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/language/_PineScriptLexer.flex @@ -0,0 +1,86 @@ +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; + +%% + +%class _PineScriptLexer +%implements FlexLexer +%unicode +%function advance +%type IElementType +%eof{ return; +%eof} + +%{ + 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; + } +%} + +WHITE_SPACE=[\ \n\t\f] +COMMENT="//"[^\r\n]* +STRING=(\"([^\"\\]|\\.)*\"|\'([^\'\\]|\\.)*\') +NUMBER=[0-9]+(\.[0-9]*)? +COLOR=#[0-9a-fA-F]{6} +IDENTIFIER=[a-zA-Z_][a-zA-Z0-9_]* + +KEYWORD=("if"|"else"|"for"|"to"|"while"|"var"|"varip"|"import"|"export"|"switch"|"case"|"default"|"continue"|"break"|"return"|"type"|"enum"|"function"|"method"|"strategy"|"indicator"|"library"|"true"|"false"|"na"|"series"|"simple"|"const"|"input") + +OPERATOR=("=="|"!="|"<="|">="|"&&"|"||"|"->"|":="|[+\-*/%=!<>?:]) +DOT="." +COMMA="," +SEMICOLON=";" +LPAREN="(" +RPAREN=")" +LBRACKET="[" +RBRACKET="]" +LBRACE="{" +RBRACE="}" + +%% + + { + {COMMENT} { return PineScriptTokenTypes.COMMENT; } + {STRING} { return PineScriptTokenTypes.STRING; } + {NUMBER} { return PineScriptTokenTypes.NUMBER; } + {COLOR} { return PineScriptTokenTypes.BUILT_IN_VARIABLE; } + {KEYWORD} { return PineScriptTokenTypes.KEYWORD; } + + {IDENTIFIER}"(" { return PineScriptTokenTypes.FUNCTION; } + + "math"|"array"|"matrix"|"str"|"color"|"table"|"chart"|"strategy"|"syminfo"|"ta"|"request"|"ticker" { return PineScriptTokenTypes.NAMESPACE; } + "int"|"float"|"bool"|"string"|"color"|"label"|"line"|"box"|"table" { return PineScriptTokenTypes.TYPE; } + + {OPERATOR} { return PineScriptTokenTypes.OPERATOR; } + {DOT} { return PineScriptTokenTypes.DOT; } + {COMMA} { return PineScriptTokenTypes.COMMA; } + {SEMICOLON} { return PineScriptTokenTypes.SEMICOLON; } + {LPAREN} { return PineScriptTokenTypes.LPAREN; } + {RPAREN} { return PineScriptTokenTypes.RPAREN; } + {LBRACKET} { return PineScriptTokenTypes.LBRACKET; } + {RBRACKET} { return PineScriptTokenTypes.RBRACKET; } + {LBRACE} { return PineScriptTokenTypes.LBRACE; } + {RBRACE} { return PineScriptTokenTypes.RBRACE; } + + {IDENTIFIER} { return PineScriptTokenTypes.IDENTIFIER; } + {WHITE_SPACE}+ { return TokenType.WHITE_SPACE; } +} + +[^] { return TokenType.BAD_CHARACTER; } \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/language/_PineScriptLexer.java~ b/pine-script-intellij-plugin/bin/main/com/pinescript/plugin/language/_PineScriptLexer.java~ new file mode 100644 index 0000000..12c6d0f --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/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/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 @@ + + + + diff --git a/pine-script-intellij-plugin/bin/main/definitions/v3/annotations.json b/pine-script-intellij-plugin/bin/main/definitions/v3/annotations.json new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/definitions/v3/annotations.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/definitions/v3/constants.json b/pine-script-intellij-plugin/bin/main/definitions/v3/constants.json new file mode 100644 index 0000000..3c50a0d --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/definitions/v3/constants.json @@ -0,0 +1,983 @@ +[ + { + "name": "adjustment.dividends", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_adjustment.dividends", + "fragment": "const_adjustment.dividends", + "info": "

adjustment.dividends

Constant for dividends adjustment type (dividends adjustment is applied).
Type
const string
See also
", + "description": "Constant for dividends adjustment type (dividends adjustment is applied).", + "type": "const string", + "remarks": "" + }, + { + "name": "adjustment.none", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_adjustment.none", + "fragment": "const_adjustment.none", + "info": "

adjustment.none

Constant for none adjustment type (no adjustment is applied).
Type
const string
See also
", + "description": "Constant for none adjustment type (no adjustment is applied).", + "type": "const string", + "remarks": "" + }, + { + "name": "adjustment.splits", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_adjustment.splits", + "fragment": "const_adjustment.splits", + "info": "

adjustment.splits

Constant for splits adjustment type (splits adjustment is applied).
Type
const string
See also
", + "description": "Constant for splits adjustment type (splits adjustment is applied).", + "type": "const string", + "remarks": "" + }, + { + "name": "aqua", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_aqua", + "fragment": "const_aqua", + "info": "

aqua

Is a named constant for #00FFFF color.
Type
const color
See also
", + "description": "Is a named constant for #00FFFF color.", + "type": "const color", + "remarks": "" + }, + { + "name": "area", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_area", + "fragment": "const_area", + "info": "

area

A named constant for the 'Area' style, to be used as an argument for the style parameter in the plot function.
Type
const integer
See also
", + "description": "A named constant for the 'Area' style, to be used as an argument for the 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": "

areabr

A named constant for the 'Area With Breaks' style, to be used as an argument for the style parameter in the plot function. Similar to area, except the gaps in the data are not filled.
Type
const integer
See also
", + "description": "A named constant for the 'Area With Breaks' style, to be used as an argument for the 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

Merge strategy for requested data. Data is merged continuously without gaps, all the gaps are filled with the previous nearest existing value.
Type
const bool
See also
", + "description": "Merge strategy for requested data. Data is merged continuously without gaps, all the gaps are filled with the previous nearest existing value.", + "type": "const bool", + "remarks": "" + }, + { + "name": "barmerge.gaps_on", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_barmerge.gaps_on", + "fragment": "const_barmerge.gaps_on", + "info": "

barmerge.gaps_on

Merge strategy for requested data. Data is merged with possible gaps (na values).
Type
const bool
See also
", + "description": "Merge strategy for requested data. Data is merged with possible gaps (na values).", + "type": "const bool", + "remarks": "" + }, + { + "name": "barmerge.lookahead_off", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_barmerge.lookahead_off", + "fragment": "const_barmerge.lookahead_off", + "info": "

barmerge.lookahead_off

Merge strategy for the requested data position. Requested barset is merged with current barset in the order of sorting bars by their close time. This merge strategy disables effect of getting data from \"future\" on calculation on history.
Type
const bool
See also
", + "description": "Merge strategy for the requested data position. Requested barset is merged with current barset in the order of sorting bars by their close time. This merge strategy disables effect of getting data from \"future\" on calculation on history.", + "type": "const bool", + "remarks": "" + }, + { + "name": "barmerge.lookahead_on", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_barmerge.lookahead_on", + "fragment": "const_barmerge.lookahead_on", + "info": "

barmerge.lookahead_on

Merge strategy for the requested data position. Requested barset is merged with current barset in the order of sorting bars by their opening time. This merge strategy can lead to undesirable effect of getting data from \"future\" on calculation on history. This is unacceptable in backtesting strategies, but can be useful in indicators.
Type
const bool
See also
", + "description": "Merge strategy for the requested data position. Requested barset is merged with current barset in the order of sorting bars by their opening time. This merge strategy can lead to undesirable effect of getting data from \"future\" on calculation on history. This is unacceptable in backtesting strategies, but can be useful in indicators.", + "type": "const bool", + "remarks": "" + }, + { + "name": "black", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_black", + "fragment": "const_black", + "info": "

black

Is a named constant for #000000 color.
Type
const color
See also
", + "description": "Is a named constant for #000000 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "blue", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_blue", + "fragment": "const_blue", + "info": "

blue

Is a named constant for #0000FF color.
Type
const color
See also
", + "description": "Is a named constant for #0000FF color.", + "type": "const color", + "remarks": "" + }, + { + "name": "bool", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_bool", + "fragment": "const_bool", + "info": "

bool

Is a named constant for bool input type of input function.
Type
const string
See also
", + "description": "Is a named constant for bool input type of input function.", + "type": "const string", + "remarks": "" + }, + { + "name": "circles", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_circles", + "fragment": "const_circles", + "info": "

circles

A named constant for the 'Circles' style, to be used as an argument for the style parameter in the plot function.
Type
const integer
See also
", + "description": "A named constant for the 'Circles' style, to be used as an argument for the 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": "

columns

A named constant for the 'Columns' style, to be used as an argument for the style parameter in the plot function.
Type
const integer
See also
", + "description": "A named constant for the 'Columns' style, to be used as an argument for the 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": "

cross

A named constant for the 'Cross' style, to be used as an argument for the style parameter in the plot function.
Type
const integer
See also
", + "description": "A named constant for the 'Cross' style, to be used as an argument for the 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": "

currency.AUD

Australian dollar.
Type
const string
See also
", + "description": "Australian dollar.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.CAD", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_currency.CAD", + "fragment": "const_currency.CAD", + "info": "

currency.CAD

Canadian dollar.
Type
const string
See also
", + "description": "Canadian dollar.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.CHF", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_currency.CHF", + "fragment": "const_currency.CHF", + "info": "

currency.CHF

Swiss franc.
Type
const string
See also
", + "description": "Swiss franc.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.EUR", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_currency.EUR", + "fragment": "const_currency.EUR", + "info": "

currency.EUR

Euro.
Type
const string
See also
", + "description": "Euro.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.GBP", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_currency.GBP", + "fragment": "const_currency.GBP", + "info": "

currency.GBP

Pound sterling.
Type
const string
See also
", + "description": "Pound sterling.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.HKD", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_currency.HKD", + "fragment": "const_currency.HKD", + "info": "

currency.HKD

Hong Kong dollar.
Type
const string
See also
", + "description": "Hong Kong dollar.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.JPY", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_currency.JPY", + "fragment": "const_currency.JPY", + "info": "

currency.JPY

Japanese yen.
Type
const string
See also
", + "description": "Japanese yen.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.NOK", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_currency.NOK", + "fragment": "const_currency.NOK", + "info": "

currency.NOK

Norwegian krone.
Type
const string
See also
", + "description": "Norwegian krone.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.NONE", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_currency.NONE", + "fragment": "const_currency.NONE", + "info": "

currency.NONE

Unspecified currency.
Type
const string
See also
", + "description": "Unspecified currency.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.NZD", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_currency.NZD", + "fragment": "const_currency.NZD", + "info": "

currency.NZD

New Zealand dollar.
Type
const string
See also
", + "description": "New Zealand dollar.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.RUB", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_currency.RUB", + "fragment": "const_currency.RUB", + "info": "

currency.RUB

Russian ruble.
Type
const string
See also
", + "description": "Russian ruble.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.SEK", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_currency.SEK", + "fragment": "const_currency.SEK", + "info": "

currency.SEK

Swedish krona.
Type
const string
See also
", + "description": "Swedish krona.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.SGD", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_currency.SGD", + "fragment": "const_currency.SGD", + "info": "

currency.SGD

Singapore dollar.
Type
const string
See also
", + "description": "Singapore dollar.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.TRY", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_currency.TRY", + "fragment": "const_currency.TRY", + "info": "

currency.TRY

Turkish lira.
Type
const string
See also
", + "description": "Turkish lira.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.USD", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_currency.USD", + "fragment": "const_currency.USD", + "info": "

currency.USD

United States dollar.
Type
const string
See also
", + "description": "United States dollar.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.ZAR", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_currency.ZAR", + "fragment": "const_currency.ZAR", + "info": "

currency.ZAR

South African rand.
Type
const string
See also
", + "description": "South African rand.", + "type": "const string", + "remarks": "" + }, + { + "name": "dashed", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_dashed", + "fragment": "const_dashed", + "info": "

dashed

Is a named constant for dashed linestyle of hline function.
Type
const integer
See also
", + "description": "Is a named constant for dashed linestyle of hline function.", + "type": "const integer", + "remarks": "" + }, + { + "name": "dotted", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_dotted", + "fragment": "const_dotted", + "info": "

dotted

Is a named constant for dotted linestyle of hline function.
Type
const integer
See also
", + "description": "Is a named constant for dotted linestyle of hline function.", + "type": "const integer", + "remarks": "" + }, + { + "name": "float", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_float", + "fragment": "const_float", + "info": "

float

Is a named constant for float input type of input function.
Type
const string
See also
", + "description": "Is a named constant for float input type of input function.", + "type": "const string", + "remarks": "" + }, + { + "name": "friday", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_friday", + "fragment": "const_friday", + "info": "

friday

Is a named constant for return value of dayofweek function and value of dayofweek variable.
Type
const integer
See also
", + "description": "Is a named constant for return value of dayofweek function and value of dayofweek variable.", + "type": "const integer", + "remarks": "" + }, + { + "name": "fuchsia", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_fuchsia", + "fragment": "const_fuchsia", + "info": "

fuchsia

Is a named constant for #FF00FF color.
Type
const color
See also
", + "description": "Is a named constant for #FF00FF color.", + "type": "const color", + "remarks": "" + }, + { + "name": "gray", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_gray", + "fragment": "const_gray", + "info": "

gray

Is a named constant for #808080 color.
Type
const color
See also
", + "description": "Is a named constant for #808080 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "green", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_green", + "fragment": "const_green", + "info": "

green

Is a named constant for #008000 color.
Type
const color
See also
", + "description": "Is a named constant for #008000 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "histogram", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_histogram", + "fragment": "const_histogram", + "info": "

histogram

A named constant for the 'Histogram' style, to be used as an argument for the style parameter in the plot function.
Type
const integer
See also
", + "description": "A named constant for the 'Histogram' style, to be used as an argument for the 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": "

integer

Is a named constant for integer input type of input function.
Type
const string
See also
", + "description": "Is a named constant for integer input type of input function.", + "type": "const string", + "remarks": "" + }, + { + "name": "lime", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_lime", + "fragment": "const_lime", + "info": "

lime

Is a named constant for #00FF00 color.
Type
const color
See also
", + "description": "Is a named constant for #00FF00 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "line", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_line", + "fragment": "const_line", + "info": "

line

A named constant for the 'Line' style, to be used as an argument for the style parameter in the plot function.
Type
const integer
See also
", + "description": "A named constant for the 'Line' style, to be used as an argument for the 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": "

linebr

A named constant for the 'Line With Breaks' style, to be used as an argument for the style parameter in the plot function. Similar to line, except the gaps in the data are not filled.
Type
const integer
See also
", + "description": "A named constant for the 'Line With Breaks' style, to be used as an argument for the 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 value for plotshape, plotchar functions. Shape is plotted above main series bars.
Type
const string
See also
", + "description": "Location value for plotshape, plotchar functions. Shape is plotted above main series bars.", + "type": "const string", + "remarks": "" + }, + { + "name": "location.absolute", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_location.absolute", + "fragment": "const_location.absolute", + "info": "

location.absolute

Location value for plotshape, plotchar functions. Shape is plotted on chart using indicator value as a price coordinate.
Type
const string
See also
", + "description": "Location value for plotshape, plotchar functions. Shape is plotted on chart using indicator value as a price coordinate.", + "type": "const string", + "remarks": "" + }, + { + "name": "location.belowbar", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_location.belowbar", + "fragment": "const_location.belowbar", + "info": "

location.belowbar

Location value for plotshape, plotchar functions. Shape is plotted below main series bars.
Type
const string
See also
", + "description": "Location value for plotshape, plotchar functions. Shape is plotted below main series bars.", + "type": "const string", + "remarks": "" + }, + { + "name": "location.bottom", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_location.bottom", + "fragment": "const_location.bottom", + "info": "

location.bottom

Location value for plotshape, plotchar functions. Shape is plotted near the bottom chart border.
Type
const string
See also
", + "description": "Location value for plotshape, plotchar functions. Shape is plotted near the bottom chart border.", + "type": "const string", + "remarks": "" + }, + { + "name": "location.top", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_location.top", + "fragment": "const_location.top", + "info": "

location.top

Location value for plotshape, plotchar functions. Shape is plotted near the top chart border.
Type
const string
See also
", + "description": "Location value for plotshape, plotchar functions. Shape is plotted near the top chart border.", + "type": "const string", + "remarks": "" + }, + { + "name": "maroon", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_maroon", + "fragment": "const_maroon", + "info": "

maroon

Is a named constant for #800000 color.
Type
const color
See also
", + "description": "Is a named constant for #800000 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "monday", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_monday", + "fragment": "const_monday", + "info": "

monday

Is a named constant for return value of dayofweek function and value of dayofweek variable.
Type
const integer
See also
", + "description": "Is a named constant for return value of dayofweek function and value of dayofweek variable.", + "type": "const integer", + "remarks": "" + }, + { + "name": "navy", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_navy", + "fragment": "const_navy", + "info": "

navy

Is a named constant for #000080 color.
Type
const color
See also
", + "description": "Is a named constant for #000080 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "olive", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_olive", + "fragment": "const_olive", + "info": "

olive

Is a named constant for #808000 color.
Type
const color
See also
", + "description": "Is a named constant for #808000 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "orange", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_orange", + "fragment": "const_orange", + "info": "

orange

Is a named constant for #FF7F00 color.
Type
const color
See also
", + "description": "Is a named constant for #FF7F00 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "purple", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_purple", + "fragment": "const_purple", + "info": "

purple

Is a named constant for #800080 color.
Type
const color
See also
", + "description": "Is a named constant for #800080 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "red", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_red", + "fragment": "const_red", + "info": "

red

Is a named constant for #FF0000 color.
Type
const color
See also
", + "description": "Is a named constant for #FF0000 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "resolution", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_resolution", + "fragment": "const_resolution", + "info": "

resolution

Is a named constant for resolution input type of input function.
Type
const string
See also
", + "description": "Is a named constant for resolution input type of input function.", + "type": "const string", + "remarks": "" + }, + { + "name": "saturday", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_saturday", + "fragment": "const_saturday", + "info": "

saturday

Is a named constant for return value of dayofweek function and value of dayofweek variable.
Type
const integer
See also
", + "description": "Is a named constant for return value of dayofweek function and value of dayofweek variable.", + "type": "const integer", + "remarks": "" + }, + { + "name": "scale.left", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_scale.left", + "fragment": "const_scale.left", + "info": "

scale.left

Scale value for study function. Study is added to the left price scale.
Type
const integer
See also
", + "description": "Scale value for study function. Study is added to the left price scale.", + "type": "const integer", + "remarks": "" + }, + { + "name": "scale.none", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_scale.none", + "fragment": "const_scale.none", + "info": "

scale.none

Scale value for study function. Study is added in 'No Scale' mode. Can be used only with 'overlay=true'.
Type
const integer
See also
", + "description": "Scale value for study function. Study is added in 'No Scale' mode. Can be used only with 'overlay=true'.", + "type": "const integer", + "remarks": "" + }, + { + "name": "scale.right", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_scale.right", + "fragment": "const_scale.right", + "info": "

scale.right

Scale value for study function. Study is added to the right price scale.
Type
const integer
See also
", + "description": "Scale value for study function. Study is added to the right price scale.", + "type": "const integer", + "remarks": "" + }, + { + "name": "session", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_session", + "fragment": "const_session", + "info": "

session

Is a named constant for session input type of input function.
Type
const string
See also
", + "description": "Is a named constant for session input type of input function.", + "type": "const string", + "remarks": "" + }, + { + "name": "session.extended", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_session.extended", + "fragment": "const_session.extended", + "info": "

session.extended

Constant for extended session type (with extended hours data).
Type
const string
See also
", + "description": "Constant for extended session type (with extended hours data).", + "type": "const string", + "remarks": "" + }, + { + "name": "session.regular", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_session.regular", + "fragment": "const_session.regular", + "info": "

session.regular

Constant for regular session type (no extended hours data).
Type
const string
See also
", + "description": "Constant for regular session type (no extended hours data).", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.arrowdown", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_shape.arrowdown", + "fragment": "const_shape.arrowdown", + "info": "

shape.arrowdown

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.arrowup", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_shape.arrowup", + "fragment": "const_shape.arrowup", + "info": "

shape.arrowup

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.circle", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_shape.circle", + "fragment": "const_shape.circle", + "info": "

shape.circle

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.cross", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_shape.cross", + "fragment": "const_shape.cross", + "info": "

shape.cross

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.diamond", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_shape.diamond", + "fragment": "const_shape.diamond", + "info": "

shape.diamond

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.flag", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_shape.flag", + "fragment": "const_shape.flag", + "info": "

shape.flag

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.labeldown", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_shape.labeldown", + "fragment": "const_shape.labeldown", + "info": "

shape.labeldown

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.labelup", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_shape.labelup", + "fragment": "const_shape.labelup", + "info": "

shape.labelup

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.square", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_shape.square", + "fragment": "const_shape.square", + "info": "

shape.square

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.triangledown", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_shape.triangledown", + "fragment": "const_shape.triangledown", + "info": "

shape.triangledown

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.triangleup", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_shape.triangleup", + "fragment": "const_shape.triangleup", + "info": "

shape.triangleup

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.xcross", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_shape.xcross", + "fragment": "const_shape.xcross", + "info": "

shape.xcross

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "silver", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_silver", + "fragment": "const_silver", + "info": "

silver

Is a named constant for #C0C0C0 color.
Type
const color
See also
", + "description": "Is a named constant for #C0C0C0 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "size.auto", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_size.auto", + "fragment": "const_size.auto", + "info": "

size.auto

Size value for plotshape, plotchar functions. The size of the shape automatically adapts to the size of the bars.
Type
const string
See also
", + "description": "Size value for plotshape, plotchar functions. The size of the shape automatically adapts to the size of the bars.", + "type": "const string", + "remarks": "" + }, + { + "name": "size.huge", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_size.huge", + "fragment": "const_size.huge", + "info": "

size.huge

Size value for plotshape, plotchar functions. The size of the shape constantly huge.
Type
const string
See also
", + "description": "Size value for plotshape, plotchar functions. The size of the shape constantly huge.", + "type": "const string", + "remarks": "" + }, + { + "name": "size.large", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_size.large", + "fragment": "const_size.large", + "info": "

size.large

Size value for plotshape, plotchar functions. The size of the shape constantly large.
Type
const string
See also
", + "description": "Size value for plotshape, plotchar functions. The size of the shape constantly large.", + "type": "const string", + "remarks": "" + }, + { + "name": "size.normal", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_size.normal", + "fragment": "const_size.normal", + "info": "

size.normal

Size value for plotshape, plotchar functions. The size of the shape constantly normal.
Type
const string
See also
", + "description": "Size value for plotshape, plotchar functions. The size of the shape constantly normal.", + "type": "const string", + "remarks": "" + }, + { + "name": "size.small", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_size.small", + "fragment": "const_size.small", + "info": "

size.small

Size value for plotshape, plotchar functions. The size of the shape constantly small.
Type
const string
See also
", + "description": "Size value for plotshape, plotchar functions. The size of the shape constantly small.", + "type": "const string", + "remarks": "" + }, + { + "name": "size.tiny", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_size.tiny", + "fragment": "const_size.tiny", + "info": "

size.tiny

Size value for plotshape, plotchar functions. The size of the shape constantly tiny.
Type
const string
See also
", + "description": "Size value for plotshape, plotchar functions. The size of the shape constantly tiny.", + "type": "const string", + "remarks": "" + }, + { + "name": "solid", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_solid", + "fragment": "const_solid", + "info": "

solid

Is a named constant for solid linestyle of hline function.
Type
const integer
See also
", + "description": "Is a named constant for solid linestyle of hline function.", + "type": "const integer", + "remarks": "" + }, + { + "name": "source", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_source", + "fragment": "const_source", + "info": "

source

Is a named constant for source input type of input function.
Type
const string
See also
", + "description": "Is a named constant for source input type of input function.", + "type": "const string", + "remarks": "" + }, + { + "name": "stepline", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_stepline", + "fragment": "const_stepline", + "info": "

stepline

A named constant for the 'Step Line' style, to be used as an argument for the style parameter in the plot function.
Type
const integer
See also
", + "description": "A named constant for the 'Step Line' style, to be used as an argument for the 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

If the number of contracts/shares/lots/units to buy/sell is not specified for strategy.entry or strategy.order commands (or 'NaN' is specified), then strategy will calculate the quantity to buy/sell at close of current bar using the amount of money specified in the 'default_qty_value'.
Type
const string
See also
", + "description": "If the number of contracts/shares/lots/units to buy/sell is not specified for strategy.entry or strategy.order commands (or 'NaN' is specified), then strategy will calculate the quantity to buy/sell at close of current bar using the amount of money specified in the 'default_qty_value'.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.commission.cash_per_contract", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_strategy.commission.cash_per_contract", + "fragment": "const_strategy.commission.cash_per_contract", + "info": "

strategy.commission.cash_per_contract

Commission type for an order. Money displayed in the account currency per contract.
Type
const string
See also
", + "description": "Commission type for an order. Money displayed in the account currency per contract.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.commission.cash_per_order", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_strategy.commission.cash_per_order", + "fragment": "const_strategy.commission.cash_per_order", + "info": "

strategy.commission.cash_per_order

Commission type for an order. Money displayed in the account currency per order.
Type
const string
See also
", + "description": "Commission type for an order. Money displayed in the account currency per order.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.commission.percent", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_strategy.commission.percent", + "fragment": "const_strategy.commission.percent", + "info": "

strategy.commission.percent

Commission type for an order. A percentage of the cash volume of order.
Type
const string
See also
", + "description": "Commission type for an order. A percentage of the cash volume of order.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.direction.all", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_strategy.direction.all", + "fragment": "const_strategy.direction.all", + "info": "

strategy.direction.all

It allows strategy to open both long and short positions.
Type
const string
See also
", + "description": "It allows strategy to open both long and short positions.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.direction.long", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_strategy.direction.long", + "fragment": "const_strategy.direction.long", + "info": "

strategy.direction.long

It allows strategy to open only long positions.
Type
const string
See also
", + "description": "It allows strategy to open only long positions.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.direction.short", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_strategy.direction.short", + "fragment": "const_strategy.direction.short", + "info": "

strategy.direction.short

It allows strategy to open only short positions.
Type
const string
See also
", + "description": "It allows strategy to open only short positions.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.fixed", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_strategy.fixed", + "fragment": "const_strategy.fixed", + "info": "

strategy.fixed

If the number of contracts/shares/lots/units to buy/sell is not specified for strategy.entry or strategy.order commands (or 'NaN' is specified), then the 'default_qty_value' is used to define the quantity.
Type
const string
See also
", + "description": "If the number of contracts/shares/lots/units to buy/sell is not specified for strategy.entry or strategy.order commands (or 'NaN' is specified), then the 'default_qty_value' is used to define the quantity.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.long", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_strategy.long", + "fragment": "const_strategy.long", + "info": "

strategy.long

Long position entry.
Type
const bool
See also
", + "description": "Long position entry.", + "type": "const bool", + "remarks": "" + }, + { + "name": "strategy.oca.cancel", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_strategy.oca.cancel", + "fragment": "const_strategy.oca.cancel", + "info": "

strategy.oca.cancel

OCA type value for strategy's functions. The parameter determines that an order should belong to an OCO group, where as soon as an order is filled, all other orders of the same group are cancelled. Note: if more than 1 guaranteed-to-be-executed orders of the same OCA group are placed at once, all those orders are filled.
Type
const string
See also
", + "description": "OCA type value for strategy's functions. The parameter determines that an order should belong to an OCO group, where as soon as an order is filled, all other orders of the same group are cancelled. Note: if more than 1 guaranteed-to-be-executed orders of the same OCA group are placed at once, all those orders are filled.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.oca.none", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_strategy.oca.none", + "fragment": "const_strategy.oca.none", + "info": "

strategy.oca.none

OCA type value for strategy's functions. The parameter determines that an order should not belong to any particular OCO group.
Type
const string
See also
", + "description": "OCA type value for strategy's functions. The parameter determines that an order should not belong to any particular OCO group.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.oca.reduce", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_strategy.oca.reduce", + "fragment": "const_strategy.oca.reduce", + "info": "

strategy.oca.reduce

OCA type value for strategy's functions. The parameter determines that an order should belong to an OCO group, where if X number of contracts of an order is filled, number of contracts for each other order of the same OCO group is decreased by X. Note: if more than 1 guaranteed-to-be-executed orders of the same OCA group are placed at once, all those orders are filled.
Type
const string
See also
", + "description": "OCA type value for strategy's functions. The parameter determines that an order should belong to an OCO group, where if X number of contracts of an order is filled, number of contracts for each other order of the same OCO group is decreased by X. Note: if more than 1 guaranteed-to-be-executed orders of the same OCA group are placed at once, all those orders are filled.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.percent_of_equity", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_strategy.percent_of_equity", + "fragment": "const_strategy.percent_of_equity", + "info": "

strategy.percent_of_equity

If the number of contracts/shares/lots/units to buy/sell is not specified for strategy.entry or strategy.order commands (or 'NaN' is specified), then strategy will calculate the quantity to buy/sell at close of current bar using the amount of money specified by the 'default_qty_value' in % from current strategy.equity (in the range from 0 to 100).
Type
const string
See also
", + "description": "If the number of contracts/shares/lots/units to buy/sell is not specified for strategy.entry or strategy.order commands (or 'NaN' is specified), then strategy will calculate the quantity to buy/sell at close of current bar using the amount of money specified by the 'default_qty_value' in % from current strategy.equity (in the range from 0 to 100).", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.short", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_strategy.short", + "fragment": "const_strategy.short", + "info": "

strategy.short

Short position entry.
Type
const bool
See also
", + "description": "Short position entry.", + "type": "const bool", + "remarks": "" + }, + { + "name": "string", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_string", + "fragment": "const_string", + "info": "

string

Is a named constant for string input type of input function.
Type
const string
See also
", + "description": "Is a named constant for string input type of input function.", + "type": "const string", + "remarks": "" + }, + { + "name": "sunday", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_sunday", + "fragment": "const_sunday", + "info": "

sunday

Is a named constant for return value of dayofweek function and value of dayofweek variable.
Type
const integer
See also
", + "description": "Is a named constant for return value of dayofweek function and value of dayofweek variable.", + "type": "const integer", + "remarks": "" + }, + { + "name": "symbol", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_symbol", + "fragment": "const_symbol", + "info": "

symbol

Is a named constant for symbol input type of input function.
Type
const string
See also
", + "description": "Is a named constant for symbol input type of input function.", + "type": "const string", + "remarks": "" + }, + { + "name": "teal", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_teal", + "fragment": "const_teal", + "info": "

teal

Is a named constant for #008080 color.
Type
const color
See also
", + "description": "Is a named constant for #008080 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "thursday", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_thursday", + "fragment": "const_thursday", + "info": "

thursday

Is a named constant for return value of dayofweek function and value of dayofweek variable.
Type
const integer
See also
", + "description": "Is a named constant for return value of dayofweek function and value of dayofweek variable.", + "type": "const integer", + "remarks": "" + }, + { + "name": "tuesday", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_tuesday", + "fragment": "const_tuesday", + "info": "

tuesday

Is a named constant for return value of dayofweek function and value of dayofweek variable.
Type
const integer
See also
", + "description": "Is a named constant for return value of dayofweek function and value of dayofweek variable.", + "type": "const integer", + "remarks": "" + }, + { + "name": "wednesday", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_wednesday", + "fragment": "const_wednesday", + "info": "

wednesday

Is a named constant for return value of dayofweek function and value of dayofweek variable.
Type
const integer
See also
", + "description": "Is a named constant for return value of dayofweek function and value of dayofweek variable.", + "type": "const integer", + "remarks": "" + }, + { + "name": "white", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_white", + "fragment": "const_white", + "info": "

white

Is a named constant for #FFFFFF color.
Type
const color
See also
", + "description": "Is a named constant for #FFFFFF color.", + "type": "const color", + "remarks": "" + }, + { + "name": "yellow", + "url": "https://www.tradingview.com/pine-script-reference/v3/#const_yellow", + "fragment": "const_yellow", + "info": "

yellow

Is a named constant for #FFFF00 color.
Type
const color
See also
", + "description": "Is a named constant for #FFFF00 color.", + "type": "const color", + "remarks": "" + } +] \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/definitions/v3/functions.json b/pine-script-intellij-plugin/bin/main/definitions/v3/functions.json new file mode 100644 index 0000000..83d35a4 --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/definitions/v3/functions.json @@ -0,0 +1,2624 @@ +[ + { + "name": "abs()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_abs", + "fragment": "fun_abs", + "info": "

abs()

Absolute value of x is x if x >= 0, or -x otherwise.
Syntax
abs(x) \u2192 integer
abs(x) \u2192 const integer
abs(x) \u2192 float
abs(x) \u2192 const float
abs(x) \u2192 series
", + "description": "Absolute value of x is x if x >= 0, or -x otherwise.", + "arguments": [], + "syntax": "abs(x) \u2192 integer", + "returnType": "integer", + "returns": "" + }, + { + "name": "acos()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_acos", + "fragment": "fun_acos", + "info": "

acos()

The acos function returns the arccosine (in radians) of number such that cos(acos(y)) = y for y in range [-1, 1].
Syntax
acos(x) \u2192 float
acos(x) \u2192 const float
acos(x) \u2192 series
", + "description": "The acos function returns the arccosine (in radians) of number such that cos(acos(y)) = y for y in range [-1, 1].", + "arguments": [], + "syntax": "acos(x) \u2192 float", + "returnType": "float", + "returns": "" + }, + { + "name": "alertcondition()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_alertcondition", + "fragment": "fun_alertcondition", + "info": "

alertcondition()

Creates alert condition, that is available in Create Alert dialog. Please note, that alertcondition does NOT create an alert, it just gives you more options in Create Alert dialog. Also, alertcondition effect is invisible on chart.
Syntax
alertcondition(condition, title, message) \u2192 void
Arguments
condition (series) Series of boolean values that is used for alert. True values mean alert fire, false - no alert. Required argument.
title (const string) Title of the alert condition. Optional argument.
message (const string) Message to display when alert fires. Optional argument.
Example
alertcondition(close\u00a0>=\u00a0open,\u00a0title='Alert\u00a0on\u00a0Green\u00a0Bar',\u00a0message='Green\u00a0Bar!')
", + "description": "Creates alert condition, that is available in Create Alert dialog. Please note, that alertcondition does NOT create an alert, it just gives you more options in Create Alert dialog. Also, alertcondition effect is invisible on chart.", + "arguments": [ + { + "argument": "condition", + "type": "series" + }, + { + "argument": "title", + "type": "const string" + }, + { + "argument": "message", + "type": "const string" + } + ], + "syntax": "alertcondition(condition, title, message) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "alma()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_alma", + "fragment": "fun_alma", + "info": "

alma()

Arnaud Legoux Moving Average. It uses Gaussian distribution as weights for moving average.
Syntax
alma(series, length, offset, sigma) \u2192 series
Arguments
series (series) Series of values to process.
length (integer) Number of bars (length).
offset (float) Controls tradeoff between smoothness (closer to 1) and responsiveness (closer to 0).
sigma (float) Changes the smoothness of ALMA. The larger sigma the smoother ALMA.
Example
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))
See also
", + "description": "Arnaud Legoux Moving Average. It uses Gaussian distribution as weights for moving average.", + "arguments": [ + { + "argument": "series", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + }, + { + "argument": "offset", + "type": "float" + }, + { + "argument": "sigma", + "type": "float" + } + ], + "syntax": "alma(series, length, offset, sigma) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "asin()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_asin", + "fragment": "fun_asin", + "info": "

asin()

The asin function returns the arcsine (in radians) of number such that sin(asin(y)) = y for y in range [-1, 1].
Syntax
asin(x) \u2192 float
asin(x) \u2192 const float
asin(x) \u2192 series
", + "description": "The asin function returns the arcsine (in radians) of number such that sin(asin(y)) = y for y in range [-1, 1].", + "arguments": [], + "syntax": "asin(x) \u2192 float", + "returnType": "float", + "returns": "" + }, + { + "name": "atan()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_atan", + "fragment": "fun_atan", + "info": "

atan()

The atan function returns the arctangent (in radians) of number such that tan(atan(y)) = y for any y.
Syntax
atan(x) \u2192 float
atan(x) \u2192 const float
atan(x) \u2192 series
", + "description": "The atan function returns the arctangent (in radians) of number such that tan(atan(y)) = y for any y.", + "arguments": [], + "syntax": "atan(x) \u2192 float", + "returnType": "float", + "returns": "" + }, + { + "name": "atr()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_atr", + "fragment": "fun_atr", + "info": "

atr()

Function atr (average true range) returns the RMA of true range. True range is max(high - low, abs(high - close[1]), abs(low - close[1])).
Syntax
atr(length) \u2192 series
Arguments
length (integer) Length (number of bars back).
Example
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))
See also
", + "description": "Function atr (average true range) returns the RMA of true range. True range is max(high - low, abs(high - close[1]), abs(low - close[1])).", + "arguments": [ + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "atr(length) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "avg()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_avg", + "fragment": "fun_avg", + "info": "

avg()

Calculates average of all given series (elementwise).
Syntax
avg(x, y) \u2192 series
avg(x, y, z) \u2192 series
avg(x, y, z, a) \u2192 series
avg(x, y, z, a, b) \u2192 series
avg(x, y, z, a, b, c) \u2192 series
See also
", + "description": "Calculates average of all given series (elementwise).", + "arguments": [], + "syntax": "avg(x, y) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "barcolor()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_barcolor", + "fragment": "fun_barcolor", + "info": "

barcolor()

Set color of bars.
Syntax
barcolor(color, offset, editable, show_last, title) \u2192 void
Arguments
color (color) Color of bars. You can use constants like 'red' or '#ff001a' as well as complex expressions like 'close >= open ? green : red'. Required argument.
offset (integer) Shifts the color series to the left or to the right on the given number of bars. Default is 0.
editable (const bool) If true then barcolor style will be editable in Format dialog. Default is true.
show_last (const integer) If set, defines the number of bars (from the last bar back to the past) to fill on chart.
title (const string) Title of the barcolor. Optional argument.
Example
barcolor(close\u00a0<\u00a0open\u00a0?\u00a0black\u00a0:\u00a0white)
See also
", + "description": "Set color of bars.", + "arguments": [ + { + "argument": "color", + "type": "color" + }, + { + "argument": "offset", + "type": "integer" + }, + { + "argument": "editable", + "type": "const bool" + }, + { + "argument": "show_last", + "type": "const integer" + }, + { + "argument": "title", + "type": "const string" + } + ], + "syntax": "barcolor(color, offset, editable, show_last, title) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "barssince()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_barssince", + "fragment": "fun_barssince", + "info": "

barssince()

\u0421ounts a number of bars since the last time the condition was true.
Syntax
barssince(condition) \u2192 series[integer]
Example
//\u00a0get\u00a0number\u00a0of\u00a0bars\u00a0since\u00a0last\u00a0green\u00a0bar
barssince(close\u00a0>=\u00a0open)
Remarks
If the condition has never been met prior to the current bar, the function returns na.
Please note that using this variable/function can cause indicator repainting.
See also
", + "description": "\u0421ounts a number of bars since the last time the condition was true.", + "arguments": [], + "syntax": "barssince(condition) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "bgcolor()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_bgcolor", + "fragment": "fun_bgcolor", + "info": "

bgcolor()

Fill background of bars with specified color.
Syntax
bgcolor(color, transp, offset, editable, show_last, title) \u2192 void
Arguments
color (color) Color of the filled background. You can use constants like 'red' or '#ff001a' as well as complex expressions like 'close >= open ? green : red'. Required argument.
transp (integer) Transparency of the filled background. Possible values are from 0 (not transparent) to 100 (invisible). Optional argument.
offset (integer) Shifts the color series to the left or to the right on the given number of bars. Default is 0.
editable (const bool) If true then bgcolor style will be editable in Format dialog. Default is true.
show_last (const integer) If set, defines the number of bars (from the last bar back to the past) to fill on chart.
title (const string) Title of the bgcolor. Optional argument.
Example
bgcolor(close\u00a0<\u00a0open\u00a0?\u00a0red\u00a0:\u00a0green,\u00a0transp=70)
See also
", + "description": "Fill background of bars with specified color.", + "arguments": [ + { + "argument": "color", + "type": "color" + }, + { + "argument": "transp", + "type": "integer" + }, + { + "argument": "offset", + "type": "integer" + }, + { + "argument": "editable", + "type": "const bool" + }, + { + "argument": "show_last", + "type": "const integer" + }, + { + "argument": "title", + "type": "const string" + } + ], + "syntax": "bgcolor(color, transp, offset, editable, show_last, title) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "cci()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_cci", + "fragment": "fun_cci", + "info": "

cci()

The CCI (commodity channel index) is calculated as the difference between the typical price of a commodity and its simple moving average, divided by the mean absolute deviation of the typical price. The index is scaled by an inverse factor of 0.015 to provide more readable numbers.
Syntax
cci(source, length) \u2192 series
Arguments
source (series) Series of values to process.
length (integer) Number of bars (length).
", + "description": "The CCI (commodity channel index) is calculated as the difference between the typical price of a commodity and its simple moving average, divided by the mean absolute deviation of the typical price. The index is scaled by an inverse factor of 0.015 to provide more readable numbers.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "cci(source, length) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "ceil()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_ceil", + "fragment": "fun_ceil", + "info": "

ceil()

The ceil function returns the smallest (closest to negative infinity) integer that is greater than or equal to the argument.
Syntax
ceil(x) \u2192 integer
ceil(x) \u2192 const integer
ceil(x) \u2192 series[integer]
See also
", + "description": "The ceil function returns the smallest (closest to negative infinity) integer that is greater than or equal to the argument.", + "arguments": [], + "syntax": "ceil(x) \u2192 integer", + "returnType": "integer", + "returns": "" + }, + { + "name": "change()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_change", + "fragment": "fun_change", + "info": "

change()

Difference between current value and previous, x - x[y].
Syntax
change(source, length) \u2192 series
change(source) \u2192 series
Arguments
source (series)
length (integer) Offset from the current bar to the previous bar. Optional, if not given, length = 1 is used.
See also
", + "description": "Difference between current value and previous, x - x[y].", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "change(source, length) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "cog()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_cog", + "fragment": "fun_cog", + "info": "

cog()

The cog (center of gravity) is an indicator based on statistics and the Fibonacci golden ratio.
Syntax
cog(source, length) \u2192 series
Arguments
source (series) Series of values to process.
length (integer) Number of bars (length).
Example
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))
See also
", + "description": "The cog (center of gravity) is an indicator based on statistics and the Fibonacci golden ratio.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "cog(source, length) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "color()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_color", + "fragment": "fun_color", + "info": "

color()

Function color applies the specified transparency to the given color.
Syntax
color(color, transp) \u2192 color
Arguments
color (color)
transp (const integer) Possible values are from 0 (not transparent) to 100 (invisible).
Example
color(red,\u00a050)
Remarks
Color with transparency overrides \"transp\" argument of plot function.
", + "description": "Function color applies the specified transparency to the given color.", + "arguments": [ + { + "argument": "color", + "type": "color" + }, + { + "argument": "transp", + "type": "const integer" + } + ], + "syntax": "color(color, transp) \u2192 color", + "returnType": "color", + "returns": "" + }, + { + "name": "correlation()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_correlation", + "fragment": "fun_correlation", + "info": "

correlation()

Correlation coefficient. Describes the degree to which two series tend to deviate from their sma values.
Syntax
correlation(source_a, source_b, length) \u2192 series
Arguments
source_a (series) Source series.
source_b (series) Target series.
length (integer) Length (number of bars back).
See also
", + "description": "Correlation coefficient. Describes the degree to which two series tend to deviate from their sma values.", + "arguments": [ + { + "argument": "source_a", + "type": "series" + }, + { + "argument": "source_b", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "correlation(source_a, source_b, length) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "cos()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_cos", + "fragment": "fun_cos", + "info": "

cos()

The cos function returns the trigonometric cosine of an angle.
Syntax
cos(x) \u2192 float
cos(x) \u2192 const float
cos(x) \u2192 series
Arguments
x (series) Angle, in radians.
", + "description": "The cos function returns the trigonometric cosine of an angle.", + "arguments": [ + { + "argument": "x", + "type": "series" + } + ], + "syntax": "cos(x) \u2192 float", + "returnType": "float", + "returns": "" + }, + { + "name": "cross()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_cross", + "fragment": "fun_cross", + "info": "

cross()

Syntax
cross(x, y) \u2192 series[bool]
Arguments
x (series)
y (series)
See also
", + "description": "", + "arguments": [ + { + "argument": "x", + "type": "series" + }, + { + "argument": "y", + "type": "series" + } + ], + "syntax": "cross(x, y) \u2192 series[bool]", + "returnType": "series[bool]", + "returns": "" + }, + { + "name": "crossover()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_crossover", + "fragment": "fun_crossover", + "info": "

crossover()

The 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.
Syntax
crossover(x, y) \u2192 series[bool]
Arguments
x (float) Data series x.
y (float) Data series y.
", + "description": "The 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()

The 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.
Syntax
crossunder(x, y) \u2192 series[bool]
Arguments
x (float) Data series x.
y (float) Data series y.
", + "description": "The 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()

Cumulative (total) sum of x. In other words it's a sum of all elements of x.
Syntax
cum(x) \u2192 series
Arguments
x (series)
See also
", + "description": "Cumulative (total) sum of x. In other words it's a sum of all elements of x.", + "arguments": [ + { + "argument": "x", + "type": "series" + } + ], + "syntax": "cum(x) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "dayofmonth()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_dayofmonth", + "fragment": "fun_dayofmonth", + "info": "

dayofmonth()

Syntax
dayofmonth(time) \u2192 series
Arguments
time (series) UNIX time in milliseconds.
Remarks
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.
See also
", + "description": "", + "arguments": [ + { + "argument": "time", + "type": "series" + } + ], + "syntax": "dayofmonth(time) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "dayofweek()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_dayofweek", + "fragment": "fun_dayofweek", + "info": "

dayofweek()

Syntax
dayofweek(time) \u2192 series
Arguments
time (series) UNIX time in milliseconds.
Remarks
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.
See also
", + "description": "", + "arguments": [ + { + "argument": "time", + "type": "series" + } + ], + "syntax": "dayofweek(time) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "dev()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_dev", + "fragment": "fun_dev", + "info": "

dev()

Measure of difference between the series and it's sma
Syntax
dev(source, length) \u2192 series
Arguments
source (series) Series of values to process.
length (integer) Number of bars (length).
Example
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))
See also
", + "description": "Measure of difference between the series and it's sma", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "dev(source, length) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "ema()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_ema", + "fragment": "fun_ema", + "info": "

ema()

The sma function returns the exponentially weighted moving average. In ema weighting factors decrease exponentially. It calculates by sing a formula: EMA = alpha * x + (1 - alpha) * EMA[1], where alpha = 2 / (y + 1)
Syntax
ema(source, length) \u2192 series
Arguments
source (series) Series of values to process.
length (integer) Number of bars (length).
Example
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))
Remarks
Please note that using this variable/function can cause indicator repainting.
See also
", + "description": "The sma function returns the exponentially weighted moving average. In ema weighting factors decrease exponentially. It calculates by sing a formula: EMA = alpha * x + (1 - alpha) * EMA[1], where alpha = 2 / (y + 1)", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "ema(source, length) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "exp()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_exp", + "fragment": "fun_exp", + "info": "

exp()

The exp function of x is e^x, where x is the argument and e is Euler's number.
Syntax
exp(x) \u2192 float
exp(x) \u2192 const float
exp(x) \u2192 series
See also
", + "description": "The exp function of x is e^x, where x is the argument and e is Euler's number.", + "arguments": [], + "syntax": "exp(x) \u2192 float", + "returnType": "float", + "returns": "" + }, + { + "name": "falling()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_falling", + "fragment": "fun_falling", + "info": "

falling()

Test if the x series is now falling for y bars long.
Syntax
falling(source, length) \u2192 series[bool]
Arguments
source (series) Series of values to process.
length (integer) Number of bars (length).
See also
", + "description": "Test if the x series is now falling for y bars long.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "falling(source, length) \u2192 series[bool]", + "returnType": "series[bool]", + "returns": "" + }, + { + "name": "fill()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_fill", + "fragment": "fun_fill", + "info": "

fill()

Fills background between two plots or hlines with a given color.
Syntax
fill(hline1, hline2, color, transp, title, editable) \u2192 void
fill(plot1, plot2, color, transp, title, editable, show_last) \u2192 void
Arguments
hline1 (hline) The first hline object. Required argument.
hline2 (hline) The second hline object. Required argument.
plot1 (plot) The first plot object. Required argument.
plot2 (plot) The second plot object. Required argument.
color (color) Color of the plot. You can use constants like 'color=red' or 'color=#ff001a' as well as complex expressions like 'color = close >= open ? green : red'. Optional argument.
transp (integer) Transparency of the filled background. Possible values are from 0 (not transparent) to 100 (invisible). Optional argument.
title (const string) Title of the created fill object. Optional argument.
editable (const bool) If true then fill style will be editable in Format dialog. Default is true.
show_last (const integer) If set, defines the number of bars (from the last bar back to the past) to fill on chart.
Example
h1\u00a0=\u00a0hline(20)
h2\u00a0=\u00a0hline(10)
fill(h1,\u00a0h2)

p1\u00a0=\u00a0plot(open)
p2\u00a0=\u00a0plot(close)
fill(p1,\u00a0p2,\u00a0color=green)
See also
", + "description": "Fills background between two plots or hlines with a given color.", + "arguments": [ + { + "argument": "hline1", + "type": "hline" + }, + { + "argument": "hline2", + "type": "hline" + }, + { + "argument": "plot1", + "type": "plot" + }, + { + "argument": "plot2", + "type": "plot" + }, + { + "argument": "color", + "type": "color" + }, + { + "argument": "transp", + "type": "integer" + }, + { + "argument": "title", + "type": "const string" + }, + { + "argument": "editable", + "type": "const bool" + }, + { + "argument": "show_last", + "type": "const integer" + } + ], + "syntax": "fill(hline1, hline2, color, transp, title, editable) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "fixnan()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_fixnan", + "fragment": "fun_fixnan", + "info": "

fixnan()

For a given series replaces NaN values with previous nearest non-NaN value.
Syntax
fixnan(x) \u2192 series
fixnan(x) \u2192 series[integer]
fixnan(x) \u2192 series[bool]
fixnan(x) \u2192 series[color]
Arguments
x (series)
See also
", + "description": "For a given series replaces NaN values with previous nearest non-NaN value.", + "arguments": [ + { + "argument": "x", + "type": "series" + } + ], + "syntax": "fixnan(x) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "floor()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_floor", + "fragment": "fun_floor", + "info": "

floor()

Syntax
floor(x) \u2192 integer
floor(x) \u2192 const integer
floor(x) \u2192 series[integer]
See also
", + "description": "", + "arguments": [], + "syntax": "floor(x) \u2192 integer", + "returnType": "integer", + "returns": "" + }, + { + "name": "heikinashi()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_heikinashi", + "fragment": "fun_heikinashi", + "info": "

heikinashi()

Creates a ticker identifier for requesting Heikin Ashi bar values.
Syntax
heikinashi(symbol) \u2192 string
Arguments
symbol (string) Symbol ticker identifier.
Example
heikinashi_close\u00a0=\u00a0security(heikinashi(tickerid),\u00a0period,\u00a0close)

heikinashi_aapl_60_close\u00a0=\u00a0security(heikinashi(\"AAPL\"),\u00a0\"60\",\u00a0close)
See also
", + "description": "Creates a ticker identifier for requesting Heikin Ashi bar values.", + "arguments": [ + { + "argument": "symbol", + "type": "string" + } + ], + "syntax": "heikinashi(symbol) \u2192 string", + "returnType": "string", + "returns": "" + }, + { + "name": "highest()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_highest", + "fragment": "fun_highest", + "info": "

highest()

Highest value for a given number of bars back.
Syntax
highest(source, length) \u2192 series
highest(length) \u2192 series
Arguments
source (series, integer)
length (integer)
Remarks
Two args version: x is a series and y is a length.
One arg version: x is a length. Algorithm uses high as a source series.
See also
", + "description": "Highest value for a given number of bars back.", + "arguments": [ + { + "argument": "source", + "type": "series, integer" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "highest(source, length) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "highestbars()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_highestbars", + "fragment": "fun_highestbars", + "info": "

highestbars()

Highest value offset for a given number of bars back.
Syntax
highestbars(source, length) \u2192 series[integer]
highestbars(length) \u2192 series[integer]
Arguments
source (series, integer)
length (integer)
Remarks
Two args version: x is a series and y is a length.
One arg version: x is a length. Algorithm uses high as a source series.
See also
", + "description": "Highest value offset for a given number of bars back.", + "arguments": [ + { + "argument": "source", + "type": "series, integer" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "highestbars(source, length) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "hline()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_hline", + "fragment": "fun_hline", + "info": "

hline()

Renders a horizontal line at a given fixed price level.
Syntax
hline(price, title, color, linestyle, linewidth, editable) \u2192 hline
Arguments
price (float) Price value at which the object will be rendered. Required argument.
title (const string) Title of the object.
color (const color) Color of the rendered line. Must be a constant value (not an expression). Optional argument.
linestyle (integer) Style of the rendered line. Possible values are: solid, dotted, dashed. Optional argument.
linewidth (integer) Width of the rendered line. Default value is 1.
editable (const bool) If true then hline style will be editable in Format dialog. Default is true.
Example
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)
See also
", + "description": "Renders a horizontal line at a given fixed price level.", + "arguments": [ + { + "argument": "price", + "type": "float" + }, + { + "argument": "title", + "type": "const string" + }, + { + "argument": "color", + "type": "const color" + }, + { + "argument": "linestyle", + "type": "integer" + }, + { + "argument": "linewidth", + "type": "integer" + }, + { + "argument": "editable", + "type": "const bool" + } + ], + "syntax": "hline(price, title, color, linestyle, linewidth, editable) \u2192 hline", + "returnType": "hline", + "returns": "" + }, + { + "name": "hour()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_hour", + "fragment": "fun_hour", + "info": "

hour()

Syntax
hour(time) \u2192 series
Arguments
time (series) UNIX time in milliseconds.
Remarks
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.
See also
", + "description": "", + "arguments": [ + { + "argument": "time", + "type": "series" + } + ], + "syntax": "hour(time) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "iff()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_iff", + "fragment": "fun_iff", + "info": "

iff()

If ... then ... else ...
Syntax
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]
Arguments
condition (series) Series with condition values. Zero value (0 and also NaN, +Infinity, -Infinity) is considered to be false, any other value is true.
then (series) Series with values to return if condition is true.
_else (series) Series with values to return if condition is false. Use na for _else argument if you do not need 'else' branch.
Example
//\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)
Remarks
iff does exactly the same thing as ternary conditional operator ?: but in a functional style. Also iff is slightly less efficient than operator ?:
See also
", + "description": "If ... then ... else ...", + "arguments": [ + { + "argument": "condition", + "type": "series" + }, + { + "argument": "then", + "type": "series" + }, + { + "argument": "_else", + "type": "series" + } + ], + "syntax": "iff(condition, then, _else) \u2192 bool", + "returnType": "bool", + "returns": "" + }, + { + "name": "input()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_input", + "fragment": "fun_input", + "info": "

input()

Adds an input to your script indicator. User can see and edit inputs on the Format Object dialog of the script study. Script inputs look and behave exactly the same as inputs of built-in Technical Analysis indicators.
Syntax
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
Arguments
defval (Depends on 'type' argument) Default value of the input variable. Note, that input value that will be ACTUALLY USED by the script is set by user on the Format Object dialog.
title (const string) Title of the input
type (const string) Input type. Possible values are bool, integer, float, string, symbol, resolution, session, source.
minval (integer, float) Minimal possible value of the input variable. This argument is used only when input type is integer or float.
maxval (integer, float) Maximum possible value of the input variable. This argument is used only when input type is integer or float.
confirm (bool) If true, then user will be asked to confirm input value before indicator is added to chart. Default value is false. This argument not used when input type is source.
step (integer, float) Step value to use for incrementing/decrementing input from format dialog. Default value is 1. This argument is used only for input types integer and float.
options (List of constants: [<type>...]) A list of options to choose from. This argument is used only for input types integer, float and string.
Example
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)
Remarks
Result of input function always should be assigned to a variable, see examples below.
", + "description": "Adds an input to your script indicator. User can see and edit inputs on the Format Object dialog of the script study. Script inputs look and behave exactly the same as inputs of built-in Technical Analysis indicators.", + "arguments": [ + { + "argument": "defval", + "type": "Depends on 'type' argument" + }, + { + "argument": "title", + "type": "const string" + }, + { + "argument": "type", + "type": "const string" + }, + { + "argument": "minval", + "type": "integer, float" + }, + { + "argument": "maxval", + "type": "integer, float" + }, + { + "argument": "confirm", + "type": "bool" + }, + { + "argument": "step", + "type": "integer, float" + }, + { + "argument": "options", + "type": "List of constants: [...]" + } + ], + "syntax": "input(defval, title, type, confirm) \u2192 bool", + "returnType": "bool", + "returns": "" + }, + { + "name": "kagi()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_kagi", + "fragment": "fun_kagi", + "info": "

kagi()

Creates a ticker identifier for requesting Kagi values.
Syntax
kagi(symbol, source, reversal) \u2192 string
kagi(symbol, reversal) \u2192 string
Arguments
symbol (string) Symbol ticker identifier.
source (string) This argument is deprecated. The source for calculating Kagi is always 'close' regardless of this argument's value.
reversal (float) Reversal amount (absolute price value).
Example
kagi_tickerid\u00a0=\u00a0kagi(tickerid,\u00a03)
kagi_close\u00a0=\u00a0security(kagi_tickerid,\u00a0period,\u00a0close)
plot(kagi_close)
See also
", + "description": "Creates a ticker identifier for requesting Kagi values.", + "arguments": [ + { + "argument": "symbol", + "type": "string" + }, + { + "argument": "source", + "type": "string" + }, + { + "argument": "reversal", + "type": "float" + } + ], + "syntax": "kagi(symbol, source, reversal) \u2192 string", + "returnType": "string", + "returns": "" + }, + { + "name": "linebreak()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_linebreak", + "fragment": "fun_linebreak", + "info": "

linebreak()

Creates a ticker identifier for requesting Line Break values.
Syntax
linebreak(symbol, source, number_of_lines) \u2192 string
linebreak(symbol, number_of_lines) \u2192 string
Arguments
symbol (string) Symbol ticker identifier.
source (string) This argument is deprecated. The source for calculating Line Break is always 'close' regardless of this argument's value.
number_of_lines (integer) Number of line.
Example
linebreak_tickerid\u00a0=\u00a0linebreak(tickerid,\u00a03)
linebreak_close\u00a0=\u00a0security(linebreak_tickerid,\u00a0period,\u00a0close)
plot(linebreak_close)
See also
", + "description": "Creates a ticker identifier for requesting Line Break values.", + "arguments": [ + { + "argument": "symbol", + "type": "string" + }, + { + "argument": "source", + "type": "string" + }, + { + "argument": "number_of_lines", + "type": "integer" + } + ], + "syntax": "linebreak(symbol, source, number_of_lines) \u2192 string", + "returnType": "string", + "returns": "" + }, + { + "name": "linreg()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_linreg", + "fragment": "fun_linreg", + "info": "

linreg()

Linear regression curve. A line that best fits the prices specified over a user-defined time period. It is calculated using the least squares method. The result of this function is calculated using the formula: linreg = intercept + slope * (length - 1 - offset), where length is the y argument, offset is the z argument, intercept and slope are the values calculated with the least squares method on source series (x argument).
Syntax
linreg(source, length, offset) \u2192 series
Arguments
source (series) Source series.
length (integer) Length.
offset (integer) Offset.
", + "description": "Linear regression curve. A line that best fits the prices specified over a user-defined time period. It is calculated using the least squares method. The result of this function is calculated using the formula: linreg = intercept + slope * (length - 1 - offset), where length is the y argument, offset is the z argument, intercept and slope are the values calculated with the least squares method on source series (x argument).", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + }, + { + "argument": "offset", + "type": "integer" + } + ], + "syntax": "linreg(source, length, offset) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "log()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_log", + "fragment": "fun_log", + "info": "

log()

Natural logarithm of any x > 0 is the unique y such that e^y = x
Syntax
log(x) \u2192 float
log(x) \u2192 const float
log(x) \u2192 series
See also
", + "description": "Natural logarithm of any x > 0 is the unique 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()

Base 10 logarithm of any x > 0 is the unique y such that 10^y = x
Syntax
log10(x) \u2192 float
log10(x) \u2192 const float
log10(x) \u2192 series
See also
", + "description": "Base 10 logarithm of any x > 0 is the unique 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 value for a given number of bars back.
Syntax
lowest(source, length) \u2192 series
lowest(length) \u2192 series
Arguments
source (series, integer)
length (integer)
Remarks
Two args version: x is a series and y is a length.
One arg version: x is a length. Algorithm uses low as a source series.
See also
", + "description": "Lowest value for a given number of bars back.", + "arguments": [ + { + "argument": "source", + "type": "series, integer" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "lowest(source, length) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "lowestbars()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_lowestbars", + "fragment": "fun_lowestbars", + "info": "

lowestbars()

Lowest value offset for a given number of bars back.
Syntax
lowestbars(source, length) \u2192 series[integer]
lowestbars(length) \u2192 series[integer]
Arguments
source (series, integer)
length (integer)
Remarks
Two args version: x is a series and y is a length.
One arg version: x is a length. Algorithm uses low as a source series.
See also
", + "description": "Lowest value offset for a given number of bars back.", + "arguments": [ + { + "argument": "source", + "type": "series, integer" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "lowestbars(source, length) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "macd()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_macd", + "fragment": "fun_macd", + "info": "

macd()

MACD (moving average convergence/divergence). It is supposed to reveal changes in the strength, direction, momentum, and duration of a trend in a stock's price.
Syntax
macd(source, fastlen, slowlen, siglen) \u2192 [series, series, series]
Arguments
source (series) Series of values to process.
fastlen (integer) Fast Length parameter.
slowlen (integer) Slow Length parameter.
siglen (integer) Signal Length parameter.
Example
//\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)
See also
", + "description": "MACD (moving average convergence/divergence). It is supposed to reveal changes in the strength, direction, momentum, and duration of a trend in a stock's price.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "fastlen", + "type": "integer" + }, + { + "argument": "slowlen", + "type": "integer" + }, + { + "argument": "siglen", + "type": "integer" + } + ], + "syntax": "macd(source, fastlen, slowlen, siglen) \u2192 [series, series, series]", + "returnType": "[series, series, series]", + "returns": "" + }, + { + "name": "max()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_max", + "fragment": "fun_max", + "info": "

max()

Returns the greater of two values
Syntax
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
Example
max(close,\u00a0open)
max(close,\u00a0max(open,\u00a042))
See also
", + "description": "Returns the greater of two values", + "arguments": [], + "syntax": "max(x, y) \u2192 const integer", + "returnType": "const integer", + "returns": "" + }, + { + "name": "min()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_min", + "fragment": "fun_min", + "info": "

min()

Returns the smaller of two values
Syntax
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
Example
min(close,\u00a0open)
min(close,\u00a0min(open,\u00a042))
See also
", + "description": "Returns the smaller of two values", + "arguments": [], + "syntax": "min(x, y) \u2192 const integer", + "returnType": "const integer", + "returns": "" + }, + { + "name": "minute()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_minute", + "fragment": "fun_minute", + "info": "

minute()

Syntax
minute(time) \u2192 series
Arguments
time (series) UNIX time in milliseconds.
Remarks
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.
See also
", + "description": "", + "arguments": [ + { + "argument": "time", + "type": "series" + } + ], + "syntax": "minute(time) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "mom()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_mom", + "fragment": "fun_mom", + "info": "

mom()

Momentum of x price and x price y bars ago. This is simply a difference x - x[y].
Syntax
mom(source, length) \u2192 series
Arguments
source (series) Series of values to process.
length (integer) Offset from the current bar to the previous bar.
See also
", + "description": "Momentum of x price and x price y bars ago. This is simply a difference x - x[y].", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "mom(source, length) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "month()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_month", + "fragment": "fun_month", + "info": "

month()

Syntax
month(time) \u2192 series
Arguments
time (series) UNIX time in milliseconds.
Remarks
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.
See also
", + "description": "", + "arguments": [ + { + "argument": "time", + "type": "series" + } + ], + "syntax": "month(time) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "na()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_na", + "fragment": "fun_na", + "info": "

na()

Test value if it's a NaN.
Syntax
na(x) \u2192 bool
na(x) \u2192 series[bool]
See also
", + "description": "Test value if it's a NaN.", + "arguments": [], + "syntax": "na(x) \u2192 bool", + "returnType": "bool", + "returns": "" + }, + { + "name": "nz()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_nz", + "fragment": "fun_nz", + "info": "

nz()

Replaces NaN values with zeros (or given value) in a series.
Syntax
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
Arguments
x (series) Series of values to process.
y (float) Value that will be inserted instead of all NaN values in x series.
Example
nz(sma(close,\u00a0100))
See also
", + "description": "Replaces NaN values with zeros (or given value) in a series.", + "arguments": [ + { + "argument": "x", + "type": "series" + }, + { + "argument": "y", + "type": "float" + } + ], + "syntax": "nz(x, y) \u2192 integer", + "returnType": "integer", + "returns": "" + }, + { + "name": "offset()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_offset", + "fragment": "fun_offset", + "info": "

offset()

Shifts series x on the y bars to the right.
Syntax
offset(source, offset) \u2192 series[bool]
offset(source, offset) \u2192 series[color]
offset(source, offset) \u2192 series[integer]
offset(source, offset) \u2192 series
Arguments
source (series) Series of values to process.
offset (integer) Number of bars to offset, must be a positive number. Negative offsets are not supported.
Remarks
If you need to shift the series to the left, use combination of offset and plot (with offset argument).
See also
", + "description": "Shifts series x on the y bars to the right.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "offset", + "type": "integer" + } + ], + "syntax": "offset(source, offset) \u2192 series[bool]", + "returnType": "series[bool]", + "returns": "" + }, + { + "name": "percentile_linear_interpolation()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_percentile_linear_interpolation", + "fragment": "fun_percentile_linear_interpolation", + "info": "

percentile_linear_interpolation()

Calculates percentile using method of linear interpolation between the two nearest ranks.
Syntax
percentile_linear_interpolation(source, length, percentage) \u2192 series
Arguments
source (series) Series of values to process (source).
length (integer) Number of bars back (length).
percentage (float) Percentage, a number from range 0..100.
Remarks
Note that a percentile calculated using this method will NOT always be a member of the input data set.
See also
", + "description": "Calculates percentile using method of linear interpolation between the two nearest ranks.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + }, + { + "argument": "percentage", + "type": "float" + } + ], + "syntax": "percentile_linear_interpolation(source, length, percentage) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "percentile_nearest_rank()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_percentile_nearest_rank", + "fragment": "fun_percentile_nearest_rank", + "info": "

percentile_nearest_rank()

Calculates percentile using method of Nearest Rank.
Syntax
percentile_nearest_rank(source, length, percentage) \u2192 series
Arguments
source (series) Series of values to process (source).
length (integer) Number of bars back (length).
percentage (float) Percentage, a number from range 0..100.
Remarks
Using the Nearest Rank method on lengths less than 100 bars back can result in the same number being used for more than one percentile.
A percentile calculated using the Nearest Rank method will always be a member of the input data set.
The 100th percentile is defined to be the largest value in the input data set.
See also
", + "description": "Calculates percentile using method of Nearest Rank.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + }, + { + "argument": "percentage", + "type": "float" + } + ], + "syntax": "percentile_nearest_rank(source, length, percentage) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "percentrank()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_percentrank", + "fragment": "fun_percentrank", + "info": "

percentrank()

Percent rank is the percents of how many previous values was less than or equal to the current value of given series.
Syntax
percentrank(source, length) \u2192 series
Arguments
source (series) Series of values to process.
length (integer) Number of bars (length).
", + "description": "Percent rank is the percents of how many previous values was less than or equal to the current value of given series.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "percentrank(source, length) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "pivothigh()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_pivothigh", + "fragment": "fun_pivothigh", + "info": "

pivothigh()

This function returns price of the pivot high point. It returns 'NaN', if there was no pivot high point.
Syntax
pivothigh(source, leftbars, rightbars) \u2192 series
pivothigh(leftbars, rightbars) \u2192 series
Arguments
source (series) An optional parameter. Data series to calculate the value. 'High' by default.
leftbars (series) Left strength.
rightbars (series) Right strength.
Example
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)
Remarks
In case of series leftbars or rightbars you should set max_bars_back argument in study or strategy accordingly.
", + "description": "This function returns price of the pivot high point. It returns 'NaN', if there was no pivot high point.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "leftbars", + "type": "series" + }, + { + "argument": "rightbars", + "type": "series" + } + ], + "syntax": "pivothigh(source, leftbars, rightbars) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "pivotlow()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_pivotlow", + "fragment": "fun_pivotlow", + "info": "

pivotlow()

This function returns price of the pivot low point. It returns 'NaN', if there was no pivot low point.
Syntax
pivotlow(source, leftbars, rightbars) \u2192 series
pivotlow(leftbars, rightbars) \u2192 series
Arguments
source (series) An optional parameter. Data series to calculate the value. 'Low' by default.
leftbars (series) Left strength.
rightbars (series) Right strength.
Example
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)
Remarks
In case of series leftbars or rightbars you should set max_bars_back argument in study or strategy accordingly.
", + "description": "This function returns price of the pivot low point. It returns 'NaN', if there was no pivot low point.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "leftbars", + "type": "series" + }, + { + "argument": "rightbars", + "type": "series" + } + ], + "syntax": "pivotlow(source, leftbars, rightbars) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "plot()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_plot", + "fragment": "fun_plot", + "info": "

plot()

Plots a series of data on the chart.
Syntax
plot(series, title, color, linewidth, style, trackprice, transp, histbase, offset, join, editable, show_last) \u2192 plot
Arguments
series (series) Series of data to be plotted. Required argument.
title (const string) Title of the plot.
color (color) Color of the plot. You can use constants like 'color=red' or 'color=#ff001a' as well as complex expressions like 'color = close >= open ? green : red'. Optional argument.
linewidth (integer) Width of the plotted line. Default value is 1. Not applicable to every style.
style (integer) Type of the plot. Possible values are: line, stepline, histogram, cross, area, columns, circles. Default value is line.
transp (integer) Transparency of the plot. Possible values are from 0 (not transparent) to 100 (invisible). Optional argument.
trackprice (bool) If true then a horizontal price line will be shown at the level of the last study value. Default is false.
histbase (float) Price value which will be considered as a start base point when rendering plot with histogram, columns or area style. Default is 0.0.
offset (integer) Shifts the plot to the left or to the right on the given number of bars. Default is 0.
join (bool) If true then plot points will be joined with line, applicable only to cross and circles styles. Default is false.
editable (const bool) If true then plot style will be editable in Format dialog. Default is true.
show_last (const integer) If set, defines the number of bars (from the last bar back to the past) to plot on chart.
Example
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)
See also
", + "description": "Plots a series of data on the chart.", + "arguments": [ + { + "argument": "series", + "type": "series" + }, + { + "argument": "title", + "type": "const string" + }, + { + "argument": "color", + "type": "color" + }, + { + "argument": "linewidth", + "type": "integer" + }, + { + "argument": "style", + "type": "integer" + }, + { + "argument": "transp", + "type": "integer" + }, + { + "argument": "trackprice", + "type": "bool" + }, + { + "argument": "histbase", + "type": "float" + }, + { + "argument": "offset", + "type": "integer" + }, + { + "argument": "join", + "type": "bool" + }, + { + "argument": "editable", + "type": "const bool" + }, + { + "argument": "show_last", + "type": "const integer" + } + ], + "syntax": "plot(series, title, color, linewidth, style, trackprice, transp, histbase, offset, join, editable, show_last) \u2192 plot", + "returnType": "plot", + "returns": "" + }, + { + "name": "plotarrow()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_plotarrow", + "fragment": "fun_plotarrow", + "info": "

plotarrow()

Plots up and down arrows on the chart. Up arrow is drawn at every indicator positive value, down arrow is drawn at every negative value. If indicator returns na then no arrow is drawn. Arrows has different height, the more absolute indicator value the longer arrow is drawn.
Syntax
plotarrow(series, title, colorup, colordown, transp, offset, minheight, maxheight, editable, show_last) \u2192 void
Arguments
series (series) Series of data to be plotted as arrows. Required argument.
title (const string) Title of the plot.
colorup (color) Color of the up arrows. You can use constants like 'color=red' or 'color=#ff001a', expressions are not allowed. Optional argument.
colordown (color) Color of the down arrows. You can use constants like 'color=red' or 'color=#ff001a', expressions are not allowed. Optional argument.
transp (integer) Transparency of the arrows. Possible values are from 0 (not transparent) to 100 (invisible). Optional argument.
offset (integer) Shifts arrows to the left or to the right on the given number of bars. Default is 0.
minheight (integer) Minimal possible arrow height in pixels. Default is 5.
maxheight (integer) Maximum possible arrow height in pixels. Default is 100.
editable (const bool) If true then plotarrow style will be editable in Format dialog. Default is true.
show_last (const integer) If set, defines the number of arrows (from the last bar back to the past) to plot on chart.
Example
study(\"plotarrow\u00a0example\",\u00a0overlay=true)
codiff\u00a0=\u00a0close\u00a0-\u00a0open
plotarrow(codiff,\u00a0colorup=teal,\u00a0colordown=orange,\u00a0transp=40)
Remarks
Use plotarrow function in conjunction with 'overlay=true' study parameter!
See also
", + "description": "Plots up and down arrows on the chart. Up arrow is drawn at every indicator positive value, down arrow is drawn at every negative value. If indicator returns na then no arrow is drawn. Arrows has different height, the more absolute indicator value the longer arrow is drawn.", + "arguments": [ + { + "argument": "series", + "type": "series" + }, + { + "argument": "title", + "type": "const string" + }, + { + "argument": "colorup", + "type": "color" + }, + { + "argument": "colordown", + "type": "color" + }, + { + "argument": "transp", + "type": "integer" + }, + { + "argument": "offset", + "type": "integer" + }, + { + "argument": "minheight", + "type": "integer" + }, + { + "argument": "maxheight", + "type": "integer" + }, + { + "argument": "editable", + "type": "const bool" + }, + { + "argument": "show_last", + "type": "const integer" + } + ], + "syntax": "plotarrow(series, title, colorup, colordown, transp, offset, minheight, maxheight, editable, show_last) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "plotbar()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_plotbar", + "fragment": "fun_plotbar", + "info": "

plotbar()

Plots ohlc bars on the chart.
Syntax
plotbar(open, high, low, close, title, color, editable, show_last) \u2192 void
Arguments
open (series) Open series of data to be used as open values of bars. Required argument.
high (series) High series of data to be used as high values of bars. Required argument.
low (series) Low series of data to be used as low values of bars. Required argument.
close (series) Close series of data to be used as close values of bars. Required argument.
title (const string) Title of the plotbar. Optional argument.
color (color) Color of the ohlc bars. You can use constants like 'color=red' or 'color=#ff001a' as well as complex expressions like 'color = close >= open ? green : red'. Optional argument.
editable (const bool) If true then plotbar style will be editable in Format dialog. Default is true.
show_last (const integer) If set, defines the number of bars (from the last bar back to the past) to plot on chart.
Example
plotbar(open,\u00a0high,\u00a0low,\u00a0close,\u00a0title='Title',\u00a0color\u00a0=\u00a0open\u00a0<\u00a0close\u00a0?\u00a0green\u00a0:\u00a0red)
Remarks
Even if one value of open, high, low or close equal NaN then bar no draw.
The maximal value of open, high, low or close will be set as 'high', and the minimal value will be set as 'low'.
See also
", + "description": "Plots ohlc bars on the chart.", + "arguments": [ + { + "argument": "open", + "type": "series" + }, + { + "argument": "high", + "type": "series" + }, + { + "argument": "low", + "type": "series" + }, + { + "argument": "close", + "type": "series" + }, + { + "argument": "title", + "type": "const string" + }, + { + "argument": "color", + "type": "color" + }, + { + "argument": "editable", + "type": "const bool" + }, + { + "argument": "show_last", + "type": "const integer" + } + ], + "syntax": "plotbar(open, high, low, close, title, color, editable, show_last) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "plotcandle()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_plotcandle", + "fragment": "fun_plotcandle", + "info": "

plotcandle()

Plots candles on the chart.
Syntax
plotcandle(open, high, low, close, title, color, wickcolor, editable, show_last, bordercolor) \u2192 void
Arguments
open (series) Open series of data to be used as open values of candles. Required argument.
high (series) High series of data to be used as high values of candles. Required argument.
low (series) Low series of data to be used as low values of candles. Required argument.
close (series) Close series of data to be used as close values of candles. Required argument.
title (const string) Title of the plotcandles. Optional argument.
color (color) Color of the candles. You can use constants like 'color=red' or 'color=#ff001a' as well as complex expressions like 'color = close >= open ? green : red'. Optional argument.
wickcolor (color) The color of the wick of candles. Must be a constant value (not an expression). An optional argument.
editable (const bool) If true then plotcandle style will be editable in Format dialog. Default is true.
show_last (const integer) If set, defines the number of candles (from the last bar back to the past) to plot on chart.
bordercolor (color) The border color of candles. Must be a constant value (not an expression). An optional argument.
Example
plotcandle(open,\u00a0high,\u00a0low,\u00a0close,\u00a0title='Title',\u00a0color\u00a0=\u00a0open\u00a0<\u00a0close\u00a0?\u00a0green\u00a0:\u00a0red,\u00a0wickcolor=black)
Remarks
Even if one value of open, high, low or close equal NaN then bar no draw.
The maximal value of open, high, low or close will be set as 'high', and the minimal value will be set as 'low'.
See also
", + "description": "Plots candles on the chart.", + "arguments": [ + { + "argument": "open", + "type": "series" + }, + { + "argument": "high", + "type": "series" + }, + { + "argument": "low", + "type": "series" + }, + { + "argument": "close", + "type": "series" + }, + { + "argument": "title", + "type": "const string" + }, + { + "argument": "color", + "type": "color" + }, + { + "argument": "wickcolor", + "type": "color" + }, + { + "argument": "editable", + "type": "const bool" + }, + { + "argument": "show_last", + "type": "const integer" + }, + { + "argument": "bordercolor", + "type": "color" + } + ], + "syntax": "plotcandle(open, high, low, close, title, color, wickcolor, editable, show_last, bordercolor) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "plotchar()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_plotchar", + "fragment": "fun_plotchar", + "info": "

plotchar()

Plots visual shapes using any given one Unicode character on the chart.
Syntax
plotchar(series, title, char, location, color, transp, offset, text, textcolor, editable, size, show_last) \u2192 void
Arguments
series (series) Series of data to be plotted as shapes. Series is treated as a series of boolean values for all location values except location.absolute. Required argument.
title (const string) Title of the plot.
char (string) Character to use as a visual shape.
location (string) Location of shapes on the chart. Possible values are: location.abovebar, location.belowbar, location.top, location.bottom, location.absolute. Default value is location.abovebar.
color (color) Color of the shapes. You can use constants like 'color=red' or 'color=#ff001a' as well as complex expressions like 'color = close >= open ? green : red'. Optional argument.
transp (integer) Transparency of the shapes. Possible values are from 0 (not transparent) to 100 (invisible). Optional argument.
offset (integer) Shifts shapes to the left or to the right on the given number of bars. Default is 0.
text (string) Text to display with the shape. You can use multiline text, to separate lines use '' escape sequence. Example: 'line oneline two'.
textcolor (color) Color of the text. You can use constants like 'textcolor=red' or 'textcolor=#ff001a' as well as complex expressions like 'textcolor = close >= open ? green : red'. Optional argument.
editable (const bool) If true then plotchar style will be editable in Format dialog. Default is true.
show_last (const integer) If set, defines the number of chars (from the last bar back to the past) to plot on chart.
size (const string) Size of characters on the chart. Possible values are: size.auto, size.tiny, size.small, size.normal, size.large, size.huge. Default is size.auto.
Example
study('plotchar\u00a0example',\u00a0overlay=true)
data\u00a0=\u00a0close\u00a0>=\u00a0open
plotchar(data,\u00a0char='\u2744')
Remarks
Use plotchar function in conjunction with 'overlay=true' study parameter!
See also
", + "description": "Plots visual shapes using any given one Unicode character on the chart.", + "arguments": [ + { + "argument": "series", + "type": "series" + }, + { + "argument": "title", + "type": "const string" + }, + { + "argument": "char", + "type": "string" + }, + { + "argument": "location", + "type": "string" + }, + { + "argument": "color", + "type": "color" + }, + { + "argument": "transp", + "type": "integer" + }, + { + "argument": "offset", + "type": "integer" + }, + { + "argument": "text", + "type": "string" + }, + { + "argument": "textcolor", + "type": "color" + }, + { + "argument": "editable", + "type": "const bool" + }, + { + "argument": "show_last", + "type": "const integer" + }, + { + "argument": "size", + "type": "const string" + } + ], + "syntax": "plotchar(series, title, char, location, color, transp, offset, text, textcolor, editable, size, show_last) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "plotshape()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_plotshape", + "fragment": "fun_plotshape", + "info": "

plotshape()

Plots visual shapes on the chart.
Syntax
plotshape(series, title, style, location, color, transp, offset, text, textcolor, editable, size, show_last) \u2192 void
Arguments
series (series) Series of data to be plotted as shapes. Series is treated as a series of boolean values for all location values except location.absolute. Required argument.
title (const string) Title of the plot.
location (string) Location of shapes on the chart. Possible values are: location.abovebar, location.belowbar, location.top, location.bottom, location.absolute. Default value is location.abovebar.
color (color) Color of the shapes. You can use constants like 'color=red' or 'color=#ff001a' as well as complex expressions like 'color = close >= open ? green : red'. Optional argument.
transp (integer) Transparency of the shapes. Possible values are from 0 (not transparent) to 100 (invisible). Optional argument.
offset (integer) Shifts shapes to the left or to the right on the given number of bars. Default is 0.
text (string) Text to display with the shape. You can use multiline text, to separate lines use '' escape sequence. Example: 'line oneline two'.
textcolor (color) Color of the text. You can use constants like 'textcolor=red' or 'textcolor=#ff001a' as well as complex expressions like 'textcolor = close >= open ? green : red'. Optional argument.
editable (const bool) If true then plotshape style will be editable in Format dialog. Default is true.
show_last (const integer) If set, defines the number of shapes (from the last bar back to the past) to plot on chart.
size (const string) Size of shapes on the chart. Possible values are: size.auto, size.tiny, size.small, size.normal, size.large, size.huge. Default is size.auto.
Example
study('plotshape\u00a0example\u00a01',\u00a0overlay=true)
data\u00a0=\u00a0close\u00a0>=\u00a0open
plotshape(data,\u00a0style=shape.xcross)
Remarks
Use plotshape function in conjunction with 'overlay=true' study parameter!
See also
", + "description": "Plots visual shapes on the chart.", + "arguments": [ + { + "argument": "series", + "type": "series" + }, + { + "argument": "title", + "type": "const string" + }, + { + "argument": "style", + "type": "string" + }, + { + "argument": "location", + "type": "string" + }, + { + "argument": "color", + "type": "color" + }, + { + "argument": "transp", + "type": "integer" + }, + { + "argument": "offset", + "type": "integer" + }, + { + "argument": "text", + "type": "string" + }, + { + "argument": "textcolor", + "type": "color" + }, + { + "argument": "editable", + "type": "const bool" + }, + { + "argument": "show_last", + "type": "const integer" + }, + { + "argument": "size", + "type": "const string" + } + ], + "syntax": "plotshape(series, title, style, location, color, transp, offset, text, textcolor, editable, size, show_last) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "pointfigure()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_pointfigure", + "fragment": "fun_pointfigure", + "info": "

pointfigure()

Creates a ticker identifier for requesting Point & Figure values.
Syntax
pointfigure(symbol, source, style, param, reversal) \u2192 string
Arguments
symbol (string) Symbol ticker identifier.
source (string) The source for calculating Point & Figure. Possible values are: 'hl', 'close'. Values 'open', 'high' and 'low' are equivalent to 'close' and were left for backward compatibility.
style (string) Box Size Assignment Method: 'ATR', 'Traditional'.
param (float) ATR Length if style is equal to 'ATR', or Box Size if style is equal to 'Traditional'.
reversal (integer) Reversal amount.
Example
pnf_tickerid\u00a0=\u00a0pointfigure(tickerid,\u00a0\"hl\",\u00a0\"Traditional\",\u00a01,\u00a03)
pnf_close\u00a0=\u00a0security(pnf_tickerid,\u00a0period,\u00a0close)
plot(pnf_close)
See also
", + "description": "Creates a ticker identifier for requesting Point & Figure values.", + "arguments": [ + { + "argument": "symbol", + "type": "string" + }, + { + "argument": "source", + "type": "string" + }, + { + "argument": "style", + "type": "string" + }, + { + "argument": "param", + "type": "float" + }, + { + "argument": "reversal", + "type": "integer" + } + ], + "syntax": "pointfigure(symbol, source, style, param, reversal) \u2192 string", + "returnType": "string", + "returns": "" + }, + { + "name": "pow()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_pow", + "fragment": "fun_pow", + "info": "

pow()

Mathematical power function.
Syntax
pow(base, exponent) \u2192 float
pow(base, exponent) \u2192 const float
pow(base, exponent) \u2192 series
Arguments
base (series) Specify the base to use.
exponent (float) Specifies the exponent.
Example
pow(close,\u00a02)
See also
", + "description": "Mathematical power function.", + "arguments": [ + { + "argument": "base", + "type": "series" + }, + { + "argument": "exponent", + "type": "float" + } + ], + "syntax": "pow(base, exponent) \u2192 float", + "returnType": "float", + "returns": "" + }, + { + "name": "renko()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_renko", + "fragment": "fun_renko", + "info": "

renko()

Creates a ticker identifier for requesting Renko values.
Syntax
renko(symbol, source, style, param) \u2192 string
renko(symbol, style, param) \u2192 string
Arguments
symbol (string) Symbol ticker identifier.
source (string) This argument is deprecated. The source for calculating Renko is always 'close' regardless of this argument's value.
style (string) Box Size Assignment Method: 'ATR', 'Traditional'.
param (float) ATR Length if style is equal to 'ATR', or Box Size if style is equal to 'Traditional'.
Example
renko_tickerid\u00a0=\u00a0renko(tickerid,\u00a0\"ATR\",\u00a010)
renko_close\u00a0=\u00a0security(renko_tickerid,\u00a0period,\u00a0close)
plot(renko_close)
See also
", + "description": "Creates a ticker identifier for requesting Renko values.", + "arguments": [ + { + "argument": "symbol", + "type": "string" + }, + { + "argument": "source", + "type": "string" + }, + { + "argument": "style", + "type": "string" + }, + { + "argument": "param", + "type": "float" + } + ], + "syntax": "renko(symbol, source, style, param) \u2192 string", + "returnType": "string", + "returns": "" + }, + { + "name": "rising()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_rising", + "fragment": "fun_rising", + "info": "

rising()

Test if the x series is now rising for y bars long.
Syntax
rising(source, length) \u2192 series[bool]
Arguments
source (series) Series of values to process.
length (integer) Number of bars (length).
See also
", + "description": "Test if the x series is now rising for y bars long.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "rising(source, length) \u2192 series[bool]", + "returnType": "series[bool]", + "returns": "" + }, + { + "name": "rma()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_rma", + "fragment": "fun_rma", + "info": "

rma()

Moving average used in RSI. It is the exponentially weighted moving average with alpha = 1 / length.
Syntax
rma(source, length) \u2192 series
Arguments
source (series) Series of values to process.
length (integer) Number of bars (length).
Example
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))
See also
", + "description": "Moving average used in RSI. It is the exponentially weighted moving average with alpha = 1 / length.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "rma(source, length) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "roc()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_roc", + "fragment": "fun_roc", + "info": "

roc()

Function roc (rate of change) showing the difference between current value of x and the value of x that was y days ago.
It is calculated by a formula: 100 * change(src, length) / src[length].
Syntax
roc(source, length) \u2192 series
Arguments
source (series) Series of values to process.
length (integer) Number of bars (length).
", + "description": "Function roc (rate of change) showing the difference between current value of x and the value of x that was y days ago.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "roc(source, length) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "round()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_round", + "fragment": "fun_round", + "info": "

round()

The round function returns the value of the argument rounded to the nearest integer, with ties rounding up.
Syntax
round(x) \u2192 integer
round(x) \u2192 const integer
round(x) \u2192 series[integer]
See also
", + "description": "The round function returns the value of the argument rounded to the nearest integer, with ties rounding up.", + "arguments": [], + "syntax": "round(x) \u2192 integer", + "returnType": "integer", + "returns": "" + }, + { + "name": "rsi()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_rsi", + "fragment": "fun_rsi", + "info": "

rsi()

Relative strength index. It is calculated based on rma's of upward and downward change of x.
Syntax
rsi(x, y) \u2192 series
Arguments
x (series)
y (integer, series)
Example
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))
Remarks
If x is a series and y is integer then x is a source series and y is a length.
If x is a series and y is a series then x and y are considered to be 2 calculated MAs for upward and downward changes.
See also
", + "description": "Relative strength index. It is calculated based on rma's of upward and downward change of x.", + "arguments": [ + { + "argument": "x", + "type": "series" + }, + { + "argument": "y", + "type": "integer, series" + } + ], + "syntax": "rsi(x, y) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "sar()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_sar", + "fragment": "fun_sar", + "info": "

sar()

Parabolic SAR (parabolic stop and reverse) is a method devised by J. Welles Wilder, Jr., to find potential reversals in the market price direction of traded goods.
Syntax
sar(start, inc, max) \u2192 series
Arguments
start (float) Start.
inc (float) Increment.
max (float) Maximum.
Example
plot(sar(0.2,\u00a00.2,\u00a0.2),\u00a0style=cross,\u00a0linewidth=3)
", + "description": "Parabolic SAR (parabolic stop and reverse) is a method devised by J. Welles Wilder, Jr., to find potential reversals in the market price direction of traded goods.", + "arguments": [ + { + "argument": "start", + "type": "float" + }, + { + "argument": "inc", + "type": "float" + }, + { + "argument": "max", + "type": "float" + } + ], + "syntax": "sar(start, inc, max) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "second()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_second", + "fragment": "fun_second", + "info": "

second()

Syntax
second(time) \u2192 series
Arguments
time (series) UNIX time in milliseconds.
Remarks
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.
See also
", + "description": "", + "arguments": [ + { + "argument": "time", + "type": "series" + } + ], + "syntax": "second(time) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "security()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_security", + "fragment": "fun_security", + "info": "

security()

Request another symbol/resolution
Syntax
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]
Arguments
symbol (string) Symbol.
resolution (string) Resolution. An empty string is interpreted as the current resolution of the chart.
expression (series) Expression to calculate and return from the security call.
gaps (const bool) Merge strategy for the requested data (requested data automatically merges with the main series OHLC data). Possible values: barmerge.gaps_on, barmerge.gaps_off. barmerge.gaps_on - requested data is merged with possible gaps (na values). barmerge.gaps_off - requested data is merged continuously without gaps, all the gaps are filled with the previous nearest existing values. Default value is barmerge.gaps_off.
lookahead (const bool) Merge strategy for the requested data position. Possible values: barmerge.lookahead_on, barmerge.lookahead_off. Default value is barmerge.lookahead_off starting from version 3. Note that behavour is the same on real-time, and differs only on history.
Example
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)
Remarks
PineScript code that uses this function could calculate differently on history and real-time data.
If you want to specify additional parameters of the requested symbol, e.g. session type or adjustment type, you can use the tickerid() function.
It is not possible to pass a spread to this function using the 'ticker' variable. You can use the 'tickerid' variable or a string representation of the ticker, e.g. \u201cAAPL+MSFT*TSLA\u201d.
At the moment only 40 security calls can be present in a single script.
Please note that using this variable/function can cause indicator repainting.
The resolution argument allowable values are: 1S, 5S, 15S, 30S - for seconds intervals (chart resolution should be less than or equal to the requested resolution) from 1 to 1440 for minutes from 1D to 365D for days from 1W to 52W for weeks from 1M to 12M for months
See also
", + "description": "Request another symbol/resolution", + "arguments": [ + { + "argument": "symbol", + "type": "string" + }, + { + "argument": "resolution", + "type": "string" + }, + { + "argument": "expression", + "type": "series" + }, + { + "argument": "gaps", + "type": "const bool" + }, + { + "argument": "lookahead", + "type": "const bool" + } + ], + "syntax": "security(symbol, resolution, expression, gaps, lookahead) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "sign()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_sign", + "fragment": "fun_sign", + "info": "

sign()

Sign (signum) of x is zero if the x is zero, 1.0 if the x is greater than zero, -1.0 if the x is less than zero.
Syntax
sign(x) \u2192 float
sign(x) \u2192 const float
sign(x) \u2192 series
", + "description": "Sign (signum) of x is zero if the x is zero, 1.0 if the x is greater than zero, -1.0 if the x is less than zero.", + "arguments": [], + "syntax": "sign(x) \u2192 float", + "returnType": "float", + "returns": "" + }, + { + "name": "sin()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_sin", + "fragment": "fun_sin", + "info": "

sin()

The sin function returns the trigonometric sine of an angle.
Syntax
sin(x) \u2192 float
sin(x) \u2192 const float
sin(x) \u2192 series
Arguments
x (series) Angle, in radians.
", + "description": "The sin function returns the trigonometric sine of an angle.", + "arguments": [ + { + "argument": "x", + "type": "series" + } + ], + "syntax": "sin(x) \u2192 float", + "returnType": "float", + "returns": "" + }, + { + "name": "sma()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_sma", + "fragment": "fun_sma", + "info": "

sma()

The sma function returns the moving average, that is the sum of last y values of x, divided by y.
Syntax
sma(source, length) \u2192 series
Arguments
source (series) Series of values to process.
length (integer) Number of bars (length).
Example
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))
See also
", + "description": "The sma function returns the moving average, that is the sum of last y values of x, divided by y.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "sma(source, length) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "sqrt()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_sqrt", + "fragment": "fun_sqrt", + "info": "

sqrt()

Square root of any x >= 0 is the unique y >= 0 such that y^2 = x
Syntax
sqrt(x) \u2192 float
sqrt(x) \u2192 const float
sqrt(x) \u2192 series
See also
", + "description": "Square root of any x >= 0 is the unique y >= 0 such that y^2 = x", + "arguments": [], + "syntax": "sqrt(x) \u2192 float", + "returnType": "float", + "returns": "" + }, + { + "name": "stdev()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_stdev", + "fragment": "fun_stdev", + "info": "

stdev()

Syntax
stdev(source, length) \u2192 series
Arguments
source (series) Series of values to process.
length (integer) Number of bars (length).
Example
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))
Remarks
This is a biased estimation of standard deviation.
See also
", + "description": "", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "stdev(source, length) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "stoch()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_stoch", + "fragment": "fun_stoch", + "info": "

stoch()

Stochastic. It is calculated by a formula: 100 * (close - lowest(low, length)) / (highest(high, length) - lowest(low, length)).
Syntax
stoch(source, high, low, length) \u2192 series
Arguments
source (series) Source series.
high (series) Series of high.
low (series) Series of low.
length (integer) Length (number of bars back).
See also
", + "description": "Stochastic. It is calculated by a formula: 100 * (close - lowest(low, length)) / (highest(high, length) - lowest(low, length)).", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "high", + "type": "series" + }, + { + "argument": "low", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "stoch(source, high, low, length) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "strategy()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_strategy", + "fragment": "fun_strategy", + "info": "

strategy()

The function sets a number of strategy properties.
Syntax
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
Arguments
title (const string) study title that would be seen in Indicators/Strategies widget. Argument IS REQUIRED.
shorttitle (const string) study short title that would be seen in the chart legend. Argument is optional.
overlay (const bool) if true the study will be added as an overlay for the main series. If false - it would be added on a separate chart pane. Default is false.
precision (const integer) number of digits after the floating point for study values on the price axis. Must be a non negative integer and not greater than 16. Precision 0 has special rules for formatting very large numbers (like volume, e.g. '5183' will be formatted as '5K'). Default value is 4.
scale (const integer) price scale that the indicator should be attached to. Possible values are: scale.right, scale.left, scale.none. Value scale.none can be applied only in combination with 'overlay=true' setting. If omitted, using scale from main series.
pyramiding (const integer) Maximum number of entries allowed in the same direction. If the value is 0, only one entry order in the same direction can be opened, any additional entry order is rejected. The default value is 0.
calc_on_order_fills (const bool) Additional one time intrabar order calculation. If the parameter is set to 'true', then the strategy is recalculated once intrabar after an order is filled (not only at close of the bar). The default value is 'false'.
calc_on_every_tick (const bool) Additional intrabar strategy calculations. If the parameter is 'true', then the strategy will calculate on every tick in real-time, rather than on bars' closes. The parameter does not affect strategy calculation on historical data. The default value is 'false'.
max_bars_back (const integer) Maximum number of bars that is available for the strategy for historical reference. The default value is calculated automatically and can be changed manually. If the strategy requires a value greater than the manually specified one, last one will be ignored and the strategy will calculate the value automatically.
backtest_fill_limits_assumption (const integer) Limit order execution assumption. Limit orders are filled intrabar only if market price exceeds the limit order level by the specified number of ticks.
default_qty_type (const string) Parameter to determine the number of contracts/shares/lots/units to trade, if the 'qty' = 'NaN'. The allowed values are: strategy.fixed (fixed quantity by default), strategy.cash (specified in currency of the symbol and the amount is converted into quantity), strategy.percent_of_equity (% of currently available equity).
default_qty_value (const float) Number of contracts/shares/lots/units if 'default_qty_type'=strategy.fixed is used; or amount of cash in currency of the symbol if 'default_qty_type'=strategy.cash is used; or number of percents of currently available equity if 'default_qty_type'=strategy.percent_of_equity is used.
currency (const string) Account currency for this strategy. Possible values are: NONE, USD, EUR, AUD, GBP, NZD, CAD, CHF, HKD, JPY, NOK, SEK, SGD, TRY, ZAR
linktoseries (const bool) if true then the study will be always on the same pane and same price scale as the main series. Should be used only in combination with 'overlay=true'. Default is false.
slippage (const integer) Slippage for market and stop orders in points impairs the filling price of market and stop-market orders for a specified number of ticks. E.g. if mintick = 0.01, slippage=5 would make the slippage price 5*0.01=0.05.
commission_type (const string) Commission type for an order. The allowed values are: strategy.commission.percent (a percentage of the cash volume of order), strategy.commission.cash_per_contract (money displayed in the account currency per contract), strategy.commission.cash_per_order (money displayed in the account currency per order).
commission_value (const float) Commission value for an order. Depending on the type selected (commission_type) includes percentage or money.
Example
strategy(title='MyStrategy')
strategy(title=\"MyStrategy\",\u00a0shorttitle=\"MS\",\u00a0pyramiding\u00a0=\u00a010)
Remarks
Every strategy script must have one strategy call.
PineScript code that uses argument calc_on_every_tick=true could calculate differently on history and real-time data.
When using non-standard types of chart as a basis for strategy, you need to realize that the result will be different. The orders will be executed at the prices of this chart (e.g.for Heikin Ashi it\u2019ll take Heikin Ashi prices (the average ones) not the real market prices). Therefore we highly recommend you to use standard chart type for strategies.
", + "description": "The function sets a number of strategy properties.", + "arguments": [ + { + "argument": "title", + "type": "const string" + }, + { + "argument": "shorttitle", + "type": "const string" + }, + { + "argument": "overlay", + "type": "const bool" + }, + { + "argument": "precision", + "type": "const integer" + }, + { + "argument": "scale", + "type": "const integer" + }, + { + "argument": "pyramiding", + "type": "const integer" + }, + { + "argument": "calc_on_order_fills", + "type": "const bool" + }, + { + "argument": "calc_on_every_tick", + "type": "const bool" + }, + { + "argument": "max_bars_back", + "type": "const integer" + }, + { + "argument": "backtest_fill_limits_assumption", + "type": "const integer" + }, + { + "argument": "default_qty_type", + "type": "const string" + }, + { + "argument": "default_qty_value", + "type": "const float" + }, + { + "argument": "currency", + "type": "const string" + }, + { + "argument": "linktoseries", + "type": "const bool" + }, + { + "argument": "slippage", + "type": "const integer" + }, + { + "argument": "commission_type", + "type": "const string" + }, + { + "argument": "commission_value", + "type": "const float" + } + ], + "syntax": "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", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.cancel()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_strategy.cancel", + "fragment": "fun_strategy.cancel", + "info": "

strategy.cancel()

It is a command to cancel/deactivate pending orders by referencing their names, which were generated by the functions: strategy.order, strategy.entry and strategy.exit.
Syntax
strategy.cancel(id, when) \u2192 void
Arguments
id (string) A required parameter. The order identifier. It is possible to cancel an order by referencing its identifier.
when (bool) An optional parameter. Condition to cancel an order with specified ID. If condition is true, then the order with specified ID will be cancelled. Default value is 'true'.
Example
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\u00a0false
", + "description": "It is a command to cancel/deactivate pending orders by referencing their names, which were generated by the functions: strategy.order, strategy.entry and strategy.exit.", + "arguments": [ + { + "argument": "id", + "type": "string" + }, + { + "argument": "when", + "type": "bool" + } + ], + "syntax": "strategy.cancel(id, when) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.cancel_all()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_strategy.cancel_all", + "fragment": "fun_strategy.cancel_all", + "info": "

strategy.cancel_all()

It is a command to cancel/deactivate all pending orders, which were generated by the functions: strategy.order, strategy.entry and strategy.exit.
Syntax
strategy.cancel_all(when) \u2192 void
Arguments
when (bool) An optional parameter. Condition to cancel all orders. If condition is true, then all active orders will be cancelled. Default value is 'true'.
Example
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\u00a0true
", + "description": "It is a command to cancel/deactivate all pending orders, which were generated by the functions: strategy.order, strategy.entry and strategy.exit.", + "arguments": [ + { + "argument": "when", + "type": "bool" + } + ], + "syntax": "strategy.cancel_all(when) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.close()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_strategy.close", + "fragment": "fun_strategy.close", + "info": "

strategy.close()

It is a command to exit from the entry with the specified ID. If there were multiple entry orders with the same ID, all of them are exited at once. If there are no open entries with the specified ID by the moment the command is triggered, the command will not come into effect. The command uses market order. Every entry is closed by a separate market order.
Syntax
strategy.close(id, when) \u2192 void
Arguments
id (string) A required parameter. The order identifier. It is possible to close an order by referencing its identifier.
when (bool) A required parameter. Condition of the command.
Example
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)
", + "description": "It is a command to exit from the entry with the specified ID. If there were multiple entry orders with the same ID, all of them are exited at once. If there are no open entries with the specified ID by the moment the command is triggered, the command will not come into effect. The command uses market order. Every entry is closed by a separate market order.", + "arguments": [ + { + "argument": "id", + "type": "string" + }, + { + "argument": "when", + "type": "bool" + } + ], + "syntax": "strategy.close(id, when) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.close_all()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_strategy.close_all", + "fragment": "fun_strategy.close_all", + "info": "

strategy.close_all()

It is a command to exit from current market position making it flat. If there is no open market position by the moment the command is triggered, the command will not come into effect.
Syntax
strategy.close_all(when) \u2192 void
Arguments
when (bool) A required parameter. Condition of the command.
Example
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)
", + "description": "It is a command to exit from current market position making it flat. If there is no open market position by the moment the command is triggered, the command will not come into effect.", + "arguments": [ + { + "argument": "when", + "type": "bool" + } + ], + "syntax": "strategy.close_all(when) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.entry()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_strategy.entry", + "fragment": "fun_strategy.entry", + "info": "

strategy.entry()

It is a command to enter market position. If an order with the same ID is already pending, it is possible to modify the order. If there is no order with the specified ID, a new order is placed. To deactivate an entry order, the command strategy.cancel or strategy.cancel_all should be used. In comparison to the function strategy.order, the function strategy.entry is affected by pyramiding and it can reverse market position correctly. If both 'limit' and 'stop' parameters are 'NaN', the order type is market order.
Syntax
strategy.entry(id, long, qty, limit, stop, oca_name, oca_type, comment, when) \u2192 void
Arguments
id (string) A required parameter. The order identifier. It is possible to cancel or modify an order by referencing its identifier.
long (bool) A required parameter. Market position direction: 'true' or 'strategy.long' is for long, 'false' or 'strategy.short' is for short.
qty (float) A required parameter. Number of contracts/shares/lots/units to trade. The default value is 'NaN'.
limit (float) An optional parameter. Limit price of the order. If it is specified, the order type is either 'limit', or 'stop-limit'. 'NaN' should be specified for any other order type.
stop (float) An optional parameter. Stop price of the order. If it is specified, the order type is either 'stop', or 'stop-limit'. 'NaN' should be specified for any other order type.
oca_name (string) An optional parameter. Name of the OCA group the order belongs to. If the order should not belong to any particular OCA group, there should be an empty string.
oca_type (string) An optional parameter. Type of the OCA group. The allowed values are: strategy.oca.none - the order should not belong to any particular OCA group; strategy.oca.cancel - the order should belong to an OCA group, where as soon as an order is filled, all other orders of the same group are cancelled; strategy.oca.reduce - the order should belong to an OCA group, where if X number of contracts of an order is filled, number of contracts for each other order of the same OCA group is decreased by X.
comment (string) An optional parameter. Commentary to the order. Optional string.
when (bool) An optional parameter. Condition of the order. The order is placed if condition is 'true'. If condition is 'false', nothing happens (the previously placed order with the same ID is not cancelled). Default value is 'true'.
Example
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\u00a0low
", + "description": "It is a command to enter market position. If an order with the same ID is already pending, it is possible to modify the order. If there is no order with the specified ID, a new order is placed. To deactivate an entry order, the command strategy.cancel or strategy.cancel_all should be used. In comparison to the function strategy.order, the function strategy.entry is affected by pyramiding and it can reverse market position correctly. If both 'limit' and 'stop' parameters are 'NaN', the order type is market order.", + "arguments": [ + { + "argument": "id", + "type": "string" + }, + { + "argument": "long", + "type": "bool" + }, + { + "argument": "qty", + "type": "float" + }, + { + "argument": "limit", + "type": "float" + }, + { + "argument": "stop", + "type": "float" + }, + { + "argument": "oca_name", + "type": "string" + }, + { + "argument": "oca_type", + "type": "string" + }, + { + "argument": "comment", + "type": "string" + }, + { + "argument": "when", + "type": "bool" + } + ], + "syntax": "strategy.entry(id, long, qty, limit, stop, oca_name, oca_type, comment, when) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.exit()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_strategy.exit", + "fragment": "fun_strategy.exit", + "info": "

strategy.exit()

It is a command to exit either a specific entry, or whole market position. If an order with the same ID is already pending, it is possible to modify the order. If an entry order was not filled, but an exit order is generated, the exit order will wait till entry order is filled and then the exit order is placed. To deactivate an exit order, the command strategy.cancel or strategy.cancel_all should be used. If the function strategy.exit is called once, it exits a position only once. If you want to exit multiple times, the command strategy.exit should be called multiple times. If you use a stop loss and a trailing stop, their order type is 'stop', so only one of them is placed (the one that is supposed to be filled first). If all the following parameters 'profit', 'limit', 'loss', 'stop', 'trail_points', 'trail_offset' are 'NaN', the command will fail. To use market order to exit, the command strategy.close or strategy.close_all should be used.
Syntax
strategy.exit(id, from_entry, qty, qty_percent, profit, limit, loss, stop, trail_price, trail_points, trail_offset, oca_name, comment, when) \u2192 void
Arguments
id (string) A required parameter. The order identifier. It is possible to cancel or modify an order by referencing its identifier.
from_entry (string) An optional parameter. The identifier of a specific entry order to exit from it. To exit all entries an empty string should be used. The default values is empty string.
qty (float) An optional parameter. Number of contracts/shares/lots/units to exit. The default value is 'NaN'.
qty_percent (float) An optional parameter. Number of contracts/shares/lots/units to exit (in % from entry quantity). Priority of the parameter 'qty_percent' is higher than priority of the parameter 'qty' ('qty_percent' is used instead of 'qty', if its value is not 'NaN'). The allowed range of values: from 0% to 100%. The default value is 100%.
profit (float) An optional parameter. Profit target (specified in ticks). If it is specified, a limit order is placed to exit market position when the specified amount of profit (in ticks) is reached. The default value is 'NaN'.
limit (float) An optional parameter. Profit target (requires a specific price). If it is specified, a limit order is placed to exit market position at the specified price (or better). Priority of the parameter 'limit' is higher than priority of the parameter 'profit' ('limit' is used instead of 'profit', if its value is not 'NaN'). The default value is 'NaN'.
loss (float) An optional parameter. Stop loss (specified in ticks). If it is specified, a stop order is placed to exit market position when the specified amount of loss (in ticks) is reached. The default value is 'NaN'.
stop (float) An optional parameter. Stop loss (requires a specific price). If it is specified, a stop order is placed to exit market position at the specified price (or worse). Priority of the parameter 'stop' is higher than priority of the parameter 'loss' ('stop' is used instead of 'loss', if its value is not 'NaN'). The default value is 'NaN'.
trail_price (float) An optional parameter. Trailing stop activation level (requires a specific price). If it is specified, a trailing stop order will be placed when the specified price level is reached. The offset (in ticks) to determine initial price of the trailing stop order is specified in the 'trail_offset' parameter: X ticks lower than activation level to exit long position; X ticks higher than activation level to exit short position. The default value is 'NaN'.
trail_points (float) An optional parameter. Trailing stop activation level (profit specified in ticks). If it is specified, a trailing stop order will be placed when the calculated price level (specified amount of profit) is reached. The offset (in ticks) to determine initial price of the trailing stop order is specified in the 'trail_offset' parameter: X ticks lower than activation level to exit long position; X ticks higher than activation level to exit short position. The default value is 'NaN'.
trail_offset (float) An optional parameter. Trailing stop price (specified in ticks). The offset in ticks to determine initial price of the trailing stop order: X ticks lower than 'trail_price' or 'trail_points' to exit long position; X ticks higher than 'trail_price' or 'trail_points' to exit short position. The default value is 'NaN'.
oca_name (string) An optional parameter. Name of the OCA group (oca_type = strategy.oca.reduce) the profit target, the stop loss / the trailing stop orders belong to. If the name is not specified, it will be generated automatically.
comment (string) An optional parameter. Commentary to the order. Optional string.
when (bool) An optional parameter. Condition of the order. The order is placed if condition is 'true'. If condition is 'false', nothing happens (the previously placed order with the same ID is not cancelled). Default value is 'true'.
Example
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\"
", + "description": "It is a command to exit either a specific entry, or whole market position. If an order with the same ID is already pending, it is possible to modify the order. If an entry order was not filled, but an exit order is generated, the exit order will wait till entry order is filled and then the exit order is placed. To deactivate an exit order, the command strategy.cancel or strategy.cancel_all should be used. If the function strategy.exit is called once, it exits a position only once. If you want to exit multiple times, the command strategy.exit should be called multiple times. If you use a stop loss and a trailing stop, their order type is 'stop', so only one of them is placed (the one that is supposed to be filled first). If all the following parameters 'profit', 'limit', 'loss', 'stop', 'trail_points', 'trail_offset' are 'NaN', the command will fail. To use market order to exit, the command strategy.close or strategy.close_all should be used.", + "arguments": [ + { + "argument": "id", + "type": "string" + }, + { + "argument": "from_entry", + "type": "string" + }, + { + "argument": "qty", + "type": "float" + }, + { + "argument": "qty_percent", + "type": "float" + }, + { + "argument": "profit", + "type": "float" + }, + { + "argument": "limit", + "type": "float" + }, + { + "argument": "loss", + "type": "float" + }, + { + "argument": "stop", + "type": "float" + }, + { + "argument": "trail_price", + "type": "float" + }, + { + "argument": "trail_points", + "type": "float" + }, + { + "argument": "trail_offset", + "type": "float" + }, + { + "argument": "oca_name", + "type": "string" + }, + { + "argument": "comment", + "type": "string" + }, + { + "argument": "when", + "type": "bool" + } + ], + "syntax": "strategy.exit(id, from_entry, qty, qty_percent, profit, limit, loss, stop, trail_price, trail_points, trail_offset, oca_name, comment, when) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.order()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_strategy.order", + "fragment": "fun_strategy.order", + "info": "

strategy.order()

It is a command to place order. If an order with the same ID is already pending, it is possible to modify the order. If there is no order with the specified ID, a new order is placed. To deactivate order, the command strategy.cancel or strategy.cancel_all should be used. In comparison to the function strategy.entry, the function strategy.order is not affected by pyramiding. If both 'limit' and 'stop' parameters are 'NaN', the order type is market order.
Syntax
strategy.order(id, long, qty, limit, stop, oca_name, oca_type, comment, when) \u2192 void
Arguments
id (string) A required parameter. The order identifier. It is possible to cancel or modify an order by referencing its identifier.
long (bool) A required parameter. Order direction: 'true' or 'strategy.long' is for buy, 'false' or 'strategy.short' is for sell.
qty (float) A required parameter. Number of contracts/shares/lots/units to trade. The default value is 'NaN'.
limit (float) An optional parameter. Limit price of the order. If it is specified, the order type is either 'limit', or 'stop-limit'. 'NaN' should be specified for any other order type.
stop (float) An optional parameter. Stop price of the order. If it is specified, the order type is either 'stop', or 'stop-limit'. 'NaN' should be specified for any other order type.
oca_name (string) An optional parameter. Name of the OCA group the order belongs to. If the order should not belong to any particular OCA group, there should be an empty string.
oca_type (string) An optional parameter. Type of the OCA group. The allowed values are: strategy.oca.none - the order should not belong to any particular OCA group; strategy.oca.cancel - the order should belong to an OCA group, where as soon as an order is filled, all other orders of the same group are cancelled; strategy.oca.reduce - the order should belong to an OCA group, where if X number of contracts of an order is filled, number of contracts for each other order of the same OCA group is decreased by X.
comment (string) An optional parameter. Commentary to the order. Optional string.
when (bool) An optional parameter. Condition of the order. The order is placed if condition is 'true'. If condition is 'false', nothing happens (the previously placed order with the same ID is not cancelled). Default value is 'true'.
Example
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\u00a0low
", + "description": "It is a command to place order. If an order with the same ID is already pending, it is possible to modify the order. If there is no order with the specified ID, a new order is placed. To deactivate order, the command strategy.cancel or strategy.cancel_all should be used. In comparison to the function strategy.entry, the function strategy.order is not affected by pyramiding. If both 'limit' and 'stop' parameters are 'NaN', the order type is market order.", + "arguments": [ + { + "argument": "id", + "type": "string" + }, + { + "argument": "long", + "type": "bool" + }, + { + "argument": "qty", + "type": "float" + }, + { + "argument": "limit", + "type": "float" + }, + { + "argument": "stop", + "type": "float" + }, + { + "argument": "oca_name", + "type": "string" + }, + { + "argument": "oca_type", + "type": "string" + }, + { + "argument": "comment", + "type": "string" + }, + { + "argument": "when", + "type": "bool" + } + ], + "syntax": "strategy.order(id, long, qty, limit, stop, oca_name, oca_type, comment, when) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.risk.allow_entry_in()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_strategy.risk.allow_entry_in", + "fragment": "fun_strategy.risk.allow_entry_in", + "info": "

strategy.risk.allow_entry_in()

The purpose of this rule is to forbid short entries, only long etries will be placed. The rule affects the following function: 'entry'.
Syntax
strategy.risk.allow_entry_in(value) \u2192 void
Arguments
value (string) To determine allowed market position direction, please specify one of the following values: strategy.direction.all (by default), strategy.direction.long, strategy.direction.short
Example
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)
", + "description": "The purpose of this rule is to forbid short entries, only long etries will be placed. The rule affects the following function: 'entry'.", + "arguments": [ + { + "argument": "value", + "type": "string" + } + ], + "syntax": "strategy.risk.allow_entry_in(value) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.risk.max_cons_loss_days()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_strategy.risk.max_cons_loss_days", + "fragment": "fun_strategy.risk.max_cons_loss_days", + "info": "

strategy.risk.max_cons_loss_days()

The purpose of this rule is to cancel all pending orders, close all open positions and stop placing orders after a specified number of consecutive days with losses. The rule affects the whole strategy.
Syntax
strategy.risk.max_cons_loss_days(count) \u2192 void
Arguments
count (float) A required parameter. The allowed number of consecutive days with losses.
Example
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...
", + "description": "The purpose of this rule is to cancel all pending orders, close all open positions and stop placing orders after a specified number of consecutive days with losses. The rule affects the whole strategy.", + "arguments": [ + { + "argument": "count", + "type": "float" + } + ], + "syntax": "strategy.risk.max_cons_loss_days(count) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.risk.max_drawdown()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_strategy.risk.max_drawdown", + "fragment": "fun_strategy.risk.max_drawdown", + "info": "

strategy.risk.max_drawdown()

The purpose of this rule is to determine maximum drawdown. The rule affects the whole strategy. Once the maximum drawdown value is reached, all pending orders are cancelled, all open positions are closed and no new orders can be placed.
Syntax
strategy.risk.max_drawdown(value, type) \u2192 void
Arguments
value (float) A required parameter. The maximum drawdown value. It is specified either in money (base currency), or in percentage of maximum equity. For % of equity the range of allowed values is from 0 to 100.
type (string) A required parameter. The type of the value. Please specify one of the following values: strategy.percent_of_equity or strategy.cash. Note: if equity drops down to zero or to a negative and the 'strategy.percent_of_equity' is specified, all pending orders are cancelled, all open positions are closed and no new orders can be placed for good.
Example
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...\u00a0
", + "description": "The purpose of this rule is to determine maximum drawdown. The rule affects the whole strategy. Once the maximum drawdown value is reached, all pending orders are cancelled, all open positions are closed and no new orders can be placed.", + "arguments": [ + { + "argument": "value", + "type": "float" + }, + { + "argument": "type", + "type": "string" + } + ], + "syntax": "strategy.risk.max_drawdown(value, type) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.risk.max_intraday_filled_orders()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_strategy.risk.max_intraday_filled_orders", + "fragment": "fun_strategy.risk.max_intraday_filled_orders", + "info": "

strategy.risk.max_intraday_filled_orders()

The purpose of this rule is to determine maximum number of filled orders per 1 day (per 1 bar, if chart resolution is higher than 1 day). The rule affects the whole strategy. Once the maximum number of filled orders is reached, all pending orders are cancelled, all open positions are closed and no new orders can be placed till the end of the current trading session.
Syntax
strategy.risk.max_intraday_filled_orders(count) \u2192 void
Arguments
count (float) A required parameter. The maximum number of filled orders per 1 day.
Example
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)
", + "description": "The purpose of this rule is to determine maximum number of filled orders per 1 day (per 1 bar, if chart resolution is higher than 1 day). The rule affects the whole strategy. Once the maximum number of filled orders is reached, all pending orders are cancelled, all open positions are closed and no new orders can be placed till the end of the current trading session.", + "arguments": [ + { + "argument": "count", + "type": "float" + } + ], + "syntax": "strategy.risk.max_intraday_filled_orders(count) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.risk.max_intraday_loss()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_strategy.risk.max_intraday_loss", + "fragment": "fun_strategy.risk.max_intraday_loss", + "info": "

strategy.risk.max_intraday_loss()

The purpose of this rule is to determine maximum loss per 1 day (per 1 bar, if chart resolution is higher than 1 day). The rule affects the whole strategy. Once the maximum loss value is reached, all pending orders are cancelled, all open positions are closed and no new orders can be placed till the end of the current trading session.
Syntax
strategy.risk.max_intraday_loss(value, type) \u2192 void
Arguments
value (float) A required parameter. The maximum loss value. It is specified either in money (base currency), or in percentage of maximum intraday equity. For % of equity the range of allowed values is from 0 to 1 (where 1 = 100%).
type (string) A required parameter. The type of the value. Please specify one of the following values: strategy.percent_of_equity or strategy.cash. Note: if equity drops down to zero or to a negative and the strategy.percent_of_equity is specified, all pending orders are cancelled, all open positions are closed and no new orders can be placed for good.
Example
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...\u00a0
", + "description": "The purpose of this rule is to determine maximum loss per 1 day (per 1 bar, if chart resolution is higher than 1 day). The rule affects the whole strategy. Once the maximum loss value is reached, all pending orders are cancelled, all open positions are closed and no new orders can be placed till the end of the current trading session.", + "arguments": [ + { + "argument": "value", + "type": "float" + }, + { + "argument": "type", + "type": "string" + } + ], + "syntax": "strategy.risk.max_intraday_loss(value, type) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.risk.max_position_size()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_strategy.risk.max_position_size", + "fragment": "fun_strategy.risk.max_position_size", + "info": "

strategy.risk.max_position_size()

The purpose of this rule is to determine maximum size of a market position. The rule affects the following function: strategy.entry. The 'entry' quantity can be reduced (if needed) to such number of contracts/shares/lots/units, so the total position size doesn't exceed the value specified in 'strategy.risk.max_position_size'. If minimum possible quantity still violates the rule, the order will not be placed.
Syntax
strategy.risk.max_position_size(contracts) \u2192 void
Arguments
contracts (float) A required parameter. Maximum number of contracts/shares/lots/units in a position.
Example
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\u00a010
", + "description": "The purpose of this rule is to determine maximum size of a market position. The rule affects the following function: strategy.entry. The 'entry' quantity can be reduced (if needed) to such number of contracts/shares/lots/units, so the total position size doesn't exceed the value specified in 'strategy.risk.max_position_size'. If minimum possible quantity still violates the rule, the order will not be placed.", + "arguments": [ + { + "argument": "contracts", + "type": "float" + } + ], + "syntax": "strategy.risk.max_position_size(contracts) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "study()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_study", + "fragment": "fun_study", + "info": "

study()

The function sets a number of study properties.
Syntax
study(title, shorttitle, overlay, precision, scale, max_bars_back) \u2192 void
Arguments
title (const string) study title that would be seen in Indicators widget. Argument IS REQUIRED.
shorttitle (const string) study short title that would be seen in the chart legend. Argument is optional.
overlay (const bool) if true the study will be added as an overlay for the main series. If false - it would be added on a separate chart pane. Default is false.
precision (const integer) number of digits after the floating point for study values on the price axis. Must be a non negative integer and not greater than 16. Precision 0 has special rules for formatting very large numbers (like volume, e.g. '5183' will be formatted as '5.183K'). Default value is 4.
scale (const integer) price scale that the indicator should be attached to. Possible values are: scale.right, scale.left, scale.none. Value scale.none can be applied only in combination with 'overlay=true' setting. If omitted, using scale from main series.
max_bars_back (const integer) Maximum number of bars that is available for the study for historical reference. The default value is calculated automatically and can be changed manually. If the study requires a value greater than the manually specified one, last one will be ignored and the study will calculate the value automatically.
linktoseries (const bool) if true then the study will be always on the same pane and same price scale as the main series. Should be used only in combination with 'overlay=true'. Default is false.
Example
study(title='MyScriptStudy')
study(title=\"MyScriptStudy\",\u00a0shorttitle=\"MSS\",\u00a0precision=6,\u00a0overlay=true)
Remarks
Every script must have one study call.
", + "description": "The function sets a number of study properties.", + "arguments": [ + { + "argument": "title", + "type": "const string" + }, + { + "argument": "shorttitle", + "type": "const string" + }, + { + "argument": "overlay", + "type": "const bool" + }, + { + "argument": "precision", + "type": "const integer" + }, + { + "argument": "scale", + "type": "const integer" + }, + { + "argument": "max_bars_back", + "type": "const integer" + }, + { + "argument": "linktoseries", + "type": "const bool" + } + ], + "syntax": "study(title, shorttitle, overlay, precision, scale, max_bars_back) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "sum()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_sum", + "fragment": "fun_sum", + "info": "

sum()

The sum function returns the sliding sum of last y values of x.
Syntax
sum(source, length) \u2192 series
Arguments
source (series) Series of values to process.
length (integer) Number of bars (length).
See also
", + "description": "The sum function returns the sliding sum of last y values of x.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "sum(source, length) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "swma()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_swma", + "fragment": "fun_swma", + "info": "

swma()

Symmetrically weighted moving average with fixed length: 4. Weights: [1/6, 2/6, 2/6, 1/6].
Syntax
swma(x) \u2192 series
Arguments
x (series) Source series.
Example
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))
See also
", + "description": "Symmetrically weighted moving average with fixed length: 4. Weights: [1/6, 2/6, 2/6, 1/6].", + "arguments": [ + { + "argument": "x", + "type": "series" + } + ], + "syntax": "swma(x) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "tan()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_tan", + "fragment": "fun_tan", + "info": "

tan()

The tan function returns the trigonometric tangent of an angle.
Syntax
tan(x) \u2192 float
tan(x) \u2192 const float
tan(x) \u2192 series
Arguments
x (series) Angle, in radians.
", + "description": "The tan function returns the trigonometric tangent of an angle.", + "arguments": [ + { + "argument": "x", + "type": "series" + } + ], + "syntax": "tan(x) \u2192 float", + "returnType": "float", + "returns": "" + }, + { + "name": "tickerid()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_tickerid", + "fragment": "fun_tickerid", + "info": "

tickerid()

Creates a ticker identifier for requesting additional data for the script.
Syntax
tickerid(prefix, ticker, session, adjustment) \u2192 string
Arguments
prefix (string) Exchange prefix. For example: 'BATS', 'NYSE', 'NASDAQ'. Exchange prefix of main series is syminfo.prefix.
ticker (string) Ticker name. For example 'AAPL', 'MSFT', 'EURUSD'. Ticker name of the main series is ticker.
session (string) Session type. Optional argument. Possible values: session.regular, session.extended. Session type of the current chart is syminfo.session. If session is not given, then syminfo.session value is used.
adjustment (string) Adjustment type. Optional argument. Possible values: adjustment.none, adjustment.splits, adjustment.dividends. If adjustment is not given, then default adjustment value is used (can be different depending on particular instrument).
Example
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)
Remarks
You may use return value of tickerid function as input argument for heikinashi, renko, linebreak, kagi, pointfigure functions.
See also
", + "description": "Creates a ticker identifier for requesting additional data for the script.", + "arguments": [ + { + "argument": "prefix", + "type": "string" + }, + { + "argument": "ticker", + "type": "string" + }, + { + "argument": "session", + "type": "string" + }, + { + "argument": "adjustment", + "type": "string" + } + ], + "syntax": "tickerid(prefix, ticker, session, adjustment) \u2192 string", + "returnType": "string", + "returns": "" + }, + { + "name": "time()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_time", + "fragment": "fun_time", + "info": "

time()

Function time returns UNIX time of current bar for the specified resolution and session or NaN if time point is out-of-session.
Syntax
time(resolution, session) \u2192 series
time(resolution) \u2192 series
Arguments
resolution (string) Resolution. An empty string is interpreted as the current resolution of the chart.
session (string) Session specification. Optional argument, session of the symbol used by default.
Example
//@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\"))
While setting up a session you can specify not just the hours and minutes but also the days of the week that will be included in that session.
If the days aren't specified, the session is considered to have been set from Monday to Friday (Saturday and Sunday are excluded as the weekend days), i.e. \"1100-2000\" is the same as \"1100-1200:23456\".
For example, on a symbol that is traded seven days a week with the 24-hour trading session the following script will not color Saturdays and Sundays:
Example
//@version=3
study(\"Time\",\u00a0overlay=true)
t1\u00a0=\u00a0time(period,\u00a0\"0000-0000\")
bgcolor(t1\u00a0?\u00a0blue\u00a0:\u00a0na)
You can change that by specifying the days:
Example
//@version=3
study(\"Time\u00a0-\u00a0days\",\u00a0overlay=true)
t1\u00a0=\u00a0time(period,\u00a0\"0000-0000:1234567\")
bgcolor(t1\u00a0?\u00a0green\u00a0:\u00a0na)
Remarks
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.
See also
", + "description": "Function time returns UNIX time of current bar for the specified resolution and session or NaN if time point is out-of-session.", + "arguments": [ + { + "argument": "resolution", + "type": "string" + }, + { + "argument": "session", + "type": "string" + } + ], + "syntax": "time(resolution, session) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "timestamp()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_timestamp", + "fragment": "fun_timestamp", + "info": "

timestamp()

Function timestamp returns UNIX time of specified date and time.
Syntax
timestamp(year, month, day, hour, minute, second) \u2192 integer
timestamp(timezone, year, month, day, hour, minute, second) \u2192 integer
Arguments
timezone (string) (Optional argument) Timezone
year (integer) Year.
month (integer) Month.
day (integer) Day.
hour (integer) Hour
minute (integer) Minute.
second (integer) (Optional argument) Second. Default is 0.
Example
//@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))
Remarks
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970. By default Timezone is syminfo.timezone, but it can be specified by GMT-notation (e.g \"GMT-5\", \"GMT+5\", \"GMT+5:30\", etc), or one of following values:
\"America/New_York\"
\"America/Los_Angeles\"
\"America/Chicago\"
\"America/Phoenix\"
\"America/Toronto\"
\"America/Vancouver\"
\"America/Argentina/Buenos_Aires\"
\"America/El_Salvador\"
\"America/Sao_Paulo\"
\"America/Bogota\"
\"Europe/Moscow\"
\"Europe/Athens\"
\"Europe/Berlin\"
\"Europe/London\"
\"Europe/Madrid\"
\"Europe/Paris\"
\"Europe/Warsaw\"
\"Australia/Sydney\"
\"Australia/Brisbane\"
\"Australia/Adelaide\"
\"Australia/ACT\"
\"Asia/Almaty\"
\"Asia/Ashkhabad\"
\"Asia/Tokyo\"
\"Asia/Taipei\"
\"Asia/Singapore\"
\"Asia/Shanghai\"
\"Asia/Seoul\"
\"Asia/Tehran\"
\"Asia/Dubai\"
\"Asia/Kolkata\"
\"Asia/Hong_Kong\"
\"Asia/Bangkok\"
\"Pacific/Auckland\"
\"Pacific/Chatham\"
\"Pacific/Fakaofo\"
\"Pacific/Honolulu\"
See also
", + "description": "Function timestamp returns UNIX time of specified date and time.", + "arguments": [ + { + "argument": "timezone", + "type": "string" + }, + { + "argument": "year", + "type": "integer" + }, + { + "argument": "month", + "type": "integer" + }, + { + "argument": "day", + "type": "integer" + }, + { + "argument": "hour", + "type": "integer" + }, + { + "argument": "minute", + "type": "integer" + }, + { + "argument": "second", + "type": "integer" + } + ], + "syntax": "timestamp(year, month, day, hour, minute, second) \u2192 integer", + "returnType": "integer", + "returns": "" + }, + { + "name": "tostring()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_tostring", + "fragment": "fun_tostring", + "info": "

tostring()

Syntax
tostring(x) \u2192 string
tostring(x, y) \u2192 string
Arguments
x (float) Number that should be converted to string.
y (string) Format string. Optional argument, default value is '#.##########'.
Remarks
To display trailing zeros use 0 instead of a '#' symbol. For example, '#.000'.
", + "description": "", + "arguments": [ + { + "argument": "x", + "type": "float" + }, + { + "argument": "y", + "type": "string" + } + ], + "syntax": "tostring(x) \u2192 string", + "returnType": "string", + "returns": "" + }, + { + "name": "tr()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_tr", + "fragment": "fun_tr", + "info": "

tr()

Syntax
tr(handle_na) \u2192 series
Arguments
handle_na (bool) How NaN values are handled. if true, and previous day's close is NaN then tr would be calculated as current day high-low. Otherwise (if false) tr would return NaN in such cases. Also note, that atr uses tr(true).
Remarks
tr(false) is exactly the same as tr.
See also
", + "description": "", + "arguments": [ + { + "argument": "handle_na", + "type": "bool" + } + ], + "syntax": "tr(handle_na) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "tsi()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_tsi", + "fragment": "fun_tsi", + "info": "

tsi()

True strength index. It uses moving averages of the underlying momentum of a financial instrument.
Syntax
tsi(source, short_length, long_length) \u2192 series
Arguments
source (series) Source series.
short_length (integer) Short length.
long_length (integer) Long length.
", + "description": "True strength index. It uses moving averages of the underlying momentum of a financial instrument.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "short_length", + "type": "integer" + }, + { + "argument": "long_length", + "type": "integer" + } + ], + "syntax": "tsi(source, short_length, long_length) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "valuewhen()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_valuewhen", + "fragment": "fun_valuewhen", + "info": "

valuewhen()

Source series value when the condition was true on the n-th most recent occurrence.
Syntax
valuewhen(condition, source, occurrence) \u2192 series
Example
slow\u00a0=\u00a0sma(close,\u00a07)
fast\u00a0=\u00a0sma(close,\u00a014)
//\u00a0get\u00a0value\u00a0of\u00a0close\u00a0on\u00a0second\u00a0cross\u00a0occurrence
valuewhen(cross(slow,\u00a0fast),\u00a0close,\u00a01)
Remarks
Please note that using this variable/function can cause indicator repainting.
See also
", + "description": "Source series value when the condition was true on the n-th most recent occurrence.", + "arguments": [], + "syntax": "valuewhen(condition, source, occurrence) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "variance()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_variance", + "fragment": "fun_variance", + "info": "

variance()

Variance is the expectation of the squared deviation of a series from its mean (sma), and it informally measures how far a set of numbers are spread out from their mean.
Syntax
variance(source, length) \u2192 series
Arguments
source (series) Series of values to process.
length (integer) Number of bars (length).
Remarks
This is a biased estimation of sample variance.
See also
", + "description": "Variance is the expectation of the squared deviation of a series from its mean (sma), and it informally measures how far a set of numbers are spread out from their mean.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "variance(source, length) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "vwap()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_vwap", + "fragment": "fun_vwap", + "info": "

vwap()

Volume weighted average price.
Syntax
vwap(x) \u2192 series
Arguments
x (series) Source series.
See also
", + "description": "Volume weighted average price.", + "arguments": [ + { + "argument": "x", + "type": "series" + } + ], + "syntax": "vwap(x) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "vwma()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_vwma", + "fragment": "fun_vwma", + "info": "

vwma()

The vwma function returns volume-weighted moving average of x for y bars back. It is the same as: sma(x * volume, y) / sma(volume, y)
Syntax
vwma(source, length) \u2192 series
Arguments
source (series) Series of values to process.
length (integer) Number of bars (length).
Example
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))
See also
", + "description": "The vwma function returns volume-weighted moving average of x for y bars back. It is the same as: sma(x * volume, y) / sma(volume, y)", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "vwma(source, length) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "weekofyear()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_weekofyear", + "fragment": "fun_weekofyear", + "info": "

weekofyear()

Syntax
weekofyear(time) \u2192 series
Arguments
time (series) UNIX time in milliseconds.
Remarks
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.
See also
", + "description": "", + "arguments": [ + { + "argument": "time", + "type": "series" + } + ], + "syntax": "weekofyear(time) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "wma()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_wma", + "fragment": "fun_wma", + "info": "

wma()

The wma function returns weighted moving average of x for y bars back. In wma weighting factors decrease in arithmetical progression.
Syntax
wma(source, length) \u2192 series
Arguments
source (series) Series of values to process.
length (integer) Number of bars (length).
Example
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))
See also
", + "description": "The wma function returns weighted moving average of x for y bars back. In wma weighting factors decrease in arithmetical progression.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "wma(source, length) \u2192 series", + "returnType": "series", + "returns": "" + }, + { + "name": "year()", + "url": "https://www.tradingview.com/pine-script-reference/v3/#fun_year", + "fragment": "fun_year", + "info": "

year()

Syntax
year(time) \u2192 series
Arguments
time (series) UNIX time in milliseconds.
Remarks
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.
See also
", + "description": "", + "arguments": [ + { + "argument": "time", + "type": "series" + } + ], + "syntax": "year(time) \u2192 series", + "returnType": "series", + "returns": "" + } +] \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/definitions/v3/keywords.json b/pine-script-intellij-plugin/bin/main/definitions/v3/keywords.json new file mode 100644 index 0000000..15f4cde --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/definitions/v3/keywords.json @@ -0,0 +1,22 @@ +[ + { + "name": "and", + "url": "https://www.tradingview.com/pine-script-reference/v3/#kw_and" + }, + { + "name": "for", + "url": "https://www.tradingview.com/pine-script-reference/v3/#kw_for" + }, + { + "name": "if", + "url": "https://www.tradingview.com/pine-script-reference/v3/#kw_if" + }, + { + "name": "not", + "url": "https://www.tradingview.com/pine-script-reference/v3/#kw_not" + }, + { + "name": "or", + "url": "https://www.tradingview.com/pine-script-reference/v3/#kw_or" + } +] \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/definitions/v3/operators.json b/pine-script-intellij-plugin/bin/main/definitions/v3/operators.json new file mode 100644 index 0000000..37fd58f --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/definitions/v3/operators.json @@ -0,0 +1,54 @@ +[ + { + "name": "-", + "url": "https://www.tradingview.com/pine-script-reference/v3/#op_-" + }, + { + "name": "!=", + "url": "https://www.tradingview.com/pine-script-reference/v3/#op_!=" + }, + { + "name": "?:", + "url": "https://www.tradingview.com/pine-script-reference/v3/#op_?:" + }, + { + "name": "[]", + "url": "https://www.tradingview.com/pine-script-reference/v3/#op_[]" + }, + { + "name": "*", + "url": "https://www.tradingview.com/pine-script-reference/v3/#op_*" + }, + { + "name": "/", + "url": "https://www.tradingview.com/pine-script-reference/v3/#op_/" + }, + { + "name": "%", + "url": "https://www.tradingview.com/pine-script-reference/v3/#op_%" + }, + { + "name": "+", + "url": "https://www.tradingview.com/pine-script-reference/v3/#op_+" + }, + { + "name": "<", + "url": "https://www.tradingview.com/pine-script-reference/v3/#op_<" + }, + { + "name": "<=", + "url": "https://www.tradingview.com/pine-script-reference/v3/#op_<=" + }, + { + "name": "==", + "url": "https://www.tradingview.com/pine-script-reference/v3/#op_==" + }, + { + "name": ">", + "url": "https://www.tradingview.com/pine-script-reference/v3/#op_>" + }, + { + "name": ">=", + "url": "https://www.tradingview.com/pine-script-reference/v3/#op_>=" + } +] \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/definitions/v3/types.json b/pine-script-intellij-plugin/bin/main/definitions/v3/types.json new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/definitions/v3/types.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/definitions/v3/variables.json b/pine-script-intellij-plugin/bin/main/definitions/v3/variables.json new file mode 100644 index 0000000..459facb --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/definitions/v3/variables.json @@ -0,0 +1,616 @@ +[ + { + "name": "accdist", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_accdist", + "fragment": "var_accdist", + "info": "

accdist

Accumulation/distribution index.
Type
series
", + "description": "Accumulation/distribution index.", + "type": "series", + "remarks": "" + }, + { + "name": "barstate.isconfirmed", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_barstate.isconfirmed", + "fragment": "var_barstate.isconfirmed", + "info": "

barstate.isconfirmed

Returns true if the script is calculating the last (closing) update of the current bar. The next script calculation will be on the new bar data.
Type
series[bool]
Remarks
PineScript code that uses this variable could calculate differently on history and real-time data.
It is NOT recommended to use barstate.isconfirmed in security expression. Its value requested from security is unpredictable.
Please note that using this variable/function can cause indicator repainting.
See also
", + "description": "Returns true if the script is calculating the last (closing) update of the current bar. The next script calculation will be on the new bar data.", + "type": "series[bool]", + "remarks": [ + "PineScript code that uses this variable could calculate differently on history and real-time data.", + "It is NOT recommended to use barstate.isconfirmed in security expression. Its value requested from security is unpredictable.", + "Please note that using this variable/function can cause indicator repainting." + ] + }, + { + "name": "barstate.isfirst", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_barstate.isfirst", + "fragment": "var_barstate.isfirst", + "info": "

barstate.isfirst

Returns true if current bar is first bar in barset, false otherwise.
Type
series[bool]
Remarks
PineScript code that uses this variable could calculate differently on history and real-time data.
Please note that using this variable/function can cause indicator repainting.
See also
", + "description": "Returns true if current bar is first bar in barset, false otherwise.", + "type": "series[bool]", + "remarks": [ + "PineScript code that uses this variable could calculate differently on history and real-time data.", + "Please note that using this variable/function can cause indicator repainting." + ] + }, + { + "name": "barstate.ishistory", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_barstate.ishistory", + "fragment": "var_barstate.ishistory", + "info": "

barstate.ishistory

Returns true if current bar is a historical bar, false otherwise.
Type
series[bool]
Remarks
PineScript code that uses this variable could calculate differently on history and real-time data.
Please note that using this variable/function can cause indicator repainting.
See also
", + "description": "Returns true if current bar is a historical bar, false otherwise.", + "type": "series[bool]", + "remarks": [ + "PineScript code that uses this variable could calculate differently on history and real-time data.", + "Please note that using this variable/function can cause indicator repainting." + ] + }, + { + "name": "barstate.islast", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_barstate.islast", + "fragment": "var_barstate.islast", + "info": "

barstate.islast

Returns true if current bar is the last bar in barset, false otherwise. This condition is true for all real-time bars in barset.
Type
series[bool]
Remarks
PineScript code that uses this variable could calculate differently on history and real-time data.
Please note that using this variable/function can cause indicator repainting.
See also
", + "description": "Returns true if current bar is the last bar in barset, false otherwise. This condition is true for all real-time bars in barset.", + "type": "series[bool]", + "remarks": [ + "PineScript code that uses this variable could calculate differently on history and real-time data.", + "Please note that using this variable/function can cause indicator repainting." + ] + }, + { + "name": "barstate.isnew", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_barstate.isnew", + "fragment": "var_barstate.isnew", + "info": "

barstate.isnew

Returns true if script is currently calculating on new bar, false otherwise. This variable is true when calculating on historical bars or on first update of a newly generated real-time bar.
Type
series[bool]
Remarks
PineScript code that uses this variable could calculate differently on history and real-time data.
Please note that using this variable/function can cause indicator repainting.
See also
", + "description": "Returns true if script is currently calculating on new bar, false otherwise. This variable is true when calculating on historical bars or on first update of a newly generated real-time bar.", + "type": "series[bool]", + "remarks": [ + "PineScript code that uses this variable could calculate differently on history and real-time data.", + "Please note that using this variable/function can cause indicator repainting." + ] + }, + { + "name": "barstate.isrealtime", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_barstate.isrealtime", + "fragment": "var_barstate.isrealtime", + "info": "

barstate.isrealtime

Returns true if current bar is a real-time bar, false otherwise.
Type
series[bool]
Remarks
PineScript code that uses this variable could calculate differently on history and real-time data.
Please note that using this variable/function can cause indicator repainting.
See also
", + "description": "Returns true if current bar is a real-time bar, false otherwise.", + "type": "series[bool]", + "remarks": [ + "PineScript code that uses this variable could calculate differently on history and real-time data.", + "Please note that using this variable/function can cause indicator repainting." + ] + }, + { + "name": "close", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_close", + "fragment": "var_close", + "info": "

close

Current close price.
Type
series
Remarks
Previous values may be accessed with square brackets operator [], e.g. close[1], close[2].
See also
", + "description": "Current close price.", + "type": "series", + "remarks": [ + "Previous values may be accessed with square brackets operator [], e.g. close[1], close[2]." + ] + }, + { + "name": "dayofmonth", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_dayofmonth", + "fragment": "var_dayofmonth", + "info": "

dayofmonth

Date of current bar time in exchange timezone.
Type
series
See also
", + "description": "Date of current bar time in exchange timezone.", + "type": "series", + "remarks": "" + }, + { + "name": "dayofweek", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_dayofweek", + "fragment": "var_dayofweek", + "info": "

dayofweek

Day of week for current bar time in exchange timezone.
Type
series
Remarks
You can use sunday, monday, tuesday, wednesday, thursday, friday and saturday variables for comparsions.
See also
", + "description": "Day of week for current bar time in exchange timezone.", + "type": "series", + "remarks": [ + "You can use sunday, monday, tuesday, wednesday, thursday, friday and saturday variables for comparsions." + ] + }, + { + "name": "high", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_high", + "fragment": "var_high", + "info": "

high

Current high price.
Type
series
Remarks
Previous values may be accessed with square brackets operator [], e.g. high[1], high[2].
See also
", + "description": "Current high price.", + "type": "series", + "remarks": [ + "Previous values may be accessed with square brackets operator [], e.g. high[1], high[2]." + ] + }, + { + "name": "hl2", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_hl2", + "fragment": "var_hl2", + "info": "

hl2

Is a shortcut for (high + low)/2
Type
series
See also
", + "description": "Is a shortcut for (high + low)/2", + "type": "series", + "remarks": "" + }, + { + "name": "hlc3", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_hlc3", + "fragment": "var_hlc3", + "info": "

hlc3

Is a shortcut for (high + low + close)/3
Type
series
See also
", + "description": "Is a shortcut for (high + low + close)/3", + "type": "series", + "remarks": "" + }, + { + "name": "hour", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_hour", + "fragment": "var_hour", + "info": "

hour

Current bar hour in exchange timezone.
Type
series
See also
", + "description": "Current bar hour in exchange timezone.", + "type": "series", + "remarks": "" + }, + { + "name": "interval", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_interval", + "fragment": "var_interval", + "info": "

interval

Multiplier of resolution, e.g. '60' - 60, 'D' - 1, '5D' - 5, '12M' - 12.
Type
integer
See also
", + "description": "Multiplier of resolution, e.g. '60' - 60, 'D' - 1, '5D' - 5, '12M' - 12.", + "type": "integer", + "remarks": "" + }, + { + "name": "isdaily", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_isdaily", + "fragment": "var_isdaily", + "info": "

isdaily

Returns true if current resolution is a daily resolution, false otherwise.
Type
bool
See also
", + "description": "Returns true if current resolution is a daily resolution, false otherwise.", + "type": "bool", + "remarks": "" + }, + { + "name": "isdwm", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_isdwm", + "fragment": "var_isdwm", + "info": "

isdwm

Returns true if current resolution is a daily or weekly or monthly resolution, false otherwise.
Type
bool
See also
", + "description": "Returns true if current resolution is a daily or weekly or monthly resolution, false otherwise.", + "type": "bool", + "remarks": "" + }, + { + "name": "isintraday", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_isintraday", + "fragment": "var_isintraday", + "info": "

isintraday

Returns true if current resolution is a intraday resolution, false otherwise.
Type
bool
See also
", + "description": "Returns true if current resolution is a intraday resolution, false otherwise.", + "type": "bool", + "remarks": "" + }, + { + "name": "isminutes", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_isminutes", + "fragment": "var_isminutes", + "info": "

isminutes

Returns true if current resolution is a minutes resolution, false otherwise.
Type
bool
See also
", + "description": "Returns true if current resolution is a minutes resolution, false otherwise.", + "type": "bool", + "remarks": "" + }, + { + "name": "ismonthly", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_ismonthly", + "fragment": "var_ismonthly", + "info": "

ismonthly

Returns true if current resolution is a monthly resolution, false otherwise.
Type
bool
See also
", + "description": "Returns true if current resolution is a monthly resolution, false otherwise.", + "type": "bool", + "remarks": "" + }, + { + "name": "isseconds", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_isseconds", + "fragment": "var_isseconds", + "info": "

isseconds

Returns true if current resolution is a seconds resolution, false otherwise.
Type
bool
See also
", + "description": "Returns true if current resolution is a seconds resolution, false otherwise.", + "type": "bool", + "remarks": "" + }, + { + "name": "isweekly", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_isweekly", + "fragment": "var_isweekly", + "info": "

isweekly

Returns true if current resolution is a weekly resolution, false otherwise.
Type
bool
See also
", + "description": "Returns true if current resolution is a weekly resolution, false otherwise.", + "type": "bool", + "remarks": "" + }, + { + "name": "low", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_low", + "fragment": "var_low", + "info": "

low

Current low price.
Type
series
Remarks
Previous values may be accessed with square brackets operator [], e.g. low[1], low[2].
See also
", + "description": "Current low price.", + "type": "series", + "remarks": [ + "Previous values may be accessed with square brackets operator [], e.g. low[1], low[2]." + ] + }, + { + "name": "minute", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_minute", + "fragment": "var_minute", + "info": "

minute

Current bar minute in exchange timezone.
Type
series
See also
", + "description": "Current bar minute in exchange timezone.", + "type": "series", + "remarks": "" + }, + { + "name": "month", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_month", + "fragment": "var_month", + "info": "

month

Current bar month in exchange timezone.
Type
series
See also
", + "description": "Current bar month in exchange timezone.", + "type": "series", + "remarks": "" + }, + { + "name": "n", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_n", + "fragment": "var_n", + "info": "

n

Current bar index. Numbering is zero-based, index of the first bar is 0.
Type
series
Example
plot(n)
plot(n\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)
Remarks
Note that bar indexing starts from 0, so for the first historical bar n==0.
Please note that using this variable/function can cause indicator repainting.
", + "description": "Current bar index. Numbering is zero-based, index of the first bar is 0.", + "type": "series", + "remarks": [ + "Note that bar indexing starts from 0, so for the first historical bar n==0.", + "Please note that using this variable/function can cause indicator repainting." + ] + }, + { + "name": "na", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_na", + "fragment": "var_na", + "info": "

na

Double.NaN value (Not a Number).
Type
na
Example
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//\u00a0CORRECT
Remarks
Use it for return values ONLY. DON'T TRY TO COMPARE WITH IT! If you need to check if some value is NaN, use built-in function na.
See also
", + "description": "Double.NaN value (Not a Number).", + "type": "na", + "remarks": [ + "Use it for return values ONLY. DON'T TRY TO COMPARE WITH IT! If you need to check if some value is NaN, use built-in function na." + ] + }, + { + "name": "ohlc4", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_ohlc4", + "fragment": "var_ohlc4", + "info": "

ohlc4

Is a shortcut for (open + high + low + close)/4
Type
series
See also
", + "description": "Is a shortcut for (open + high + low + close)/4", + "type": "series", + "remarks": "" + }, + { + "name": "open", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_open", + "fragment": "var_open", + "info": "

open

Current open price.
Type
series
Remarks
Previous values may be accessed with square brackets operator [], e.g. open[1], open[2].
See also
", + "description": "Current open price.", + "type": "series", + "remarks": [ + "Previous values may be accessed with square brackets operator [], e.g. open[1], open[2]." + ] + }, + { + "name": "period", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_period", + "fragment": "var_period", + "info": "

period

Resolution, e.g. '60' - 60 minutes, 'D' - daily, 'W' - weekly, 'M' - monthly, '5D' - 5 days, '12M' - one year, '3M' - one quarter.
Type
string
See also
", + "description": "Resolution, e.g. '60' - 60 minutes, 'D' - daily, 'W' - weekly, 'M' - monthly, '5D' - 5 days, '12M' - one year, '3M' - one quarter.", + "type": "string", + "remarks": "" + }, + { + "name": "second", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_second", + "fragment": "var_second", + "info": "

second

Current bar second in exchange timezone.
Type
series
See also
", + "description": "Current bar second in exchange timezone.", + "type": "series", + "remarks": "" + }, + { + "name": "strategy.closedtrades", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_strategy.closedtrades", + "fragment": "var_strategy.closedtrades", + "info": "

strategy.closedtrades

Number of trades, which were closed for the whole trading interval.
Type
series[integer]
See also
", + "description": "Number of trades, which were closed for the whole trading interval.", + "type": "series[integer]", + "remarks": "" + }, + { + "name": "strategy.equity", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_strategy.equity", + "fragment": "var_strategy.equity", + "info": "", + "description": "Current equity ( strategy.initial_capital + strategy.netprofit + strategy.openprofit ).", + "type": "series", + "remarks": "" + }, + { + "name": "strategy.eventrades", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_strategy.eventrades", + "fragment": "var_strategy.eventrades", + "info": "

strategy.eventrades

Number of breakeven trades for the whole trading interval.
Type
series[integer]
See also
", + "description": "Number of breakeven trades for the whole trading interval.", + "type": "series[integer]", + "remarks": "" + }, + { + "name": "strategy.grossloss", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_strategy.grossloss", + "fragment": "var_strategy.grossloss", + "info": "

strategy.grossloss

Total currency value of all completed losing trades.
Type
series
See also
", + "description": "Total currency value of all completed losing trades.", + "type": "series", + "remarks": "" + }, + { + "name": "strategy.grossprofit", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_strategy.grossprofit", + "fragment": "var_strategy.grossprofit", + "info": "

strategy.grossprofit

Total currency value of all completed winning trades.
Type
series
See also
", + "description": "Total currency value of all completed winning trades.", + "type": "series", + "remarks": "" + }, + { + "name": "strategy.initial_capital", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_strategy.initial_capital", + "fragment": "var_strategy.initial_capital", + "info": "

strategy.initial_capital

The amount of initial capital set in the strategy properties.
Type
series
See also
", + "description": "The amount of initial capital set in the strategy properties.", + "type": "series", + "remarks": "" + }, + { + "name": "strategy.losstrades", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_strategy.losstrades", + "fragment": "var_strategy.losstrades", + "info": "

strategy.losstrades

Number of unprofitable trades for the whole trading interval.
Type
series[integer]
See also
", + "description": "Number of unprofitable trades for the whole trading interval.", + "type": "series[integer]", + "remarks": "" + }, + { + "name": "strategy.max_contracts_held_all", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_strategy.max_contracts_held_all", + "fragment": "var_strategy.max_contracts_held_all", + "info": "

strategy.max_contracts_held_all

Maximum number of contracts/shares/lots/units in one trade for the whole trading interval.
Type
series
See also
", + "description": "Maximum number of contracts/shares/lots/units in one trade for the whole trading interval.", + "type": "series", + "remarks": "" + }, + { + "name": "strategy.max_contracts_held_long", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_strategy.max_contracts_held_long", + "fragment": "var_strategy.max_contracts_held_long", + "info": "

strategy.max_contracts_held_long

Maximum number of contracts/shares/lots/units in one long trade for the whole trading interval.
Type
series
See also
", + "description": "Maximum number of contracts/shares/lots/units in one long trade for the whole trading interval.", + "type": "series", + "remarks": "" + }, + { + "name": "strategy.max_contracts_held_short", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_strategy.max_contracts_held_short", + "fragment": "var_strategy.max_contracts_held_short", + "info": "

strategy.max_contracts_held_short

Maximum number of contracts/shares/lots/units in one short trade for the whole trading interval.
Type
series
See also
", + "description": "Maximum number of contracts/shares/lots/units in one short trade for the whole trading interval.", + "type": "series", + "remarks": "" + }, + { + "name": "strategy.max_drawdown", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_strategy.max_drawdown", + "fragment": "var_strategy.max_drawdown", + "info": "

strategy.max_drawdown

Maximum equity drawdown value for the whole trading interval.
Type
series
See also
", + "description": "Maximum equity drawdown value for the whole trading interval.", + "type": "series", + "remarks": "" + }, + { + "name": "strategy.netprofit", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_strategy.netprofit", + "fragment": "var_strategy.netprofit", + "info": "

strategy.netprofit

Total currency value of all completed trades.
Type
series
See also
", + "description": "Total currency value of all completed trades.", + "type": "series", + "remarks": "" + }, + { + "name": "strategy.openprofit", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_strategy.openprofit", + "fragment": "var_strategy.openprofit", + "info": "

strategy.openprofit

Current unrealized profit or loss for the open position.
Type
series
See also
", + "description": "Current unrealized profit or loss for the open position.", + "type": "series", + "remarks": "" + }, + { + "name": "strategy.opentrades", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_strategy.opentrades", + "fragment": "var_strategy.opentrades", + "info": "

strategy.opentrades

Number of market position entries, which were not closed and remain opened. If there is no open market position, 0 is returned.
Type
series[integer]
See also
", + "description": "Number of market position entries, which were not closed and remain opened. If there is no open market position, 0 is returned.", + "type": "series[integer]", + "remarks": "" + }, + { + "name": "strategy.position_avg_price", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_strategy.position_avg_price", + "fragment": "var_strategy.position_avg_price", + "info": "

strategy.position_avg_price

Average entry price of current market position. If the market position is flat, 'NaN' is returned.
Type
series
See also
", + "description": "Average entry price of current market position. If the market position is flat, 'NaN' is returned.", + "type": "series", + "remarks": "" + }, + { + "name": "strategy.position_entry_name", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_strategy.position_entry_name", + "fragment": "var_strategy.position_entry_name", + "info": "

strategy.position_entry_name

Name of the order that initially opened current market position.
Type
string
See also
", + "description": "Name of the order that initially opened current market position.", + "type": "string", + "remarks": "" + }, + { + "name": "strategy.position_size", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_strategy.position_size", + "fragment": "var_strategy.position_size", + "info": "

strategy.position_size

Direction and size of the current market position. If the value is > 0, the market position is long. If the value is < 0, the market position is short. The absolute value is the number of contracts/shares/lots/units in trade (position size).
Type
series
See also
", + "description": "Direction and size of the current market position. If the value is > 0, the market position is long. If the value is < 0, the market position is short. The absolute value is the number of contracts/shares/lots/units in trade (position size).", + "type": "series", + "remarks": "" + }, + { + "name": "strategy.wintrades", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_strategy.wintrades", + "fragment": "var_strategy.wintrades", + "info": "

strategy.wintrades

Number of profitable trades for the whole trading interval.
Type
series[integer]
See also
", + "description": "Number of profitable trades for the whole trading interval.", + "type": "series[integer]", + "remarks": "" + }, + { + "name": "syminfo.mintick", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_syminfo.mintick", + "fragment": "var_syminfo.mintick", + "info": "

syminfo.mintick

Min tick value for the current symbol.
Type
series
See also
", + "description": "Min tick value for the current symbol.", + "type": "series", + "remarks": "" + }, + { + "name": "syminfo.pointvalue", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_syminfo.pointvalue", + "fragment": "var_syminfo.pointvalue", + "info": "

syminfo.pointvalue

Point value for the current symbol.
Type
series
See also
", + "description": "Point value for the current symbol.", + "type": "series", + "remarks": "" + }, + { + "name": "syminfo.prefix", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_syminfo.prefix", + "fragment": "var_syminfo.prefix", + "info": "

syminfo.prefix

Prefix of current symbol name (i.e. for 'CME_EOD:TICKER' prefix is 'CME_EOD').
Type
string
Example
If\u00a0current\u00a0chart\u00a0symbol\u00a0is\u00a0'BATS:MSFT'\u00a0then\u00a0syminfo.prefix\u00a0is\u00a0'BATS'.
See also
", + "description": "Prefix of current symbol name (i.e. for 'CME_EOD:TICKER' prefix is 'CME_EOD').", + "type": "string", + "remarks": "" + }, + { + "name": "syminfo.root", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_syminfo.root", + "fragment": "var_syminfo.root", + "info": "

syminfo.root

Root for derivates like futures contract. For other symbols returns the same value as ticker.
Type
string
Example
For\u00a0example\u00a0if\u00a0current\u00a0chart\u00a0ticker\u00a0is\u00a0'CLM2014',\u00a0would\u00a0return\u00a0'CL'.
See also
", + "description": "Root for derivates like futures contract. For other symbols returns the same value as ticker.", + "type": "string", + "remarks": "" + }, + { + "name": "syminfo.session", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_syminfo.session", + "fragment": "var_syminfo.session", + "info": "

syminfo.session

Session type of the chart main series. Possible values are session.regular, session.extended.
Type
string
See also
", + "description": "Session type of the chart main series. Possible values are session.regular, session.extended.", + "type": "string", + "remarks": "" + }, + { + "name": "syminfo.timezone", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_syminfo.timezone", + "fragment": "var_syminfo.timezone", + "info": "

syminfo.timezone

Timezone of the exchange of the chart main series. Possible values see in timestamp.
Type
string
See also
", + "description": "Timezone of the exchange of the chart main series. Possible values see in timestamp.", + "type": "string", + "remarks": "" + }, + { + "name": "ticker", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_ticker", + "fragment": "var_ticker", + "info": "

ticker

Symbol name without exchange prefix, e.g. 'MSFT'.
Type
string
See also
", + "description": "Symbol name without exchange prefix, e.g. 'MSFT'.", + "type": "string", + "remarks": "" + }, + { + "name": "tickerid", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_tickerid", + "fragment": "var_tickerid", + "info": "

tickerid

Symbol name with exchange prefix, e.g. 'BATS:MSFT', 'NASDAQ:MSFT'.
Type
string
See also
", + "description": "Symbol name with exchange prefix, e.g. 'BATS:MSFT', 'NASDAQ:MSFT'.", + "type": "string", + "remarks": "" + }, + { + "name": "time", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_time", + "fragment": "var_time", + "info": "

time

Current bar time in UNIX format. It is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.
Type
series
See also
", + "description": "Current bar time in UNIX format. It is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.", + "type": "series", + "remarks": "" + }, + { + "name": "timenow", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_timenow", + "fragment": "var_timenow", + "info": "

timenow

Current time in UNIX format. It is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.
Type
series
Remarks
Please note that using this variable/function can cause indicator repainting.
See also
", + "description": "Current time in UNIX format. It is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.", + "type": "series", + "remarks": [ + "Please note that using this variable/function can cause indicator repainting." + ] + }, + { + "name": "tr", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_tr", + "fragment": "var_tr", + "info": "

tr

True range. Same as tr(false). It is max(high - low, abs(high - close[1]), abs(low - close[1]))
Type
series
See also
", + "description": "True range. Same as tr(false). It is max(high - low, abs(high - close[1]), abs(low - close[1]))", + "type": "series", + "remarks": "" + }, + { + "name": "volume", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_volume", + "fragment": "var_volume", + "info": "

volume

Current bar volume.
Type
series
Remarks
Previous values may be accessed with square brackets operator [], e.g. volume[1], volume[2].
See also
", + "description": "Current bar volume.", + "type": "series", + "remarks": [ + "Previous values may be accessed with square brackets operator [], e.g. volume[1], volume[2]." + ] + }, + { + "name": "vwap", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_vwap", + "fragment": "var_vwap", + "info": "

vwap

Volume-weighted average price. It uses hlc3 as a source series.
Type
series
See also
", + "description": "Volume-weighted average price. It uses hlc3 as a source series.", + "type": "series", + "remarks": "" + }, + { + "name": "weekofyear", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_weekofyear", + "fragment": "var_weekofyear", + "info": "

weekofyear

Week number of current bar time in exchange timezone.
Type
series
See also
", + "description": "Week number of current bar time in exchange timezone.", + "type": "series", + "remarks": "" + }, + { + "name": "year", + "url": "https://www.tradingview.com/pine-script-reference/v3/#var_year", + "fragment": "var_year", + "info": "

year

Current bar year in exchange timezone.
Type
series
See also
", + "description": "Current bar year in exchange timezone.", + "type": "series", + "remarks": "" + } +] \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/definitions/v4/annotations.json b/pine-script-intellij-plugin/bin/main/definitions/v4/annotations.json new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/definitions/v4/annotations.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/definitions/v4/constants.json b/pine-script-intellij-plugin/bin/main/definitions/v4/constants.json new file mode 100644 index 0000000..a4d84b1 --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/definitions/v4/constants.json @@ -0,0 +1,1653 @@ +[ + { + "name": "adjustment.dividends", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_adjustment.dividends", + "fragment": "const_adjustment.dividends", + "info": "

adjustment.dividends

Constant for dividends adjustment type (dividends adjustment is applied).
Type
const string
See also
", + "description": "Constant for dividends adjustment type (dividends adjustment is applied).", + "type": "const string", + "remarks": "" + }, + { + "name": "adjustment.none", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_adjustment.none", + "fragment": "const_adjustment.none", + "info": "

adjustment.none

Constant for none adjustment type (no adjustment is applied).
Type
const string
See also
", + "description": "Constant for none adjustment type (no adjustment is applied).", + "type": "const string", + "remarks": "" + }, + { + "name": "adjustment.splits", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_adjustment.splits", + "fragment": "const_adjustment.splits", + "info": "

adjustment.splits

Constant for splits adjustment type (splits adjustment is applied).
Type
const string
See also
", + "description": "Constant for splits adjustment type (splits adjustment is applied).", + "type": "const string", + "remarks": "" + }, + { + "name": "alert.freq_all", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_alert.freq_all", + "fragment": "const_alert.freq_all", + "info": "

alert.freq_all

A named constant for use with the freq parameter of the alert() function.
All function calls trigger the alert.
Type
const string
See also
", + "description": "A named constant for use with the 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

A named constant for use with the freq parameter of the alert() function.
The first function call during the bar triggers the alert.
Type
const string
See also
", + "description": "A named constant for use with the 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

A named constant for use with the freq parameter of the alert() function.
The function call triggers the alert only when it occurs during the last script iteration of the real-time bar, when it closes.
Type
const string
See also
", + "description": "A named constant for use with the 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

Merge strategy for requested data. Data is merged continuously without gaps, all the gaps are filled with the previous nearest existing value.
Type
const bool
See also
", + "description": "Merge strategy for requested data. Data is merged continuously without gaps, all the gaps are filled with the previous nearest existing value.", + "type": "const bool", + "remarks": "" + }, + { + "name": "barmerge.gaps_on", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_barmerge.gaps_on", + "fragment": "const_barmerge.gaps_on", + "info": "

barmerge.gaps_on

Merge strategy for requested data. Data is merged with possible gaps (na values).
Type
const bool
See also
", + "description": "Merge strategy for requested data. Data is merged with possible gaps (na values).", + "type": "const bool", + "remarks": "" + }, + { + "name": "barmerge.lookahead_off", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_barmerge.lookahead_off", + "fragment": "const_barmerge.lookahead_off", + "info": "

barmerge.lookahead_off

Merge strategy for the requested data position. Requested barset is merged with current barset in the order of sorting bars by their close time. This merge strategy disables effect of getting data from \"future\" on calculation on history.
Type
const bool
See also
", + "description": "Merge strategy for the requested data position. Requested barset is merged with current barset in the order of sorting bars by their close time. This merge strategy disables effect of getting data from \"future\" on calculation on history.", + "type": "const bool", + "remarks": "" + }, + { + "name": "barmerge.lookahead_on", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_barmerge.lookahead_on", + "fragment": "const_barmerge.lookahead_on", + "info": "

barmerge.lookahead_on

Merge strategy for the requested data position. Requested barset is merged with current barset in the order of sorting bars by their opening time. This merge strategy can lead to undesirable effect of getting data from \"future\" on calculation on history. This is unacceptable in backtesting strategies, but can be useful in indicators.
Type
const bool
See also
", + "description": "Merge strategy for the requested data position. Requested barset is merged with current barset in the order of sorting bars by their opening time. This merge strategy can lead to undesirable effect of getting data from \"future\" on calculation on history. This is unacceptable in backtesting strategies, but can be useful in indicators.", + "type": "const bool", + "remarks": "" + }, + { + "name": "color.aqua", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_color.aqua", + "fragment": "const_color.aqua", + "info": "", + "description": "Is a named constant for #00BCD4 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.black", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_color.black", + "fragment": "const_color.black", + "info": "", + "description": "Is a named constant for #363A45 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.blue", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_color.blue", + "fragment": "const_color.blue", + "info": "", + "description": "Is a named constant for #2196F3 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.fuchsia", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_color.fuchsia", + "fragment": "const_color.fuchsia", + "info": "", + "description": "Is a named constant for #E040FB color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.gray", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_color.gray", + "fragment": "const_color.gray", + "info": "", + "description": "Is a named constant for #787B86 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.green", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_color.green", + "fragment": "const_color.green", + "info": "", + "description": "Is a named constant for #4CAF50 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.lime", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_color.lime", + "fragment": "const_color.lime", + "info": "", + "description": "Is a named constant for #00E676 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.maroon", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_color.maroon", + "fragment": "const_color.maroon", + "info": "", + "description": "Is a named constant for #880E4F color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.navy", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_color.navy", + "fragment": "const_color.navy", + "info": "", + "description": "Is a named constant for #311B92 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.olive", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_color.olive", + "fragment": "const_color.olive", + "info": "", + "description": "Is a named constant for #808000 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.orange", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_color.orange", + "fragment": "const_color.orange", + "info": "", + "description": "Is a named constant for #FF9800 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.purple", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_color.purple", + "fragment": "const_color.purple", + "info": "", + "description": "Is a named constant for #9C27B0 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.red", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_color.red", + "fragment": "const_color.red", + "info": "", + "description": "Is a named constant for #FF5252 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.silver", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_color.silver", + "fragment": "const_color.silver", + "info": "", + "description": "Is a named constant for #B2B5BE color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.teal", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_color.teal", + "fragment": "const_color.teal", + "info": "", + "description": "Is a named constant for #00897B color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.white", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_color.white", + "fragment": "const_color.white", + "info": "", + "description": "Is a named constant for #FFFFFF color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.yellow", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_color.yellow", + "fragment": "const_color.yellow", + "info": "", + "description": "Is a named constant for #FFEB3B color.", + "type": "const color", + "remarks": "" + }, + { + "name": "currency.AUD", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_currency.AUD", + "fragment": "const_currency.AUD", + "info": "

currency.AUD

Australian dollar.
Type
const string
See also
", + "description": "Australian dollar.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.CAD", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_currency.CAD", + "fragment": "const_currency.CAD", + "info": "

currency.CAD

Canadian dollar.
Type
const string
See also
", + "description": "Canadian dollar.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.CHF", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_currency.CHF", + "fragment": "const_currency.CHF", + "info": "

currency.CHF

Swiss franc.
Type
const string
See also
", + "description": "Swiss franc.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.EUR", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_currency.EUR", + "fragment": "const_currency.EUR", + "info": "

currency.EUR

Euro.
Type
const string
See also
", + "description": "Euro.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.GBP", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_currency.GBP", + "fragment": "const_currency.GBP", + "info": "

currency.GBP

Pound sterling.
Type
const string
See also
", + "description": "Pound sterling.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.HKD", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_currency.HKD", + "fragment": "const_currency.HKD", + "info": "

currency.HKD

Hong Kong dollar.
Type
const string
See also
", + "description": "Hong Kong dollar.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.JPY", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_currency.JPY", + "fragment": "const_currency.JPY", + "info": "

currency.JPY

Japanese yen.
Type
const string
See also
", + "description": "Japanese yen.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.NOK", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_currency.NOK", + "fragment": "const_currency.NOK", + "info": "

currency.NOK

Norwegian krone.
Type
const string
See also
", + "description": "Norwegian krone.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.NONE", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_currency.NONE", + "fragment": "const_currency.NONE", + "info": "

currency.NONE

Unspecified currency.
Type
const string
See also
", + "description": "Unspecified currency.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.NZD", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_currency.NZD", + "fragment": "const_currency.NZD", + "info": "

currency.NZD

New Zealand dollar.
Type
const string
See also
", + "description": "New Zealand dollar.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.RUB", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_currency.RUB", + "fragment": "const_currency.RUB", + "info": "

currency.RUB

Russian ruble.
Type
const string
See also
", + "description": "Russian ruble.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.SEK", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_currency.SEK", + "fragment": "const_currency.SEK", + "info": "

currency.SEK

Swedish krona.
Type
const string
See also
", + "description": "Swedish krona.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.SGD", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_currency.SGD", + "fragment": "const_currency.SGD", + "info": "

currency.SGD

Singapore dollar.
Type
const string
See also
", + "description": "Singapore dollar.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.TRY", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_currency.TRY", + "fragment": "const_currency.TRY", + "info": "

currency.TRY

Turkish lira.
Type
const string
See also
", + "description": "Turkish lira.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.USD", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_currency.USD", + "fragment": "const_currency.USD", + "info": "

currency.USD

United States dollar.
Type
const string
See also
", + "description": "United States dollar.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.ZAR", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_currency.ZAR", + "fragment": "const_currency.ZAR", + "info": "

currency.ZAR

South African rand.
Type
const string
See also
", + "description": "South African rand.", + "type": "const string", + "remarks": "" + }, + { + "name": "dayofweek.friday", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_dayofweek.friday", + "fragment": "const_dayofweek.friday", + "info": "

dayofweek.friday

Is a named constant for return value of dayofweek function and value of dayofweek variable.
Type
const integer
See also
", + "description": "Is a named constant for return value of dayofweek function and value of dayofweek variable.", + "type": "const integer", + "remarks": "" + }, + { + "name": "dayofweek.monday", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_dayofweek.monday", + "fragment": "const_dayofweek.monday", + "info": "

dayofweek.monday

Is a named constant for return value of dayofweek function and value of dayofweek variable.
Type
const integer
See also
", + "description": "Is a named constant for return value of dayofweek function and value of dayofweek variable.", + "type": "const integer", + "remarks": "" + }, + { + "name": "dayofweek.saturday", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_dayofweek.saturday", + "fragment": "const_dayofweek.saturday", + "info": "

dayofweek.saturday

Is a named constant for return value of dayofweek function and value of dayofweek variable.
Type
const integer
See also
", + "description": "Is a named constant for return value of dayofweek function and value of dayofweek variable.", + "type": "const integer", + "remarks": "" + }, + { + "name": "dayofweek.sunday", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_dayofweek.sunday", + "fragment": "const_dayofweek.sunday", + "info": "

dayofweek.sunday

Is a named constant for return value of dayofweek function and value of dayofweek variable.
Type
const integer
See also
", + "description": "Is a named constant for return value of dayofweek function and value of dayofweek variable.", + "type": "const integer", + "remarks": "" + }, + { + "name": "dayofweek.thursday", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_dayofweek.thursday", + "fragment": "const_dayofweek.thursday", + "info": "

dayofweek.thursday

Is a named constant for return value of dayofweek function and value of dayofweek variable.
Type
const integer
See also
", + "description": "Is a named constant for return value of dayofweek function and value of dayofweek variable.", + "type": "const integer", + "remarks": "" + }, + { + "name": "dayofweek.tuesday", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_dayofweek.tuesday", + "fragment": "const_dayofweek.tuesday", + "info": "

dayofweek.tuesday

Is a named constant for return value of dayofweek function and value of dayofweek variable.
Type
const integer
See also
", + "description": "Is a named constant for return value of dayofweek function and value of dayofweek variable.", + "type": "const integer", + "remarks": "" + }, + { + "name": "dayofweek.wednesday", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_dayofweek.wednesday", + "fragment": "const_dayofweek.wednesday", + "info": "

dayofweek.wednesday

Is a named constant for return value of dayofweek function and value of dayofweek variable.
Type
const integer
See also
", + "description": "Is a named constant for return value of dayofweek function and value of dayofweek variable.", + "type": "const integer", + "remarks": "" + }, + { + "name": "display.all", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_display.all", + "fragment": "const_display.all", + "info": "

display.all

A named constant that specifies where the plot is displayed. Display everywhere.
Type
const integer
See also
", + "description": "A named constant that specifies where the plot is displayed. Display everywhere.", + "type": "const integer", + "remarks": "" + }, + { + "name": "display.none", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_display.none", + "fragment": "const_display.none", + "info": "

display.none

A named constant that specifies where the plot is displayed. Display nowhere. Available in alert template message.
Type
const integer
See also
", + "description": "A named constant that specifies where the plot is displayed. Display nowhere. Available in alert template message.", + "type": "const integer", + "remarks": "" + }, + { + "name": "dividends.gross", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_dividends.gross", + "fragment": "const_dividends.gross", + "info": "

dividends.gross

A named constant for the dividends function. Is used to request the dividends return on a stock before deductions.
Type
const string
See also
", + "description": "A named constant for the dividends function. Is used to request the dividends return on a stock before deductions.", + "type": "const string", + "remarks": "" + }, + { + "name": "dividends.net", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_dividends.net", + "fragment": "const_dividends.net", + "info": "

dividends.net

A named constant for the dividends function. Is used to request the dividends return on a stock after deductions.
Type
const string
See also
", + "description": "A named constant for the dividends function. Is used to request the dividends return on a stock after deductions.", + "type": "const string", + "remarks": "" + }, + { + "name": "earnings.actual", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_earnings.actual", + "fragment": "const_earnings.actual", + "info": "

earnings.actual

A named constant for the earnings function. Is used to request the earnings value as it was reported.
Type
const string
See also
", + "description": "A named constant for the earnings function. Is used to request the earnings value as it was reported.", + "type": "const string", + "remarks": "" + }, + { + "name": "earnings.estimate", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_earnings.estimate", + "fragment": "const_earnings.estimate", + "info": "

earnings.estimate

A named constant for the earnings function. Is used to request the estimated earnings value.
Type
const string
See also
", + "description": "A named constant for the earnings function. Is used to request the estimated earnings value.", + "type": "const string", + "remarks": "" + }, + { + "name": "extend.both", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_extend.both", + "fragment": "const_extend.both", + "info": "

extend.both

A named constant for line.new and line.set_extend functions.
Type
const string
See also
", + "description": "A named constant for line.new and line.set_extend functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "extend.left", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_extend.left", + "fragment": "const_extend.left", + "info": "

extend.left

A named constant for line.new and line.set_extend functions.
Type
const string
See also
", + "description": "A named constant for line.new and line.set_extend functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "extend.none", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_extend.none", + "fragment": "const_extend.none", + "info": "

extend.none

A named constant for line.new and line.set_extend functions.
Type
const string
See also
", + "description": "A named constant for line.new and line.set_extend functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "extend.right", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_extend.right", + "fragment": "const_extend.right", + "info": "

extend.right

A named constant for line.new and line.set_extend functions.
Type
const string
See also
", + "description": "A named constant for line.new and line.set_extend functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "format.inherit", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_format.inherit", + "fragment": "const_format.inherit", + "info": "

format.inherit

Is a named constant for selecting the formatting of the script output values from the parent series in the study function.
Type
const string
See also
", + "description": "Is a named constant for selecting the formatting of the script output values from the parent series in the study function.", + "type": "const string", + "remarks": "" + }, + { + "name": "format.mintick", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_format.mintick", + "fragment": "const_format.mintick", + "info": "

format.mintick

Is a named constant to use with the tostring function. Passing a number to tostring with this argument rounds the number to the nearest value that can be divided by syminfo.mintick, without the remainder, with ties rounding up, and returns the string version of said value with trailing zeroes.
Type
const string
See also
", + "description": "Is a named constant to use with the tostring function. Passing a number to tostring with this argument rounds the number to the nearest value that can be divided by syminfo.mintick, without the remainder, with ties rounding up, and returns the string version of said value with trailing zeroes.", + "type": "const string", + "remarks": "" + }, + { + "name": "format.percent", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_format.percent", + "fragment": "const_format.percent", + "info": "

format.percent

Is a named constant for selecting the formatting of the script output values as a percentage in the study function. It adds a percent sign after values.
Type
const string
Remarks
The default precision is 2, regardless of the precision of the chart itself. This can be changed with the 'precision' argument of the study function.
See also
", + "description": "Is a named constant for selecting the formatting of the script output values as a percentage in the study function. It adds a percent sign after values.", + "type": "const string", + "remarks": [ + "The default precision is 2, regardless of the precision of the chart itself. This can be changed with the 'precision' argument of the study function." + ] + }, + { + "name": "format.price", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_format.price", + "fragment": "const_format.price", + "info": "

format.price

Is a named constant for selecting the formatting of the script output values as prices in the study function.
Type
const string
Remarks
If format is format.price, default precision value is set. You can use the precision argument of study function to change the precision value.
See also
", + "description": "Is a named constant for selecting the formatting of the script output values as prices in the study function.", + "type": "const string", + "remarks": [ + "If format is format.price, default precision value is set. You can use the precision argument of study function to change the precision value." + ] + }, + { + "name": "format.volume", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_format.volume", + "fragment": "const_format.volume", + "info": "

format.volume

Is a named constant for selecting the formatting of the script output values as volume in the study function, e.g. '5183' will be formatted as '5.183K'.
Type
const string
See also
", + "description": "Is a named constant for selecting the formatting of the script output values as volume in the study function, e.g. '5183' will be formatted as '5.183K'.", + "type": "const string", + "remarks": "" + }, + { + "name": "hline.style_dashed", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_hline.style_dashed", + "fragment": "const_hline.style_dashed", + "info": "

hline.style_dashed

Is a named constant for dashed linestyle of hline function.
Type
const integer
See also
", + "description": "Is a named constant for dashed linestyle of hline function.", + "type": "const integer", + "remarks": "" + }, + { + "name": "hline.style_dotted", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_hline.style_dotted", + "fragment": "const_hline.style_dotted", + "info": "

hline.style_dotted

Is a named constant for dotted linestyle of hline function.
Type
const integer
See also
", + "description": "Is a named constant for dotted linestyle of hline function.", + "type": "const integer", + "remarks": "" + }, + { + "name": "hline.style_solid", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_hline.style_solid", + "fragment": "const_hline.style_solid", + "info": "

hline.style_solid

Is a named constant for solid linestyle of hline function.
Type
const integer
See also
", + "description": "Is a named constant for solid linestyle of hline function.", + "type": "const integer", + "remarks": "" + }, + { + "name": "input.bool", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_input.bool", + "fragment": "const_input.bool", + "info": "

input.bool

Is a named constant for bool input type of input function.
Type
const string
See also
", + "description": "Is a named constant for bool input type of input function.", + "type": "const string", + "remarks": "" + }, + { + "name": "input.color", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_input.color", + "fragment": "const_input.color", + "info": "

input.color

Is a named constant for color input type of input function.
Type
const string
See also
", + "description": "Is a named constant for color input type of input function.", + "type": "const string", + "remarks": "" + }, + { + "name": "input.float", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_input.float", + "fragment": "const_input.float", + "info": "

input.float

Is a named constant for float input type of input function.
Type
const string
See also
", + "description": "Is a named constant for float input type of input function.", + "type": "const string", + "remarks": "" + }, + { + "name": "input.integer", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_input.integer", + "fragment": "const_input.integer", + "info": "

input.integer

Is a named constant for integer input type of input function.
Type
const string
See also
", + "description": "Is a named constant for integer input type of input function.", + "type": "const string", + "remarks": "" + }, + { + "name": "input.price", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_input.price", + "fragment": "const_input.price", + "info": "

input.price

Is a named constant for the price type of the input function.
Type
const string
See also
", + "description": "Is a named constant for the price type of the input function.", + "type": "const string", + "remarks": "" + }, + { + "name": "input.resolution", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_input.resolution", + "fragment": "const_input.resolution", + "info": "

input.resolution

Is a named constant for resolution input type of input function.
Type
const string
See also
", + "description": "Is a named constant for resolution input type of input function.", + "type": "const string", + "remarks": "" + }, + { + "name": "input.session", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_input.session", + "fragment": "const_input.session", + "info": "

input.session

Is a named constant for session input type of input function.
Type
const string
See also
", + "description": "Is a named constant for session input type of input function.", + "type": "const string", + "remarks": "" + }, + { + "name": "input.source", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_input.source", + "fragment": "const_input.source", + "info": "

input.source

Is a named constant for source input type of input function.
Type
const string
See also
", + "description": "Is a named constant for source input type of input function.", + "type": "const string", + "remarks": "" + }, + { + "name": "input.string", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_input.string", + "fragment": "const_input.string", + "info": "

input.string

Is a named constant for string input type of input function.
Type
const string
See also
", + "description": "Is a named constant for string input type of input function.", + "type": "const string", + "remarks": "" + }, + { + "name": "input.symbol", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_input.symbol", + "fragment": "const_input.symbol", + "info": "

input.symbol

Is a named constant for symbol input type of input function.
Type
const string
See also
", + "description": "Is a named constant for symbol input type of input function.", + "type": "const string", + "remarks": "" + }, + { + "name": "input.time", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_input.time", + "fragment": "const_input.time", + "info": "

input.time

Is a named constant for the time type of the input function.
Type
const string
See also
", + "description": "Is a named constant for the time type of the input function.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_arrowdown", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_label.style_arrowdown", + "fragment": "const_label.style_arrowdown", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_arrowup", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_label.style_arrowup", + "fragment": "const_label.style_arrowup", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_circle", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_label.style_circle", + "fragment": "const_label.style_circle", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_cross", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_label.style_cross", + "fragment": "const_label.style_cross", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_diamond", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_label.style_diamond", + "fragment": "const_label.style_diamond", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_flag", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_label.style_flag", + "fragment": "const_label.style_flag", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_label_center", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_label.style_label_center", + "fragment": "const_label.style_label_center", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_label_down", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_label.style_label_down", + "fragment": "const_label.style_label_down", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_label_left", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_label.style_label_left", + "fragment": "const_label.style_label_left", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_label_lower_left", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_label.style_label_lower_left", + "fragment": "const_label.style_label_lower_left", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_label_lower_right", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_label.style_label_lower_right", + "fragment": "const_label.style_label_lower_right", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_label_right", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_label.style_label_right", + "fragment": "const_label.style_label_right", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_label_up", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_label.style_label_up", + "fragment": "const_label.style_label_up", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_label_upper_left", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_label.style_label_upper_left", + "fragment": "const_label.style_label_upper_left", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_label_upper_right", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_label.style_label_upper_right", + "fragment": "const_label.style_label_upper_right", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_none", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_label.style_none", + "fragment": "const_label.style_none", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_square", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_label.style_square", + "fragment": "const_label.style_square", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_triangledown", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_label.style_triangledown", + "fragment": "const_label.style_triangledown", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_triangleup", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_label.style_triangleup", + "fragment": "const_label.style_triangleup", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_xcross", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_label.style_xcross", + "fragment": "const_label.style_xcross", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "line.style_arrow_both", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_line.style_arrow_both", + "fragment": "const_line.style_arrow_both", + "info": "

line.style_arrow_both

Line style for line.new and line.set_style functions. Solid line with arrows on both points.
Type
const string
See also
", + "description": "Line style for line.new and line.set_style functions. Solid line with arrows on both points.", + "type": "const string", + "remarks": "" + }, + { + "name": "line.style_arrow_left", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_line.style_arrow_left", + "fragment": "const_line.style_arrow_left", + "info": "

line.style_arrow_left

Line style for line.new and line.set_style functions. Solid line with arrow on the first point.
Type
const string
See also
", + "description": "Line style for line.new and line.set_style functions. Solid line with arrow on the first point.", + "type": "const string", + "remarks": "" + }, + { + "name": "line.style_arrow_right", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_line.style_arrow_right", + "fragment": "const_line.style_arrow_right", + "info": "

line.style_arrow_right

Line style for line.new and line.set_style functions. Solid line with arrow on the second point.
Type
const string
See also
", + "description": "Line style for line.new and line.set_style functions. Solid line with arrow on the second point.", + "type": "const string", + "remarks": "" + }, + { + "name": "line.style_dashed", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_line.style_dashed", + "fragment": "const_line.style_dashed", + "info": "", + "description": "Line style for line.new and line.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "line.style_dotted", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_line.style_dotted", + "fragment": "const_line.style_dotted", + "info": "", + "description": "Line style for line.new and line.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "line.style_solid", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_line.style_solid", + "fragment": "const_line.style_solid", + "info": "", + "description": "Line style for line.new and line.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "location.abovebar", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_location.abovebar", + "fragment": "const_location.abovebar", + "info": "

location.abovebar

Location value for plotshape, plotchar functions. Shape is plotted above main series bars.
Type
const string
See also
", + "description": "Location value for plotshape, plotchar functions. Shape is plotted above main series bars.", + "type": "const string", + "remarks": "" + }, + { + "name": "location.absolute", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_location.absolute", + "fragment": "const_location.absolute", + "info": "

location.absolute

Location value for plotshape, plotchar functions. Shape is plotted on chart using indicator value as a price coordinate.
Type
const string
See also
", + "description": "Location value for plotshape, plotchar functions. Shape is plotted on chart using indicator value as a price coordinate.", + "type": "const string", + "remarks": "" + }, + { + "name": "location.belowbar", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_location.belowbar", + "fragment": "const_location.belowbar", + "info": "

location.belowbar

Location value for plotshape, plotchar functions. Shape is plotted below main series bars.
Type
const string
See also
", + "description": "Location value for plotshape, plotchar functions. Shape is plotted below main series bars.", + "type": "const string", + "remarks": "" + }, + { + "name": "location.bottom", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_location.bottom", + "fragment": "const_location.bottom", + "info": "

location.bottom

Location value for plotshape, plotchar functions. Shape is plotted near the bottom chart border.
Type
const string
See also
", + "description": "Location value for plotshape, plotchar functions. Shape is plotted near the bottom chart border.", + "type": "const string", + "remarks": "" + }, + { + "name": "location.top", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_location.top", + "fragment": "const_location.top", + "info": "

location.top

Location value for plotshape, plotchar functions. Shape is plotted near the top chart border.
Type
const string
See also
", + "description": "Location value for plotshape, plotchar functions. Shape is plotted near the top chart border.", + "type": "const string", + "remarks": "" + }, + { + "name": "math.e", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_math.e", + "fragment": "const_math.e", + "info": "

math.e

Is a named constant for Euler's number. It is equal to 2.7182818284590452.
Type
const float
See also
", + "description": "Is a named constant for Euler's number. It is equal to 2.7182818284590452.", + "type": "const float", + "remarks": "" + }, + { + "name": "math.phi", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_math.phi", + "fragment": "const_math.phi", + "info": "

math.phi

Is a named constant for the golden ratio. It is equal to 1.6180339887498948.
Type
const float
See also
", + "description": "Is a named constant for the golden ratio. It is equal to 1.6180339887498948.", + "type": "const float", + "remarks": "" + }, + { + "name": "math.pi", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_math.pi", + "fragment": "const_math.pi", + "info": "

math.pi

Is a named constant for Archimedes' constant. It is equal to 3.1415926535897932.
Type
const float
See also
", + "description": "Is a named constant for Archimedes' constant. It is equal to 3.1415926535897932.", + "type": "const float", + "remarks": "" + }, + { + "name": "math.rphi", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_math.rphi", + "fragment": "const_math.rphi", + "info": "

math.rphi

Is a named constant for the golden ratio conjugate. It is equal to 0.6180339887498948.
Type
const float
See also
", + "description": "Is a named constant for the golden ratio conjugate. It is equal to 0.6180339887498948.", + "type": "const float", + "remarks": "" + }, + { + "name": "order.ascending", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_order.ascending", + "fragment": "const_order.ascending", + "info": "

order.ascending

Determines the sort order of the array from the smallest to the largest value.
Type
const bool
See also
", + "description": "Determines the sort order of the array from the smallest to the largest value.", + "type": "const bool", + "remarks": "" + }, + { + "name": "order.descending", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_order.descending", + "fragment": "const_order.descending", + "info": "

order.descending

Determines the sort order of the array from the largest to the smallest value.
Type
const bool
See also
", + "description": "Determines the sort order of the array from the largest to the smallest value.", + "type": "const bool", + "remarks": "" + }, + { + "name": "plot.style_area", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_plot.style_area", + "fragment": "const_plot.style_area", + "info": "

plot.style_area

A named constant for the 'Area' style, to be used as an argument for the style parameter in the plot function.
Type
const integer
See also
", + "description": "A named constant for the 'Area' style, to be used as an argument for the 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

A named constant for the 'Area With Breaks' style, to be used as an argument for the style parameter in the plot function. Similar to plot.style_area, except the gaps in the data are not filled.
Type
const integer
See also
", + "description": "A named constant for the 'Area With Breaks' style, to be used as an argument for the 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

A named constant for the 'Circles' style, to be used as an argument for the style parameter in the plot function.
Type
const integer
See also
", + "description": "A named constant for the 'Circles' style, to be used as an argument for the 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

A named constant for the 'Columns' style, to be used as an argument for the style parameter in the plot function.
Type
const integer
See also
", + "description": "A named constant for the 'Columns' style, to be used as an argument for the 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

A named constant for the 'Cross' style, to be used as an argument for the style parameter in the plot function.
Type
const integer
See also
", + "description": "A named constant for the 'Cross' style, to be used as an argument for the 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

A named constant for the 'Histogram' style, to be used as an argument for the style parameter in the plot function.
Type
const integer
See also
", + "description": "A named constant for the 'Histogram' style, to be used as an argument for the 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

A named constant for the 'Line' style, to be used as an argument for the style parameter in the plot function.
Type
const integer
See also
", + "description": "A named constant for the 'Line' style, to be used as an argument for the 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

A named constant for the 'Line With Breaks' style, to be used as an argument for the style parameter in the plot function. Similar to plot.style_line, except the gaps in the data are not filled.
Type
const integer
See also
", + "description": "A named constant for the 'Line With Breaks' style, to be used as an argument for the 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

A named constant for the 'Step Line' style, to be used as an argument for the style parameter in the plot function.
Type
const integer
See also
", + "description": "A named constant for the 'Step Line' style, to be used as an argument for the 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": "", + "description": "Table position is used in table.new, table.cell functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "position.bottom_left", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_position.bottom_left", + "fragment": "const_position.bottom_left", + "info": "", + "description": "Table position is used in table.new, table.cell functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "position.bottom_right", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_position.bottom_right", + "fragment": "const_position.bottom_right", + "info": "", + "description": "Table position is used in table.new, table.cell functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "position.middle_center", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_position.middle_center", + "fragment": "const_position.middle_center", + "info": "", + "description": "Table position is used in table.new, table.cell functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "position.middle_left", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_position.middle_left", + "fragment": "const_position.middle_left", + "info": "", + "description": "Table position is used in table.new, table.cell functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "position.middle_right", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_position.middle_right", + "fragment": "const_position.middle_right", + "info": "", + "description": "Table position is used in table.new, table.cell functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "position.top_center", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_position.top_center", + "fragment": "const_position.top_center", + "info": "", + "description": "Table position is used in table.new, table.cell functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "position.top_left", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_position.top_left", + "fragment": "const_position.top_left", + "info": "", + "description": "Table position is used in table.new, table.cell functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "position.top_right", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_position.top_right", + "fragment": "const_position.top_right", + "info": "", + "description": "Table position is used in table.new, table.cell functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "scale.left", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_scale.left", + "fragment": "const_scale.left", + "info": "

scale.left

Scale value for study function. Study is added to the left price scale.
Type
const integer
See also
", + "description": "Scale value for study function. Study is added to the left price scale.", + "type": "const integer", + "remarks": "" + }, + { + "name": "scale.none", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_scale.none", + "fragment": "const_scale.none", + "info": "

scale.none

Scale value for study function. Study is added in 'No Scale' mode. Can be used only with 'overlay=true'.
Type
const integer
See also
", + "description": "Scale value for study function. Study is added in 'No Scale' mode. Can be used only with 'overlay=true'.", + "type": "const integer", + "remarks": "" + }, + { + "name": "scale.right", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_scale.right", + "fragment": "const_scale.right", + "info": "

scale.right

Scale value for study function. Study is added to the right price scale.
Type
const integer
See also
", + "description": "Scale value for study function. Study is added to the right price scale.", + "type": "const integer", + "remarks": "" + }, + { + "name": "session.extended", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_session.extended", + "fragment": "const_session.extended", + "info": "

session.extended

Constant for extended session type (with extended hours data).
Type
const string
See also
", + "description": "Constant for extended session type (with extended hours data).", + "type": "const string", + "remarks": "" + }, + { + "name": "session.regular", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_session.regular", + "fragment": "const_session.regular", + "info": "

session.regular

Constant for regular session type (no extended hours data).
Type
const string
See also
", + "description": "Constant for regular session type (no extended hours data).", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.arrowdown", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_shape.arrowdown", + "fragment": "const_shape.arrowdown", + "info": "

shape.arrowdown

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.arrowup", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_shape.arrowup", + "fragment": "const_shape.arrowup", + "info": "

shape.arrowup

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.circle", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_shape.circle", + "fragment": "const_shape.circle", + "info": "

shape.circle

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.cross", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_shape.cross", + "fragment": "const_shape.cross", + "info": "

shape.cross

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.diamond", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_shape.diamond", + "fragment": "const_shape.diamond", + "info": "

shape.diamond

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.flag", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_shape.flag", + "fragment": "const_shape.flag", + "info": "

shape.flag

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.labeldown", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_shape.labeldown", + "fragment": "const_shape.labeldown", + "info": "

shape.labeldown

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.labelup", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_shape.labelup", + "fragment": "const_shape.labelup", + "info": "

shape.labelup

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.square", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_shape.square", + "fragment": "const_shape.square", + "info": "

shape.square

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.triangledown", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_shape.triangledown", + "fragment": "const_shape.triangledown", + "info": "

shape.triangledown

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.triangleup", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_shape.triangleup", + "fragment": "const_shape.triangleup", + "info": "

shape.triangleup

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "shape.xcross", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_shape.xcross", + "fragment": "const_shape.xcross", + "info": "

shape.xcross

Shape style for plotshape function.
Type
const string
See also
", + "description": "Shape style for plotshape function.", + "type": "const string", + "remarks": "" + }, + { + "name": "size.auto", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_size.auto", + "fragment": "const_size.auto", + "info": "

size.auto

Size value for plotshape, plotchar functions. The size of the shape automatically adapts to the size of the bars.
Type
const string
See also
", + "description": "Size value for plotshape, plotchar functions. The size of the shape automatically adapts to the size of the bars.", + "type": "const string", + "remarks": "" + }, + { + "name": "size.huge", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_size.huge", + "fragment": "const_size.huge", + "info": "

size.huge

Size value for plotshape, plotchar functions. The size of the shape constantly huge.
Type
const string
See also
", + "description": "Size value for plotshape, plotchar functions. The size of the shape constantly huge.", + "type": "const string", + "remarks": "" + }, + { + "name": "size.large", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_size.large", + "fragment": "const_size.large", + "info": "

size.large

Size value for plotshape, plotchar functions. The size of the shape constantly large.
Type
const string
See also
", + "description": "Size value for plotshape, plotchar functions. The size of the shape constantly large.", + "type": "const string", + "remarks": "" + }, + { + "name": "size.normal", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_size.normal", + "fragment": "const_size.normal", + "info": "

size.normal

Size value for plotshape, plotchar functions. The size of the shape constantly normal.
Type
const string
See also
", + "description": "Size value for plotshape, plotchar functions. The size of the shape constantly normal.", + "type": "const string", + "remarks": "" + }, + { + "name": "size.small", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_size.small", + "fragment": "const_size.small", + "info": "

size.small

Size value for plotshape, plotchar functions. The size of the shape constantly small.
Type
const string
See also
", + "description": "Size value for plotshape, plotchar functions. The size of the shape constantly small.", + "type": "const string", + "remarks": "" + }, + { + "name": "size.tiny", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_size.tiny", + "fragment": "const_size.tiny", + "info": "

size.tiny

Size value for plotshape, plotchar functions. The size of the shape constantly tiny.
Type
const string
See also
", + "description": "Size value for plotshape, plotchar functions. The size of the shape constantly tiny.", + "type": "const string", + "remarks": "" + }, + { + "name": "splits.denominator", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_splits.denominator", + "fragment": "const_splits.denominator", + "info": "

splits.denominator

A named constant for the splits function. Is used to request the denominator (the number below the line in a fraction) of a splits.
Type
const string
See also
", + "description": "A named constant for the splits function. Is used to request the denominator (the number below the line in a fraction) of a splits.", + "type": "const string", + "remarks": "" + }, + { + "name": "splits.numerator", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_splits.numerator", + "fragment": "const_splits.numerator", + "info": "

splits.numerator

A named constant for the splits function. Is used to request the numerator (the number above the line in a fraction) of a splits.
Type
const string
See also
", + "description": "A named constant for the splits function. Is used to request the numerator (the number above the line in a fraction) of a splits.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.cash", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_strategy.cash", + "fragment": "const_strategy.cash", + "info": "

strategy.cash

If the number of contracts/shares/lots/units to buy/sell is not specified for strategy.entry or strategy.order commands (or 'NaN' is specified), then strategy will calculate the quantity to buy/sell at close of current bar using the amount of money specified in the 'default_qty_value'.
Type
const string
See also
", + "description": "If the number of contracts/shares/lots/units to buy/sell is not specified for strategy.entry or strategy.order commands (or 'NaN' is specified), then strategy will calculate the quantity to buy/sell at close of current bar using the amount of money specified in the 'default_qty_value'.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.commission.cash_per_contract", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_strategy.commission.cash_per_contract", + "fragment": "const_strategy.commission.cash_per_contract", + "info": "

strategy.commission.cash_per_contract

Commission type for an order. Money displayed in the account currency per contract.
Type
const string
See also
", + "description": "Commission type for an order. Money displayed in the account currency per contract.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.commission.cash_per_order", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_strategy.commission.cash_per_order", + "fragment": "const_strategy.commission.cash_per_order", + "info": "

strategy.commission.cash_per_order

Commission type for an order. Money displayed in the account currency per order.
Type
const string
See also
", + "description": "Commission type for an order. Money displayed in the account currency per order.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.commission.percent", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_strategy.commission.percent", + "fragment": "const_strategy.commission.percent", + "info": "

strategy.commission.percent

Commission type for an order. A percentage of the cash volume of order.
Type
const string
See also
", + "description": "Commission type for an order. A percentage of the cash volume of order.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.direction.all", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_strategy.direction.all", + "fragment": "const_strategy.direction.all", + "info": "

strategy.direction.all

It allows strategy to open both long and short positions.
Type
const string
See also
", + "description": "It allows strategy to open both long and short positions.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.direction.long", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_strategy.direction.long", + "fragment": "const_strategy.direction.long", + "info": "

strategy.direction.long

It allows strategy to open only long positions.
Type
const string
See also
", + "description": "It allows strategy to open only long positions.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.direction.short", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_strategy.direction.short", + "fragment": "const_strategy.direction.short", + "info": "

strategy.direction.short

It allows strategy to open only short positions.
Type
const string
See also
", + "description": "It allows strategy to open only short positions.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.fixed", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_strategy.fixed", + "fragment": "const_strategy.fixed", + "info": "

strategy.fixed

If the number of contracts/shares/lots/units to buy/sell is not specified for strategy.entry or strategy.order commands (or 'NaN' is specified), then the 'default_qty_value' is used to define the quantity.
Type
const string
See also
", + "description": "If the number of contracts/shares/lots/units to buy/sell is not specified for strategy.entry or strategy.order commands (or 'NaN' is specified), then the 'default_qty_value' is used to define the quantity.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.long", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_strategy.long", + "fragment": "const_strategy.long", + "info": "

strategy.long

Long position entry.
Type
const bool
See also
", + "description": "Long position entry.", + "type": "const bool", + "remarks": "" + }, + { + "name": "strategy.oca.cancel", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_strategy.oca.cancel", + "fragment": "const_strategy.oca.cancel", + "info": "

strategy.oca.cancel

OCA type value for strategy's functions. The parameter determines that an order should belong to an OCO group, where as soon as an order is filled, all other orders of the same group are cancelled. Note: if more than 1 guaranteed-to-be-executed orders of the same OCA group are placed at once, all those orders are filled.
Type
const string
See also
", + "description": "OCA type value for strategy's functions. The parameter determines that an order should belong to an OCO group, where as soon as an order is filled, all other orders of the same group are cancelled. Note: if more than 1 guaranteed-to-be-executed orders of the same OCA group are placed at once, all those orders are filled.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.oca.none", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_strategy.oca.none", + "fragment": "const_strategy.oca.none", + "info": "

strategy.oca.none

OCA type value for strategy's functions. The parameter determines that an order should not belong to any particular OCO group.
Type
const string
See also
", + "description": "OCA type value for strategy's functions. The parameter determines that an order should not belong to any particular OCO group.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.oca.reduce", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_strategy.oca.reduce", + "fragment": "const_strategy.oca.reduce", + "info": "

strategy.oca.reduce

OCA type value for strategy's functions. The parameter determines that an order should belong to an OCO group, where if X number of contracts of an order is filled, number of contracts for each other order of the same OCO group is decreased by X. Note: if more than 1 guaranteed-to-be-executed orders of the same OCA group are placed at once, all those orders are filled.
Type
const string
See also
", + "description": "OCA type value for strategy's functions. The parameter determines that an order should belong to an OCO group, where if X number of contracts of an order is filled, number of contracts for each other order of the same OCO group is decreased by X. Note: if more than 1 guaranteed-to-be-executed orders of the same OCA group are placed at once, all those orders are filled.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.percent_of_equity", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_strategy.percent_of_equity", + "fragment": "const_strategy.percent_of_equity", + "info": "

strategy.percent_of_equity

If the number of contracts/shares/lots/units to buy/sell is not specified for strategy.entry or strategy.order commands (or 'NaN' is specified), then strategy will calculate the quantity to buy/sell at close of current bar using the amount of money specified by the 'default_qty_value' in % from current strategy.equity (in the range from 0 to 100).
Type
const string
See also
", + "description": "If the number of contracts/shares/lots/units to buy/sell is not specified for strategy.entry or strategy.order commands (or 'NaN' is specified), then strategy will calculate the quantity to buy/sell at close of current bar using the amount of money specified by the 'default_qty_value' in % from current strategy.equity (in the range from 0 to 100).", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.short", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_strategy.short", + "fragment": "const_strategy.short", + "info": "

strategy.short

Short position entry.
Type
const bool
See also
", + "description": "Short position entry.", + "type": "const bool", + "remarks": "" + }, + { + "name": "text.align_bottom", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_text.align_bottom", + "fragment": "const_text.align_bottom", + "info": "

text.align_bottom

Vertical text alignment for table.cell and table.cell_set_text_valign functions.
Type
const string
See also
", + "description": "Vertical text alignment for table.cell and table.cell_set_text_valign functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "text.align_center", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_text.align_center", + "fragment": "const_text.align_center", + "info": "

text.align_center

Label text alignment for label.new and label.set_textalign functions.
Type
const string
See also
", + "description": "Label text alignment for label.new and label.set_textalign functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "text.align_left", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_text.align_left", + "fragment": "const_text.align_left", + "info": "

text.align_left

Label text alignment for label.new and label.set_textalign functions.
Type
const string
See also
", + "description": "Label text alignment for label.new and label.set_textalign functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "text.align_right", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_text.align_right", + "fragment": "const_text.align_right", + "info": "

text.align_right

Label text alignment for label.new and label.set_textalign functions.
Type
const string
See also
", + "description": "Label text alignment for label.new and label.set_textalign functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "text.align_top", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_text.align_top", + "fragment": "const_text.align_top", + "info": "

text.align_top

Vertical text alignment for table.cell and table.cell_set_text_valign functions.
Type
const string
See also
", + "description": "Vertical text alignment for table.cell and table.cell_set_text_valign functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "xloc.bar_index", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_xloc.bar_index", + "fragment": "const_xloc.bar_index", + "info": "

xloc.bar_index

A named constant that specifies the algorithm of interpretation of x-value in functions line.new and label.new. If xloc = xloc.bar_index, value of x is a bar index.
Type
const string
See also
", + "description": "A named constant that specifies the algorithm of interpretation of x-value in functions line.new and label.new. If xloc = xloc.bar_index, value of x is a bar index.", + "type": "const string", + "remarks": "" + }, + { + "name": "xloc.bar_time", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_xloc.bar_time", + "fragment": "const_xloc.bar_time", + "info": "

xloc.bar_time

A named constant that specifies the algorithm of interpretation of x-value in functions line.new and label.new. If xloc = xloc.bar_time, value of x is a bar UNIX time.
Type
const string
See also
", + "description": "A named constant that specifies the algorithm of interpretation of x-value in functions line.new and label.new. If xloc = xloc.bar_time, value of x is a bar UNIX time.", + "type": "const string", + "remarks": "" + }, + { + "name": "yloc.abovebar", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_yloc.abovebar", + "fragment": "const_yloc.abovebar", + "info": "

yloc.abovebar

A named constant that specifies the algorithm of interpretation of y-value in function label.new.
Type
const string
See also
", + "description": "A named constant that specifies the algorithm of interpretation of y-value in function label.new.", + "type": "const string", + "remarks": "" + }, + { + "name": "yloc.belowbar", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_yloc.belowbar", + "fragment": "const_yloc.belowbar", + "info": "

yloc.belowbar

A named constant that specifies the algorithm of interpretation of y-value in function label.new.
Type
const string
See also
", + "description": "A named constant that specifies the algorithm of interpretation of y-value in function label.new.", + "type": "const string", + "remarks": "" + }, + { + "name": "yloc.price", + "url": "https://www.tradingview.com/pine-script-reference/v4/#const_yloc.price", + "fragment": "const_yloc.price", + "info": "

yloc.price

A named constant that specifies the algorithm of interpretation of y-value in function label.new.
Type
const string
See also
", + "description": "A named constant that specifies the algorithm of interpretation of y-value in function label.new.", + "type": "const string", + "remarks": "" + } +] \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/definitions/v4/functions.json b/pine-script-intellij-plugin/bin/main/definitions/v4/functions.json new file mode 100644 index 0000000..62e373c --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/definitions/v4/functions.json @@ -0,0 +1,6092 @@ +[ + { + "name": "abs()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_abs", + "fragment": "fun_abs", + "info": "

abs()

Absolute value of x is x if x >= 0, or -x otherwise.
Syntax
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]
", + "description": "Absolute value of x is x if x >= 0, or -x otherwise.", + "arguments": [], + "syntax": "abs(x) \u2192 integer", + "returnType": "integer", + "returns": "" + }, + { + "name": "acos()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_acos", + "fragment": "fun_acos", + "info": "

acos()

The acos function returns the arccosine (in radians) of number such that cos(acos(y)) = y for y in range [-1, 1].
Syntax
acos(x) \u2192 float
acos(x) \u2192 input float
acos(x) \u2192 const float
acos(x) \u2192 series[float]
", + "description": "The acos function returns the arccosine (in radians) of number such that cos(acos(y)) = y for y in range [-1, 1].", + "arguments": [], + "syntax": "acos(x) \u2192 float", + "returnType": "float", + "returns": "" + }, + { + "name": "alert()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_alert", + "fragment": "fun_alert", + "info": "

alert()

Triggers an alert event when called during the real-time bar and an alert based on alert function events was previously created for the study or strategy through the \u201cCreate Alert\u201d dialog box.
Syntax
alert(message, freq) \u2192 void
Arguments
message (series[string]) Message sent when the alert triggers. Required argument.
freq (string) The triggering frequency. Possible values are: alert.freq_all (all function calls trigger the alert), alert.freq_once_per_bar (the first function call during the bar triggers the alert), alert.freq_once_per_bar_close (the function call triggers the alert only when it occurs during the last script iteration of the real-time bar, when it closes). The default is alert.freq_once_per_bar.
Example
//@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)
Remarks
The Help Center explains how to create such alerts.
Contrary to alertcondition, alert calls do NOT count as an additional plot.
Function calls can be located in both global and local scopes.
Function calls do not display anything on the chart.
The \u2018freq\u2018 argument only affects the triggering frequency of the function call where it is used.
See also
", + "description": "Triggers an alert event when called during the real-time bar and an alert based on alert function events was previously created for the study or strategy through the \u201cCreate Alert\u201d dialog box.", + "arguments": [ + { + "argument": "message", + "type": "series[string]" + }, + { + "argument": "freq", + "type": "string" + } + ], + "syntax": "alert(message, freq) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "alertcondition()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_alertcondition", + "fragment": "fun_alertcondition", + "info": "

alertcondition()

Creates alert condition, that is available in Create Alert dialog. Please note, that alertcondition does NOT create an alert, it just gives you more options in Create Alert dialog. Also, alertcondition effect is invisible on chart.
Syntax
alertcondition(condition, title, message) \u2192 void
Arguments
condition (series) Series of boolean values that is used for alert. True values mean alert fire, false - no alert. Required argument.
title (string) Title of the alert condition. Optional argument.
message (string) Message to display when alert fires. Optional argument.
Example
alertcondition(close\u00a0>=\u00a0open,\u00a0title='Alert\u00a0on\u00a0Green\u00a0Bar',\u00a0message='Green\u00a0Bar!')
Remarks
Please note that in Pine v4 an alertcondition call generates an additional plot. All such calls are taken into account when we calculate the number of the output series per script.
See also
", + "description": "Creates alert condition, that is available in Create Alert dialog. Please note, that alertcondition does NOT create an alert, it just gives you more options in Create Alert dialog. Also, alertcondition effect is invisible on chart.", + "arguments": [ + { + "argument": "condition", + "type": "series" + }, + { + "argument": "title", + "type": "string" + }, + { + "argument": "message", + "type": "string" + } + ], + "syntax": "alertcondition(condition, title, message) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "alma()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_alma", + "fragment": "fun_alma", + "info": "

alma()

Arnaud Legoux Moving Average. It uses Gaussian distribution as weights for moving average.
Syntax
alma(series, length, offset, sigma) \u2192 series[float]
alma(series, length, offset, sigma, floor) \u2192 series[float]
Arguments
series (series[float]) Series of values to process.
length (series[integer]) Number of bars (length). Can be series[integer].
offset (float) Controls tradeoff between smoothness (closer to 1) and responsiveness (closer to 0).
sigma (float) Changes the smoothness of ALMA. The larger sigma the smoother ALMA.
floor (bool) An optional parameter. Specifies whether the offset calculation is floored before ALMA is calculated. Default value is false.
Example
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))
See also
", + "description": "Arnaud Legoux Moving Average. It uses Gaussian distribution as weights for moving average.", + "arguments": [ + { + "argument": "series", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + }, + { + "argument": "offset", + "type": "float" + }, + { + "argument": "sigma", + "type": "float" + }, + { + "argument": "floor", + "type": "bool" + } + ], + "syntax": "alma(series, length, offset, sigma) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "array.avg()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.avg", + "fragment": "fun_array.avg", + "info": "

array.avg()

The function returns the mean of an array's elements.
Syntax
array.avg(id) \u2192 series[float]
array.avg(id) \u2192 series[integer]
Arguments
id (array) An array object.
Example
//@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))
Remarks
The function requires a float or integer array.
See also
", + "description": "The function returns the mean of an array's elements.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.avg(id) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "array.clear()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.clear", + "fragment": "fun_array.clear", + "info": "

array.clear()

The function removes all elements from an array.
Syntax
array.clear(id) \u2192 void
Arguments
id (array) An array object.
Example
//@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))
See also
", + "description": "The function removes all elements from an array.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.clear(id) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "array.concat()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.concat", + "fragment": "fun_array.concat", + "info": "

array.concat()

The function is used to merge two arrays. It pushes all elements from the second array to the first array, and returns the first array.
Syntax
array.concat(id1, id2) \u2192 id1
Arguments
id1 (array) The first array object.
id2 (array) The second array object.
Example
//@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))
See also
", + "description": "The function is used to merge two arrays. It pushes all elements from the second array to the first array, and returns the first array.", + "arguments": [ + { + "argument": "id1", + "type": "array" + }, + { + "argument": "id2", + "type": "array" + } + ], + "syntax": "array.concat(id1, id2) \u2192 id1", + "returnType": "id1", + "returns": "" + }, + { + "name": "array.copy()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.copy", + "fragment": "fun_array.copy", + "info": "

array.copy()

The function creates a copy of an existing array.
Syntax
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[]
Arguments
id (array) An array object.
Example
//@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)
See also
", + "description": "The function creates a copy of an existing array.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.copy(id) \u2192 float[]", + "returnType": "float[]", + "returns": "" + }, + { + "name": "array.covariance()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.covariance", + "fragment": "fun_array.covariance", + "info": "

array.covariance()

The function returns the covariance of two arrays.
Syntax
array.covariance(id1, id2) \u2192 series[float]
Arguments
id1 (array) An array object.
id2 (array) An array object.
Example
//@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))
Remarks
The function requires a float or integer array.
See also
", + "description": "The function returns the covariance of two arrays.", + "arguments": [ + { + "argument": "id1", + "type": "array" + }, + { + "argument": "id2", + "type": "array" + } + ], + "syntax": "array.covariance(id1, id2) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "array.fill()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.fill", + "fragment": "fun_array.fill", + "info": "

array.fill()

The function sets elements of an array to a single value. If no index is specified, all elements are set. If only a start index (default 0) is supplied, the elements starting at that index are set. If both index parameters are used, the elements from the starting index up to but not including the end index (default na) are set.
Syntax
array.fill(id, value, index_from, index_to) \u2192 void
Arguments
id (array) An array object.
value (float, string, label, line) Value to fill the array with.
index_from (integer) Start index, default is 0.
index_to (integer) End index, default is na. Must be one greater than the index of the last element to set.
Example
//@version=4
study(\"array.fill\u00a0example\")
a\u00a0=\u00a0array.new_float(10)
array.fill(a,\u00a0close)
plot(array.sum(a))
See also
", + "description": "The function sets elements of an array to a single value. If no index is specified, all elements are set. If only a start index (default 0) is supplied, the elements starting at that index are set. If both index parameters are used, the elements from the starting index up to but not including the end index (default na) are set.", + "arguments": [ + { + "argument": "id", + "type": "array" + }, + { + "argument": "value", + "type": "float, string, label, line" + }, + { + "argument": "index_from", + "type": "integer" + }, + { + "argument": "index_to", + "type": "integer" + } + ], + "syntax": "array.fill(id, value, index_from, index_to) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "array.from()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.from", + "fragment": "fun_array.from", + "info": "

array.from()

The function takes a variable number of arguments with one of the types: int, float, bool, string, label, line, color, box, table, and returns an array of the corresponding type.
Syntax
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[]
Arguments
arg0, arg1, ... (const (const int, float, bool, string, label, line, color, box, table)) Array arguments.
Example
//@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)
Remarks
This function can accept up to 4,000 'int', 'float', 'bool', or 'color' arguments. For all other types the limit is 999.
", + "description": "The function takes a variable number of arguments with one of the types: int, float, bool, string, label, line, color, box, table, and returns an array of the corresponding type.", + "arguments": [ + { + "argument": "arg0, arg1, ...", + "type": "const (const int, float, bool, string, label, line, color, box, table" + } + ], + "syntax": "array.from(..args) \u2192 int[]", + "returnType": "int[]", + "returns": "" + }, + { + "name": "array.get()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.get", + "fragment": "fun_array.get", + "info": "

array.get()

The function returns the value of the element at the specified index.
Syntax
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]
Arguments
id (array) An array object.
index (integer) The index of the element whose value is to be returned.
Example
//@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))
See also
", + "description": "The function returns the value of the element at the specified index.", + "arguments": [ + { + "argument": "id", + "type": "array" + }, + { + "argument": "index", + "type": "integer" + } + ], + "syntax": "array.get(id, index) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "array.includes()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.includes", + "fragment": "fun_array.includes", + "info": "

array.includes()

The function returns true if the value was found in an array, false otherwise.
Syntax
array.includes(id, value) \u2192 series[bool]
Arguments
id (array) An array object.
value (float) The value to search in the array.
Example
//@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)
See also
", + "description": "The function returns true if the value was found in an array, false otherwise.", + "arguments": [ + { + "argument": "id", + "type": "array" + }, + { + "argument": "value", + "type": "float" + } + ], + "syntax": "array.includes(id, value) \u2192 series[bool]", + "returnType": "series[bool]", + "returns": "" + }, + { + "name": "array.indexof()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.indexof", + "fragment": "fun_array.indexof", + "info": "

array.indexof()

The function returns the index of the first occurrence of the value, or -1 if the value is not found.
Syntax
array.indexof(id, value) \u2192 series[integer]
Arguments
id (array) An array object.
value (float) The value to search in the array.
Example
//@version=4
study(\"array.indexof\u00a0example\")
a\u00a0=\u00a0array.new_float(5,high)
index\u00a0=\u00a0array.indexof(a,\u00a0high)
plot(index)
See also
", + "description": "The function returns the index of the first occurrence of the value, or -1 if the value is not found.", + "arguments": [ + { + "argument": "id", + "type": "array" + }, + { + "argument": "value", + "type": "float" + } + ], + "syntax": "array.indexof(id, value) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "array.insert()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.insert", + "fragment": "fun_array.insert", + "info": "

array.insert()

The function changes the contents of an array by adding new elements in place.
Syntax
array.insert(id, index, value) \u2192 void
Arguments
id (array) An array object.
index (integer) The index at which to insert the value.
value (float, string, label, line) The value to add to the array.
Example
//@version=4
study(\"array.insert\u00a0example\")
a\u00a0=\u00a0array.new_float(5,\u00a0close)
array.insert(a,\u00a00,\u00a0open)
plot(array.get(a,\u00a05))
See also
", + "description": "The function changes the contents of an array by adding new elements in place.", + "arguments": [ + { + "argument": "id", + "type": "array" + }, + { + "argument": "index", + "type": "integer" + }, + { + "argument": "value", + "type": "float, string, label, line" + } + ], + "syntax": "array.insert(id, index, value) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "array.join()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.join", + "fragment": "fun_array.join", + "info": "

array.join()

The function creates and returns a new string by concatenating all the elements of an array, separated by the specified separator string.
Syntax
array.join(id, separator) \u2192 series[string]
Arguments
id (array) An array object.
separator (string) The string used to separate each array element.
Example
//@version=4
study(\"array.join\u00a0example\")
a\u00a0=\u00a0array.new_float(5,\u00a05)
label.new(bar_index,\u00a0close,\u00a0array.join(a,\u00a0\",\"))
See also
", + "description": "The function creates and returns a new string by concatenating all the elements of an array, separated by the specified separator string.", + "arguments": [ + { + "argument": "id", + "type": "array" + }, + { + "argument": "separator", + "type": "string" + } + ], + "syntax": "array.join(id, separator) \u2192 series[string]", + "returnType": "series[string]", + "returns": "" + }, + { + "name": "array.lastindexof()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.lastindexof", + "fragment": "fun_array.lastindexof", + "info": "

array.lastindexof()

The function returns the index of the last occurrence of the value, or -1 if the value is not found.
Syntax
array.lastindexof(id, value) \u2192 series[integer]
Arguments
id (array) An array object.
value (float) The value to search in the array.
Example
//@version=4
study(\"array.lastindexof\u00a0example\")
a\u00a0=\u00a0array.new_float(5,high)
index\u00a0=\u00a0array.lastindexof(a,\u00a0high)
plot(index)
See also
", + "description": "The function returns the index of the last occurrence of the value, or -1 if the value is not found.", + "arguments": [ + { + "argument": "id", + "type": "array" + }, + { + "argument": "value", + "type": "float" + } + ], + "syntax": "array.lastindexof(id, value) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "array.max()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.max", + "fragment": "fun_array.max", + "info": "

array.max()

The function returns the largest value from a given array.
Syntax
array.max(id) \u2192 series[float]
array.max(id) \u2192 series[integer]
Arguments
id (array) An array object.
Example
//@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))
Remarks
The function requires a float or integer array.
See also
", + "description": "The function returns the largest value from a given array.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.max(id) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "array.median()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.median", + "fragment": "fun_array.median", + "info": "

array.median()

The function returns the median of an array's elements.
Syntax
array.median(id) \u2192 series[float]
array.median(id) \u2192 series[integer]
Arguments
id (array) An array object.
Example
//@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))
Remarks
The function requires a float or integer array.
See also
", + "description": "The function returns the median of an array's elements.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.median(id) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "array.min()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.min", + "fragment": "fun_array.min", + "info": "

array.min()

The function returns the lowest value from a given array.
Syntax
array.min(id) \u2192 series[float]
array.min(id) \u2192 series[integer]
Arguments
id (array) An array object.
Example
//@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))
Remarks
The function requires a float or integer array.
See also
", + "description": "The function returns the lowest value from a given array.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.min(id) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "array.mode()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.mode", + "fragment": "fun_array.mode", + "info": "

array.mode()

The function returns the mode of an array's elements. If there are several values with the same frequency, it returns the smallest value.
Syntax
array.mode(id) \u2192 series[float]
array.mode(id) \u2192 series[integer]
Arguments
id (array) An array object.
Example
//@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))
Remarks
The function requires a float or integer array.
See also
", + "description": "The function returns the mode of an array's elements. If there are several values with the same frequency, it returns the smallest value.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.mode(id) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "array.new_bool()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.new_bool", + "fragment": "fun_array.new_bool", + "info": "

array.new_bool()

The function creates a new array object of bool type elements.
Syntax
array.new_bool(size, initial_value) \u2192 bool[]
Arguments
size (integer) Initial size of an array. Optional. The default is 0.
initial_value (bool) Initial value of all array elements. Optional. The default is 'na'.
Example
//@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)
Remarks
An array index starts from 0.
See also
", + "description": "The function creates a new array object of bool type elements.", + "arguments": [ + { + "argument": "size", + "type": "integer" + }, + { + "argument": "initial_value", + "type": "bool" + } + ], + "syntax": "array.new_bool(size, initial_value) \u2192 bool[]", + "returnType": "bool[]", + "returns": "" + }, + { + "name": "array.new_box()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.new_box", + "fragment": "fun_array.new_box", + "info": "

array.new_box()

The function creates a new array object of box type elements.
Syntax
array.new_box(size, initial_value) \u2192 box[]
Arguments
size (integer) Initial size of an array. Optional. The default is 0.
initial_value (box) Initial value of all array elements. Optional. The default is 'na'.
Example
//@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)
Remarks
An array index starts from 0.
See also
", + "description": "The function creates a new array object of box type elements.", + "arguments": [ + { + "argument": "size", + "type": "integer" + }, + { + "argument": "initial_value", + "type": "box" + } + ], + "syntax": "array.new_box(size, initial_value) \u2192 box[]", + "returnType": "box[]", + "returns": "" + }, + { + "name": "array.new_color()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.new_color", + "fragment": "fun_array.new_color", + "info": "

array.new_color()

The function creates a new array object of color type elements.
Syntax
array.new_color(size, initial_value) \u2192 color[]
Arguments
size (integer) Initial size of an array. Optional. The default is 0.
initial_value (color) Initial value of all array elements. Optional. The default is 'na'.
Example
//@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))
Remarks
An array index starts from 0.
See also
", + "description": "The function creates a new array object of color type elements.", + "arguments": [ + { + "argument": "size", + "type": "integer" + }, + { + "argument": "initial_value", + "type": "color" + } + ], + "syntax": "array.new_color(size, initial_value) \u2192 color[]", + "returnType": "color[]", + "returns": "" + }, + { + "name": "array.new_float()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.new_float", + "fragment": "fun_array.new_float", + "info": "

array.new_float()

The function creates a new array object of float type elements.
Syntax
array.new_float(size, initial_value) \u2192 float[]
Arguments
size (integer) Initial size of an array. Optional. The default is 0.
initial_value (float) Initial value of all array elements. Optional. The default is 'na'.
Example
//@version=4
study(\"array.new_float\u00a0example\")
length\u00a0=\u00a05
a\u00a0=\u00a0array.new_float(length,\u00a0close)
plot(array.sum(a)\u00a0/\u00a0length)
Remarks
An array index starts from 0.
See also
", + "description": "The function creates a new array object of float type elements.", + "arguments": [ + { + "argument": "size", + "type": "integer" + }, + { + "argument": "initial_value", + "type": "float" + } + ], + "syntax": "array.new_float(size, initial_value) \u2192 float[]", + "returnType": "float[]", + "returns": "" + }, + { + "name": "array.new_int()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.new_int", + "fragment": "fun_array.new_int", + "info": "

array.new_int()

The function creates a new array object of int type elements.
Syntax
array.new_int(size, initial_value) \u2192 int[]
Arguments
size (integer) Initial size of an array. Optional. The default is 0.
initial_value (integer) Initial value of all array elements. Optional. The default is 'na'.
Example
//@version=4
study(\"array.new_int\u00a0example\")
length\u00a0=\u00a05
a\u00a0=\u00a0array.new_int(length,\u00a0int(close))
plot(array.sum(a)\u00a0/\u00a0length)
Remarks
An array index starts from 0.
See also
", + "description": "The function creates a new array object of int type elements.", + "arguments": [ + { + "argument": "size", + "type": "integer" + }, + { + "argument": "initial_value", + "type": "integer" + } + ], + "syntax": "array.new_int(size, initial_value) \u2192 int[]", + "returnType": "int[]", + "returns": "" + }, + { + "name": "array.new_label()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.new_label", + "fragment": "fun_array.new_label", + "info": "

array.new_label()

The function creates a new array object of label type elements.
Syntax
array.new_label(size, initial_value) \u2192 label[]
Arguments
size (integer) Initial size of an array. Optional. The default is 0.
initial_value (label) Initial value of all array elements. Optional. The default is 'na'.
Example
//@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)
Remarks
An array index starts from 0.
See also
", + "description": "The function creates a new array object of label type elements.", + "arguments": [ + { + "argument": "size", + "type": "integer" + }, + { + "argument": "initial_value", + "type": "label" + } + ], + "syntax": "array.new_label(size, initial_value) \u2192 label[]", + "returnType": "label[]", + "returns": "" + }, + { + "name": "array.new_line()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.new_line", + "fragment": "fun_array.new_line", + "info": "

array.new_line()

The function creates a new array object of line type elements.
Syntax
array.new_line(size, initial_value) \u2192 line[]
Arguments
size (integer) Initial size of an array. Optional. The default is 0.
initial_value (line) Initial value of all array elements. Optional. The default is 'na'.
Example
//@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)
Remarks
An array index starts from 0.
See also
", + "description": "The function creates a new array object of line type elements.", + "arguments": [ + { + "argument": "size", + "type": "integer" + }, + { + "argument": "initial_value", + "type": "line" + } + ], + "syntax": "array.new_line(size, initial_value) \u2192 line[]", + "returnType": "line[]", + "returns": "" + }, + { + "name": "array.new_string()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.new_string", + "fragment": "fun_array.new_string", + "info": "

array.new_string()

The function creates a new array object of string type elements.
Syntax
array.new_string(size, initial_value) \u2192 string[]
Arguments
size (integer) Initial size of an array. Optional. The default is 0.
initial_value (string) Initial value of all array elements. Optional. The default is 'na'.
Example
//@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))
Remarks
An array index starts from 0.
See also
", + "description": "The function creates a new array object of string type elements.", + "arguments": [ + { + "argument": "size", + "type": "integer" + }, + { + "argument": "initial_value", + "type": "string" + } + ], + "syntax": "array.new_string(size, initial_value) \u2192 string[]", + "returnType": "string[]", + "returns": "" + }, + { + "name": "array.new_table()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.new_table", + "fragment": "fun_array.new_table", + "info": "

array.new_table()

The function creates a new array object of table type elements.
Syntax
array.new_table(size, initial_value) \u2192 table[]
Arguments
size (integer) Initial size of an array. Optional. The default is 0.
initial_value (table) Initial value of all array elements. Optional. The default is 'na'.
Example
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)
Remarks
An array index starts from 0.
See also
", + "description": "The function creates a new array object of table type elements.", + "arguments": [ + { + "argument": "size", + "type": "integer" + }, + { + "argument": "initial_value", + "type": "table" + } + ], + "syntax": "array.new_table(size, initial_value) \u2192 table[]", + "returnType": "table[]", + "returns": "" + }, + { + "name": "array.pop()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.pop", + "fragment": "fun_array.pop", + "info": "

array.pop()

The function removes the last element from an array and returns its value.
Syntax
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]
Arguments
id (array) An array object.
Example
//@version=4
study(\"array.pop\u00a0example\")
a\u00a0=\u00a0array.new_float(5,high)
removedEl\u00a0=\u00a0array.pop(a)
plot(array.size(a))
plot(removedEl)
See also
", + "description": "The function removes the last element from an array and returns its value.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.pop(id) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "array.push()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.push", + "fragment": "fun_array.push", + "info": "

array.push()

The function appends a value to an array.
Syntax
array.push(id, value) \u2192 void
Arguments
id (array) An array object.
value (float, string, label, line) The value of the element added to the end of the array.
Example
//@version=4
study(\"array.push\u00a0example\")
a\u00a0=\u00a0array.new_float(5,\u00a00)
array.push(a,\u00a0open)
plot(array.get(a,\u00a05))
See also
", + "description": "The function appends a value to an array.", + "arguments": [ + { + "argument": "id", + "type": "array" + }, + { + "argument": "value", + "type": "float, string, label, line" + } + ], + "syntax": "array.push(id, value) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "array.range()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.range", + "fragment": "fun_array.range", + "info": "

array.range()

The function returns the difference between the min and max values from a given array.
Syntax
array.range(id) \u2192 series[float]
array.range(id) \u2192 series[integer]
Arguments
id (array) An array object.
Example
//@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))
Remarks
The function requires a float or integer array.
See also
", + "description": "The function returns the difference between the min and max values from a given array.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.range(id) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "array.remove()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.remove", + "fragment": "fun_array.remove", + "info": "

array.remove()

The function changes the contents of an array by removing the element with the specified index.
Syntax
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]
Arguments
id (array) An array object.
index (integer) The index of the element to remove.
Example
//@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)
See also
", + "description": "The function changes the contents of an array by removing the element with the specified index.", + "arguments": [ + { + "argument": "id", + "type": "array" + }, + { + "argument": "index", + "type": "integer" + } + ], + "syntax": "array.remove(id, index) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "array.reverse()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.reverse", + "fragment": "fun_array.reverse", + "info": "

array.reverse()

The function reverses an array. The first array element becomes the last, and the last array element becomes the first.
Syntax
array.reverse(id) \u2192 void
Arguments
id (array) An array object.
Example
//@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))
See also
", + "description": "The function reverses an array. The first array element becomes the last, and the last array element becomes the first.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.reverse(id) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "array.set()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.set", + "fragment": "fun_array.set", + "info": "

array.set()

The function sets the value of the element at the specified index.
Syntax
array.set(id, index, value) \u2192 void
Arguments
id (array) An array object.
index (integer) The index of the element to be modified.
value (float, string, label, line) The new value to be set.
Example
//@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)
See also
", + "description": "The function sets the value of the element at the specified index.", + "arguments": [ + { + "argument": "id", + "type": "array" + }, + { + "argument": "index", + "type": "integer" + }, + { + "argument": "value", + "type": "float, string, label, line" + } + ], + "syntax": "array.set(id, index, value) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "array.shift()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.shift", + "fragment": "fun_array.shift", + "info": "

array.shift()

The function removes an array's first element and returns its value.
Syntax
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]
Arguments
id (array) An array object.
Example
//@version=4
study(\"array.shift\u00a0example\")
a\u00a0=\u00a0array.new_float(5,high)
removedEl\u00a0=\u00a0array.shift(a)
plot(array.size(a))
plot(removedEl)
See also
", + "description": "The function removes an array's first element and returns its value.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.shift(id) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "array.size()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.size", + "fragment": "fun_array.size", + "info": "

array.size()

The function returns the number of elements in an array.
Syntax
array.size(id) \u2192 series[integer]
Arguments
id (array) An array object.
Example
//@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))
See also
", + "description": "The function returns the number of elements in an array.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.size(id) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "array.slice()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.slice", + "fragment": "fun_array.slice", + "info": "

array.slice()

The function creates a slice from an existing array. If an object from the slice changes, the changes are applied to both the new and the original arrays.
Syntax
array.slice(id, index_from, index_to) \u2192 array
Arguments
id (array) An array object.
index_from (integer) Zero-based index at which to begin extraction.
index_to (integer) Zero-based index before which to end extraction. The function extracts up to but not including the element with this index.
Example
//@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)
See also
", + "description": "The function creates a slice from an existing array. If an object from the slice changes, the changes are applied to both the new and the original arrays.", + "arguments": [ + { + "argument": "id", + "type": "array" + }, + { + "argument": "index_from", + "type": "integer" + }, + { + "argument": "index_to", + "type": "integer" + } + ], + "syntax": "array.slice(id, index_from, index_to) \u2192 array", + "returnType": "array", + "returns": "" + }, + { + "name": "array.sort()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.sort", + "fragment": "fun_array.sort", + "info": "

array.sort()

The function sorts the elements of an array.
Syntax
array.sort(id, order) \u2192 void
Arguments
id (array) An array object.
order (bool) The sort order: order.ascending (default) or order.descending.
Example
//@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))
Remarks
The function requires a float, integer or string array.
See also
", + "description": "The function sorts the elements of an array.", + "arguments": [ + { + "argument": "id", + "type": "array" + }, + { + "argument": "order", + "type": "bool" + } + ], + "syntax": "array.sort(id, order) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "array.standardize()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.standardize", + "fragment": "fun_array.standardize", + "info": "

array.standardize()

The function returns the array of standardized elements.
Syntax
array.standardize(id) \u2192 float[]
array.standardize(id) \u2192 int[]
Arguments
id (array) An array object.
Example
//@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))
Remarks
The function requires a float or integer array.
See also
", + "description": "The function returns the array of standardized elements.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.standardize(id) \u2192 float[]", + "returnType": "float[]", + "returns": "" + }, + { + "name": "array.stdev()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.stdev", + "fragment": "fun_array.stdev", + "info": "

array.stdev()

The function returns the standard deviation of an array's elements.
Syntax
array.stdev(id) \u2192 series[float]
array.stdev(id) \u2192 series[integer]
Arguments
id (array) An array object.
Example
//@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))
Remarks
The function requires a float or integer array.
See also
", + "description": "The function returns the standard deviation of an array's elements.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.stdev(id) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "array.sum()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.sum", + "fragment": "fun_array.sum", + "info": "

array.sum()

The function returns the sum of an array's elements.
Syntax
array.sum(id) \u2192 series[float]
array.sum(id) \u2192 series[integer]
Arguments
id (array) An array object.
Example
//@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))
Remarks
The function requires a float or integer array.
See also
", + "description": "The function returns the sum of an array's elements.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.sum(id) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "array.unshift()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.unshift", + "fragment": "fun_array.unshift", + "info": "

array.unshift()

The function inserts the value at the beginning of the array.
Syntax
array.unshift(id, value) \u2192 void
Arguments
id (array) An array object.
value (float) The value to add to the start of the array.
Example
//@version=4
study(\"array.unshift\u00a0example\")
a\u00a0=\u00a0array.new_float(5,\u00a00)
array.unshift(a,\u00a0open)
plot(array.get(a,\u00a00))
See also
", + "description": "The function inserts the value at the beginning of the array.", + "arguments": [ + { + "argument": "id", + "type": "array" + }, + { + "argument": "value", + "type": "float" + } + ], + "syntax": "array.unshift(id, value) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "array.variance()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_array.variance", + "fragment": "fun_array.variance", + "info": "

array.variance()

The function returns the variance of an array's elements.
Syntax
array.variance(id) \u2192 series[float]
array.variance(id) \u2192 series[integer]
Arguments
id (array) An array object.
Example
//@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))
Remarks
The function requires a float or integer array.
See also
", + "description": "The function returns the variance of an array's elements.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.variance(id) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "asin()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_asin", + "fragment": "fun_asin", + "info": "

asin()

The asin function returns the arcsine (in radians) of number such that sin(asin(y)) = y for y in range [-1, 1].
Syntax
asin(x) \u2192 float
asin(x) \u2192 input float
asin(x) \u2192 const float
asin(x) \u2192 series[float]
", + "description": "The asin function returns the arcsine (in radians) of number such that sin(asin(y)) = y for y in range [-1, 1].", + "arguments": [], + "syntax": "asin(x) \u2192 float", + "returnType": "float", + "returns": "" + }, + { + "name": "atan()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_atan", + "fragment": "fun_atan", + "info": "

atan()

The atan function returns the arctangent (in radians) of number such that tan(atan(y)) = y for any y.
Syntax
atan(x) \u2192 float
atan(x) \u2192 input float
atan(x) \u2192 const float
atan(x) \u2192 series[float]
", + "description": "The atan function returns the arctangent (in radians) of number such that tan(atan(y)) = y for any y.", + "arguments": [], + "syntax": "atan(x) \u2192 float", + "returnType": "float", + "returns": "" + }, + { + "name": "atr()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_atr", + "fragment": "fun_atr", + "info": "

atr()

Function atr (average true range) returns the RMA of true range. True range is max(high - low, abs(high - close[1]), abs(low - close[1])).
Syntax
atr(length) \u2192 series[float]
Arguments
length (integer) Length (number of bars back).
Example
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))
See also
", + "description": "Function atr (average true range) returns the RMA of true range. True range is max(high - low, abs(high - close[1]), abs(low - close[1])).", + "arguments": [ + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "atr(length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "avg()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_avg", + "fragment": "fun_avg", + "info": "

avg()

Calculates average of all given series (elementwise).
Syntax
avg(x1, x2, ...) -> series[float]
See also
", + "description": "Calculates average of all given series (elementwise).", + "arguments": [], + "syntax": "avg(x1, x2, ...) -> series[float]", + "returnType": "", + "returns": "" + }, + { + "name": "barcolor()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_barcolor", + "fragment": "fun_barcolor", + "info": "

barcolor()

Set color of bars.
Syntax
barcolor(color, offset, editable, show_last, title) \u2192 void
Arguments
color (color) Color of bars. You can use constants like 'red' or '#ff001a' as well as complex expressions like 'close >= open ? color.green : color.red'. Required argument.
offset (integer) Shifts the color series to the left or to the right on the given number of bars. Default is 0.
editable (bool) If true then barcolor style will be editable in Format dialog. Default is true.
show_last (integer) If set, defines the number of bars (from the last bar back to the past) to fill on chart.
title (string) Title of the barcolor. Optional argument.
Example
barcolor(close\u00a0<\u00a0open\u00a0?\u00a0color.black\u00a0:\u00a0color.white)
See also
", + "description": "Set color of bars.", + "arguments": [ + { + "argument": "color", + "type": "color" + }, + { + "argument": "offset", + "type": "integer" + }, + { + "argument": "editable", + "type": "bool" + }, + { + "argument": "show_last", + "type": "integer" + }, + { + "argument": "title", + "type": "string" + } + ], + "syntax": "barcolor(color, offset, editable, show_last, title) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "barssince()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_barssince", + "fragment": "fun_barssince", + "info": "

barssince()

Counts the number of bars since the last time the condition was true.
Syntax
barssince(condition) \u2192 series[integer]
Example
//\u00a0get\u00a0number\u00a0of\u00a0bars\u00a0since\u00a0last\u00a0color.green\u00a0bar
barssince(close\u00a0>=\u00a0open)
Remarks
If the condition has never been met prior to the current bar, the function returns na.
Please note that using this variable/function can cause indicator repainting.
See also
", + "description": "Counts the number of bars since the last time the condition was true.", + "arguments": [], + "syntax": "barssince(condition) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "bb()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_bb", + "fragment": "fun_bb", + "info": "

bb()

Bollinger Bands. A Bollinger Band is a technical analysis tool defined by a set of lines plotted two standard deviations (positively and negatively) away from a simple moving average (SMA) of the security's price, but can be adjusted to user preferences.
Syntax
bb(series, length, mult) \u2192 [series[float], series[float], series[float]]
Arguments
series (series[float]) Series of values to process.
length (series[integer]) Number of bars (length).
mult (float) Standard deviation factor.
Example
//@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)
See also
", + "description": "Bollinger Bands. A Bollinger Band is a technical analysis tool defined by a set of lines plotted two standard deviations (positively and negatively) away from a simple moving average (SMA) of the security's price, but can be adjusted to user preferences.", + "arguments": [ + { + "argument": "series", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + }, + { + "argument": "mult", + "type": "float" + } + ], + "syntax": "bb(series, length, mult) \u2192 [series[float], series[float], series[float]]", + "returnType": "[series[float], series[float], series[float]]", + "returns": "" + }, + { + "name": "bbw()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_bbw", + "fragment": "fun_bbw", + "info": "

bbw()

Bollinger Bands Width. The Bollinger Band Width is the difference between the upper and the lower Bollinger Bands divided by the middle band.
Syntax
bbw(series, length, mult) \u2192 series[float]
Arguments
series (series[float]) Series of values to process.
length (series[integer]) Number of bars (length).
mult (float) Standard deviation factor.
Example
//@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))
See also
", + "description": "Bollinger Bands Width. The Bollinger Band Width is the difference between the upper and the lower Bollinger Bands divided by the middle band.", + "arguments": [ + { + "argument": "series", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + }, + { + "argument": "mult", + "type": "float" + } + ], + "syntax": "bbw(series, length, mult) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "bgcolor()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_bgcolor", + "fragment": "fun_bgcolor", + "info": "

bgcolor()

Fill background of bars with specified color.
Syntax
bgcolor(color, transp, offset, editable, show_last, title) \u2192 void
Arguments
color (color) Color of the filled background. You can use constants like 'red' or '#ff001a' as well as complex expressions like 'close >= open ? color.green : color.red'. Required argument.
transp (integer) Transparency of the filled background. Possible values are from 0 (not transparent) to 100 (invisible). Optional argument.
offset (integer) Shifts the color series to the left or to the right on the given number of bars. Default is 0.
editable (bool) If true then bgcolor style will be editable in Format dialog. Default is true.
show_last (integer) If set, defines the number of bars (from the last bar back to the past) to fill on chart.
title (string) Title of the bgcolor. Optional argument.
Example
bgcolor(close\u00a0<\u00a0open\u00a0?\u00a0color.red\u00a0:\u00a0color.green,\u00a0transp=70)
See also
", + "description": "Fill background of bars with specified color.", + "arguments": [ + { + "argument": "color", + "type": "color" + }, + { + "argument": "transp", + "type": "integer" + }, + { + "argument": "offset", + "type": "integer" + }, + { + "argument": "editable", + "type": "bool" + }, + { + "argument": "show_last", + "type": "integer" + }, + { + "argument": "title", + "type": "string" + } + ], + "syntax": "bgcolor(color, transp, offset, editable, show_last, title) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "bool()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_bool", + "fragment": "fun_bool", + "info": "

bool()

Casts na to bool
Syntax
bool(x) \u2192 const bool
bool(x) \u2192 input bool
bool(x) \u2192 bool
bool(x) \u2192 series[bool]
See also
", + "description": "Casts na to bool", + "arguments": [], + "syntax": "bool(x) \u2192 const bool", + "returnType": "const bool", + "returns": "" + }, + { + "name": "box()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_box", + "fragment": "fun_box", + "info": "

box()

Casts na to box.
Syntax
box(x) \u2192 series[box]
See also
", + "description": "Casts na to box.", + "arguments": [], + "syntax": "box(x) \u2192 series[box]", + "returnType": "series[box]", + "returns": "" + }, + { + "name": "box.delete()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_box.delete", + "fragment": "fun_box.delete", + "info": "

box.delete()

Deletes the specified box object. If it has already been deleted, does nothing.
Syntax
box.delete(id) \u2192 void
Arguments
id (series[box]) A box object to delete.
See also
", + "description": "Deletes the specified box object. If it has already been deleted, does nothing.", + "arguments": [ + { + "argument": "id", + "type": "series[box]" + } + ], + "syntax": "box.delete(id) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "box.get_bottom()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_box.get_bottom", + "fragment": "fun_box.get_bottom", + "info": "

box.get_bottom()

Returns the price value of the bottom border of the box.
Syntax
box.get_bottom(id) \u2192 series[float]
Arguments
id (series[box]) A box object.
See also
", + "description": "Returns the price value of the bottom border of the box.", + "arguments": [ + { + "argument": "id", + "type": "series[box]" + } + ], + "syntax": "box.get_bottom(id) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "box.get_left()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_box.get_left", + "fragment": "fun_box.get_left", + "info": "

box.get_left()

Returns the bar index or the UNIX time (depending on the last value used for 'xloc') of the left border of the box.
Syntax
box.get_left(id) \u2192 series[integer]
Arguments
id (series[box]) A box object.
See also
", + "description": "Returns the bar index or the UNIX time (depending on the last value used for 'xloc') of the left border of the box.", + "arguments": [ + { + "argument": "id", + "type": "series[box]" + } + ], + "syntax": "box.get_left(id) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "box.get_right()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_box.get_right", + "fragment": "fun_box.get_right", + "info": "

box.get_right()

Returns the bar index or the UNIX time (depending on the last value used for 'xloc') of the right border of the box.
Syntax
box.get_right(id) \u2192 series[integer]
Arguments
id (series[box]) A box object.
See also
", + "description": "Returns the bar index or the UNIX time (depending on the last value used for 'xloc') of the right border of the box.", + "arguments": [ + { + "argument": "id", + "type": "series[box]" + } + ], + "syntax": "box.get_right(id) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "box.get_top()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_box.get_top", + "fragment": "fun_box.get_top", + "info": "

box.get_top()

Returns the price value of the top border of the box.
Syntax
box.get_top(id) \u2192 series[float]
Arguments
id (series[box]) A box object.
See also
", + "description": "Returns the price value of the top border of the box.", + "arguments": [ + { + "argument": "id", + "type": "series[box]" + } + ], + "syntax": "box.get_top(id) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "box.new()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_box.new", + "fragment": "fun_box.new", + "info": "

box.new()

Creates a new box object.
Syntax
box.new(left, top, right, bottom, border_color, border_width, border_style, extend, xloc, bgcolor) \u2192 series[box]
Arguments
left (series[integer]) Bar index (if xloc = xloc.bar_index) or UNIX time (if xloc = xloc.bar_time) of the left border of the box. Note that objects positioned using xloc.bar_index cannot be drawn further than 500 bars into the future.
top (series[float]) Price of the top border of the box.
right (series[integer]) Bar index (if xloc = xloc.bar_index) or UNIX time (if xloc = xloc.bar_time) of the right border of the box. Note that objects positioned using xloc.bar_index cannot be drawn further than 500 bars into the future.
bottom (series[float]) Price of the bottom border of the box.
border_color (series[color]) Color of the four borders. Optional. The default is color.blue.
border_width (series[integer]) Width of the four borders, in pixels. Optional. The default is 1 pixel.
border_style (series[string]) Style of the four borders. Possible values: line.style_solid, line.style_dotted, line.style_dashed. Optional. The default value is line.style_solid.
extend (series[string]) When extend.none is used, the horizontal borders start at the left border and end at the right border. With extend.left or extend.right, the horizontal borders are extended indefinitely to the left or right of the box, respectively. With extend.both, the horizontal borders are extended on both sides. Optional. The default value is extend.none.
xloc (series[string]) Determines whether the arguments to 'left' and 'right' are a bar index or a time value. If xloc = xloc.bar_index, the arguments must be a bar index. If xloc = xloc.bar_time, the arguments must be a UNIX time. Possible values: xloc.bar_index and xloc.bar_time. Optional. The default is xloc.bar_index.
bgcolor (series[color]) Background color of the box. Optional. The default is color.blue.
Example
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)
See also
", + "description": "Creates a new box object.", + "arguments": [ + { + "argument": "left", + "type": "series[integer]" + }, + { + "argument": "top", + "type": "series[float]" + }, + { + "argument": "right", + "type": "series[integer]" + }, + { + "argument": "bottom", + "type": "series[float]" + }, + { + "argument": "border_color", + "type": "series[color]" + }, + { + "argument": "border_width", + "type": "series[integer]" + }, + { + "argument": "border_style", + "type": "series[string]" + }, + { + "argument": "extend", + "type": "series[string]" + }, + { + "argument": "xloc", + "type": "series[string]" + }, + { + "argument": "bgcolor", + "type": "series[color]" + } + ], + "syntax": "box.new(left, top, right, bottom, border_color, border_width, border_style, extend, xloc, bgcolor) \u2192 series[box]", + "returnType": "series[box]", + "returns": "" + }, + { + "name": "box.set_bgcolor()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_box.set_bgcolor", + "fragment": "fun_box.set_bgcolor", + "info": "

box.set_bgcolor()

Sets the background color of the box.
Syntax
box.set_bgcolor(id, color) \u2192 void
Arguments
id (series[box]) A box object.
color (series[color]) New background color.
See also
", + "description": "Sets the background color of the box.", + "arguments": [ + { + "argument": "id", + "type": "series[box]" + }, + { + "argument": "color", + "type": "series[color]" + } + ], + "syntax": "box.set_bgcolor(id, color) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "box.set_border_color()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_box.set_border_color", + "fragment": "fun_box.set_border_color", + "info": "

box.set_border_color()

Sets the border color of the box.
Syntax
box.set_border_color(id, color) \u2192 void
Arguments
id (series[box]) A box object.
color (series[color]) New border color.
See also
", + "description": "Sets the border color of the box.", + "arguments": [ + { + "argument": "id", + "type": "series[box]" + }, + { + "argument": "color", + "type": "series[color]" + } + ], + "syntax": "box.set_border_color(id, color) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "box.set_border_style()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_box.set_border_style", + "fragment": "fun_box.set_border_style", + "info": "

box.set_border_style()

Sets the border style of the box.
Syntax
box.set_border_style(id, style) \u2192 void
Arguments
id (series[box]) A box object.
style (series[string]) New border style.
See also
", + "description": "Sets the border style of the box.", + "arguments": [ + { + "argument": "id", + "type": "series[box]" + }, + { + "argument": "style", + "type": "series[string]" + } + ], + "syntax": "box.set_border_style(id, style) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "box.set_border_width()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_box.set_border_width", + "fragment": "fun_box.set_border_width", + "info": "

box.set_border_width()

Sets the border width of the box.
Syntax
box.set_border_width(id, width) \u2192 void
Arguments
id (series[box]) A box object.
width (series[integer]) Width of the four borders, in pixels.
See also
", + "description": "Sets the border width of the box.", + "arguments": [ + { + "argument": "id", + "type": "series[box]" + }, + { + "argument": "width", + "type": "series[integer]" + } + ], + "syntax": "box.set_border_width(id, width) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "box.set_bottom()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_box.set_bottom", + "fragment": "fun_box.set_bottom", + "info": "

box.set_bottom()

Sets the bottom coordinate of the box.
Syntax
box.set_bottom(id, bottom) \u2192 void
Arguments
id (series[box]) A box object.
bottom (series[float]) Price value of the bottom border.
See also
", + "description": "Sets the bottom coordinate of the box.", + "arguments": [ + { + "argument": "id", + "type": "series[box]" + }, + { + "argument": "bottom", + "type": "series[float]" + } + ], + "syntax": "box.set_bottom(id, bottom) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "box.set_extend()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_box.set_extend", + "fragment": "fun_box.set_extend", + "info": "

box.set_extend()

Sets extending type of the border of this box object. When extend.none is used, the horizontal borders start at the left border and end at the right border. With extend.left or extend.right, the horizontal borders are extended indefinitely to the left or right of the box, respectively. With extend.both, the horizontal borders are extended on both sides.
Syntax
box.set_extend(id, extend) \u2192 void
Arguments
id (series[box]) A box object.
extend (series[string]) New extending type.
See also
", + "description": "Sets extending type of the border of this box object. When extend.none is used, the horizontal borders start at the left border and end at the right border. With extend.left or extend.right, the horizontal borders are extended indefinitely to the left or right of the box, respectively. With extend.both, the horizontal borders are extended on both sides.", + "arguments": [ + { + "argument": "id", + "type": "series[box]" + }, + { + "argument": "extend", + "type": "series[string]" + } + ], + "syntax": "box.set_extend(id, extend) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "box.set_left()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_box.set_left", + "fragment": "fun_box.set_left", + "info": "

box.set_left()

Sets the left coordinate of the box.
Syntax
box.set_left(id, left) \u2192 void
Arguments
id (series[box]) A box object.
left (series[integer]) Bar index or bar time of the left border. Note that objects positioned using xloc.bar_index cannot be drawn further than 500 bars into the future.
See also
", + "description": "Sets the left coordinate of the box.", + "arguments": [ + { + "argument": "id", + "type": "series[box]" + }, + { + "argument": "left", + "type": "series[integer]" + } + ], + "syntax": "box.set_left(id, left) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "box.set_lefttop()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_box.set_lefttop", + "fragment": "fun_box.set_lefttop", + "info": "

box.set_lefttop()

Sets the left and top coordinates of the box.
Syntax
box.set_lefttop(id, left, top) \u2192 void
Arguments
id (series[box]) A box object.
left (series[integer]) Bar index or bar time of the left border.
top (series[float]) Price value of the top border.
See also
", + "description": "Sets the left and top coordinates of the box.", + "arguments": [ + { + "argument": "id", + "type": "series[box]" + }, + { + "argument": "left", + "type": "series[integer]" + }, + { + "argument": "top", + "type": "series[float]" + } + ], + "syntax": "box.set_lefttop(id, left, top) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "box.set_right()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_box.set_right", + "fragment": "fun_box.set_right", + "info": "

box.set_right()

Sets the right coordinate of the box.
Syntax
box.set_right(id, right) \u2192 void
Arguments
id (series[box]) A box object.
right (series[integer]) Bar index or bar time of the right border. Note that objects positioned using xloc.bar_index cannot be drawn further than 500 bars into the future.
See also
", + "description": "Sets the right coordinate of the box.", + "arguments": [ + { + "argument": "id", + "type": "series[box]" + }, + { + "argument": "right", + "type": "series[integer]" + } + ], + "syntax": "box.set_right(id, right) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "box.set_rightbottom()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_box.set_rightbottom", + "fragment": "fun_box.set_rightbottom", + "info": "

box.set_rightbottom()

Sets the right and bottom coordinates of the box.
Syntax
box.set_rightbottom(id, right, bottom) \u2192 void
Arguments
id (series[box]) A box object.
right (series[integer]) Bar index or bar time of the right border.
bottom (series[float]) Price value of the bottom border.
See also
", + "description": "Sets the right and bottom coordinates of the box.", + "arguments": [ + { + "argument": "id", + "type": "series[box]" + }, + { + "argument": "right", + "type": "series[integer]" + }, + { + "argument": "bottom", + "type": "series[float]" + } + ], + "syntax": "box.set_rightbottom(id, right, bottom) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "box.set_top()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_box.set_top", + "fragment": "fun_box.set_top", + "info": "

box.set_top()

Sets the top coordinate of the box.
Syntax
box.set_top(id, top) \u2192 void
Arguments
id (series[box]) A box object.
top (series[float]) Price value of the top border.
See also
", + "description": "Sets the top coordinate of the box.", + "arguments": [ + { + "argument": "id", + "type": "series[box]" + }, + { + "argument": "top", + "type": "series[float]" + } + ], + "syntax": "box.set_top(id, top) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "cci()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_cci", + "fragment": "fun_cci", + "info": "

cci()

The CCI (commodity channel index) is calculated as the difference between the typical price of a commodity and its simple moving average, divided by the mean absolute deviation of the typical price. The index is scaled by an inverse factor of 0.015 to provide more readable numbers.
Syntax
cci(source, length) \u2192 series[float]
Arguments
source (series[float]) Series of values to process.
length (series[integer]) Number of bars (length).
", + "description": "The CCI (commodity channel index) is calculated as the difference between the typical price of a commodity and its simple moving average, divided by the mean absolute deviation of the typical price. The index is scaled by an inverse factor of 0.015 to provide more readable numbers.", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "cci(source, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "ceil()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_ceil", + "fragment": "fun_ceil", + "info": "

ceil()

The ceil function returns the smallest (closest to negative infinity) integer that is greater than or equal to the argument.
Syntax
ceil(x) \u2192 integer
ceil(x) \u2192 input integer
ceil(x) \u2192 const integer
ceil(x) \u2192 series[integer]
See also
", + "description": "The ceil function returns the smallest (closest to negative infinity) integer that is greater than or equal to the argument.", + "arguments": [], + "syntax": "ceil(x) \u2192 integer", + "returnType": "integer", + "returns": "" + }, + { + "name": "change()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_change", + "fragment": "fun_change", + "info": "

change()

Difference between current value and previous, x - x[y].
Syntax
change(source, length) \u2192 series[float]
change(source) \u2192 series[float]
Arguments
source (series[float])
length (series[integer]) Offset from the current bar to the previous bar. Optional, if not given, length = 1 is used. Can be series[integer].
See also
", + "description": "Difference between current value and previous, x - x[y].", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "change(source, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "cmo()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_cmo", + "fragment": "fun_cmo", + "info": "

cmo()

Chande Momentum Oscillator. Calculates the difference between the sum of recent gains and the sum of recent losses and then divides the result by the sum of all price movement over the same period.
Syntax
cmo(series, length) \u2192 series[float]
Arguments
series (series[float]) Series of values to process.
length (series[integer]) Number of bars (length).
Example
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))
See also
", + "description": "Chande Momentum Oscillator. Calculates the difference between the sum of recent gains and the sum of recent losses and then divides the result by the sum of all price movement over the same period.", + "arguments": [ + { + "argument": "series", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "cmo(series, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "cog()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_cog", + "fragment": "fun_cog", + "info": "

cog()

The cog (center of gravity) is an indicator based on statistics and the Fibonacci golden ratio.
Syntax
cog(source, length) \u2192 series[float]
Arguments
source (series[float]) Series of values to process.
length (series[integer]) Number of bars (length).
Example
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))
See also
", + "description": "The cog (center of gravity) is an indicator based on statistics and the Fibonacci golden ratio.", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "cog(source, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "color()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_color", + "fragment": "fun_color", + "info": "

color()

Casts na to color
Syntax
color(x) \u2192 const color
color(x) \u2192 input color
color(x) \u2192 color
color(x) \u2192 series[color]
See also
", + "description": "Casts na to color", + "arguments": [], + "syntax": "color(x) \u2192 const color", + "returnType": "const color", + "returns": "" + }, + { + "name": "color.b()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_color.b", + "fragment": "fun_color.b", + "info": "

color.b()

Retrieves the value of the color's blue component.
Syntax
color.b(color) \u2192 series[float]
color.b(color) \u2192 const float
color.b(color) \u2192 input float
Arguments
color (series[color]) Color.
Example
color.b(color.blue)
", + "description": "Retrieves the value of the color's blue component.", + "arguments": [ + { + "argument": "color", + "type": "series[color]" + } + ], + "syntax": "color.b(color) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "color.from_gradient()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_color.from_gradient", + "fragment": "fun_color.from_gradient", + "info": "

color.from_gradient()

Based on the relative position of value in the bottom_value to top_value range, the function returns a color from the gradient defined by bottom_color to top_color.
Syntax
color.from_gradient(value, bottom_value, top_value, bottom_color, top_color) \u2192 series[color]
Arguments
value (series[float]) Value to calculate the position-dependent color.
bottom_value (series[float]) Bottom position value corresponding to bottom_color.
top_value (series[float]) Top position value corresponding to top_color.
bottom_color (series[color]) Bottom position color.
top_color (series[color]) Top position color.
Example
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)
Remarks
Using this function will have an impact on the colors displayed in the script's \"Settings/Style\" tab. See the User Manual for more information.
", + "description": "Based on the relative position of value in the bottom_value to top_value range, the function returns a color from the gradient defined by bottom_color to top_color.", + "arguments": [ + { + "argument": "value", + "type": "series[float]" + }, + { + "argument": "bottom_value", + "type": "series[float]" + }, + { + "argument": "top_value", + "type": "series[float]" + }, + { + "argument": "bottom_color", + "type": "series[color]" + }, + { + "argument": "top_color", + "type": "series[color]" + } + ], + "syntax": "color.from_gradient(value, bottom_value, top_value, bottom_color, top_color) \u2192 series[color]", + "returnType": "series[color]", + "returns": "" + }, + { + "name": "color.g()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_color.g", + "fragment": "fun_color.g", + "info": "

color.g()

Retrieves the value of the color's green component.
Syntax
color.g(color) \u2192 series[float]
color.g(color) \u2192 const float
color.g(color) \u2192 input float
Arguments
color (series[color]) Color.
Example
color.g(color.green)
", + "description": "Retrieves the value of the color's green component.", + "arguments": [ + { + "argument": "color", + "type": "series[color]" + } + ], + "syntax": "color.g(color) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "color.new()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_color.new", + "fragment": "fun_color.new", + "info": "

color.new()

Function color applies the specified transparency to the given color.
Syntax
color.new(color, transp) \u2192 const color
color.new(color, transp) \u2192 series[color]
color.new(color, transp) \u2192 input color
Arguments
color (input color)
transp (input float) Possible values are from 0 (not transparent) to 100 (invisible).
Example
color.new(color.red,\u00a050)
Remarks
Using arguments that are not constants (e.g., 'simple', 'input' or 'series') will have an impact on the colors displayed in the script's \"Settings/Style\" tab. See the User Manual for more information.
", + "description": "Function color applies the specified transparency to the given color.", + "arguments": [ + { + "argument": "color", + "type": "input color" + }, + { + "argument": "transp", + "type": "input float" + } + ], + "syntax": "color.new(color, transp) \u2192 const color", + "returnType": "const color", + "returns": "" + }, + { + "name": "color.r()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_color.r", + "fragment": "fun_color.r", + "info": "

color.r()

Retrieves the value of the color's red component.
Syntax
color.r(color) \u2192 series[float]
color.r(color) \u2192 const float
color.r(color) \u2192 input float
Arguments
color (series[color]) Color.
Example
color.r(color.red)
", + "description": "Retrieves the value of the color's red component.", + "arguments": [ + { + "argument": "color", + "type": "series[color]" + } + ], + "syntax": "color.r(color) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "color.rgb()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_color.rgb", + "fragment": "fun_color.rgb", + "info": "

color.rgb()

Creates a new color with transparency using the RGB color model.
Syntax
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
Arguments
red (series[float]) Red color component. Possible values are from 0 to 255.
green (series[float]) Green color component. Possible values are from 0 to 255.
blue (series[float]) Blue color component. Possible values are from 0 to 255.
transp (series[float]) Optional. Color transparency. Possible values are from 0 (opaque) to 100 (invisible). Default value is 0.
Example
color.rgb(255,\u00a00,\u00a00,\u00a050)
Remarks
Using arguments that are not constants (e.g., 'simple', 'input' or 'series') will have an impact on the colors displayed in the script's \"Settings/Style\" tab. See the User Manual for more information.
", + "description": "Creates a new color with transparency using the RGB color model.", + "arguments": [ + { + "argument": "red", + "type": "series[float]" + }, + { + "argument": "green", + "type": "series[float]" + }, + { + "argument": "blue", + "type": "series[float]" + }, + { + "argument": "transp", + "type": "series[float]" + } + ], + "syntax": "color.rgb(red, green, blue, transp) \u2192 series[color]", + "returnType": "series[color]", + "returns": "" + }, + { + "name": "color.t()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_color.t", + "fragment": "fun_color.t", + "info": "

color.t()

Retrieves the color's transparency.
Syntax
color.t(color) \u2192 series[float]
color.t(color) \u2192 const float
color.t(color) \u2192 input float
Arguments
color (series[color]) Color.
Example
color.t(color.new(color.red,\u00a050))
", + "description": "Retrieves the color's transparency.", + "arguments": [ + { + "argument": "color", + "type": "series[color]" + } + ], + "syntax": "color.t(color) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "correlation()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_correlation", + "fragment": "fun_correlation", + "info": "

correlation()

Correlation coefficient. Describes the degree to which two series tend to deviate from their sma values.
Syntax
correlation(source_a, source_b, length) \u2192 series[float]
Arguments
source_a (series[float]) Source series.
source_b (series[float]) Target series.
length (series[integer]) Length (number of bars back).
See also
", + "description": "Correlation coefficient. Describes the degree to which two series tend to deviate from their sma values.", + "arguments": [ + { + "argument": "source_a", + "type": "series[float]" + }, + { + "argument": "source_b", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "correlation(source_a, source_b, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "cos()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_cos", + "fragment": "fun_cos", + "info": "

cos()

The cos function returns the trigonometric cosine of an angle.
Syntax
cos(x) \u2192 float
cos(x) \u2192 input float
cos(x) \u2192 const float
cos(x) \u2192 series[float]
Arguments
x (series[float]) Angle, in radians.
", + "description": "The cos function returns the trigonometric cosine of an angle.", + "arguments": [ + { + "argument": "x", + "type": "series[float]" + } + ], + "syntax": "cos(x) \u2192 float", + "returnType": "float", + "returns": "" + }, + { + "name": "cross()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_cross", + "fragment": "fun_cross", + "info": "

cross()

Syntax
cross(x, y) \u2192 series[bool]
Arguments
x (series)
y (series)
See also
", + "description": "", + "arguments": [ + { + "argument": "x", + "type": "series" + }, + { + "argument": "y", + "type": "series" + } + ], + "syntax": "cross(x, y) \u2192 series[bool]", + "returnType": "series[bool]", + "returns": "" + }, + { + "name": "crossover()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_crossover", + "fragment": "fun_crossover", + "info": "

crossover()

The 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.
Syntax
crossover(x, y) \u2192 series[bool]
Arguments
x (float) Data series x.
y (float) Data series y.
", + "description": "The 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()

The 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.
Syntax
crossunder(x, y) \u2192 series[bool]
Arguments
x (float) Data series x.
y (float) Data series y.
", + "description": "The 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()

Cumulative (total) sum of x. In other words it's a sum of all elements of x.
Syntax
cum(x) \u2192 series[float]
Arguments
x (series)
See also
", + "description": "Cumulative (total) sum of x. In other words it's a sum of all elements of x.", + "arguments": [ + { + "argument": "x", + "type": "series" + } + ], + "syntax": "cum(x) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "dayofmonth()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_dayofmonth", + "fragment": "fun_dayofmonth", + "info": "

dayofmonth()

Syntax
dayofmonth(time) \u2192 series[integer]
dayofmonth(time, timezone) \u2192 series[integer]
Arguments
time (series) UNIX time in milliseconds.
timezone (string) An optional parameter. Timezone.
Remarks
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970. By default, the Timezone is syminfo.timezone, possible values can be seen in timestamp.
Note that this function returns the day based on the time of the bar's open. For overnight sessions (e.g. EURUSD, where Monday session starts on Sunday, 17:00 UTC-4) this value can be lower by 1 than the day of the trading day.
See also
", + "description": "", + "arguments": [ + { + "argument": "time", + "type": "series" + }, + { + "argument": "timezone", + "type": "string" + } + ], + "syntax": "dayofmonth(time) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "dayofweek()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_dayofweek", + "fragment": "fun_dayofweek", + "info": "

dayofweek()

Syntax
dayofweek(time) \u2192 series[integer]
dayofweek(time, timezone) \u2192 series[integer]
Arguments
time (series) UNIX time in milliseconds.
timezone (string) An optional parameter. Timezone.
Remarks
Note that this function returns the day based on the time of the bar's open. For overnight sessions (e.g. EURUSD, where Monday session starts on Sunday, 17:00) this value can be lower by 1 than the day of the trading day.
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970. By default, the Timezone is syminfo.timezone, possible values can be seen in timestamp.
See also
", + "description": "", + "arguments": [ + { + "argument": "time", + "type": "series" + }, + { + "argument": "timezone", + "type": "string" + } + ], + "syntax": "dayofweek(time) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "dev()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_dev", + "fragment": "fun_dev", + "info": "

dev()

Measure of difference between the series and it's sma
Syntax
dev(source, length) \u2192 series[float]
Arguments
source (series[float]) Series of values to process.
length (series[integer]) Number of bars (length).
Example
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))
See also
", + "description": "Measure of difference between the series and it's sma", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "dev(source, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "dividends()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_dividends", + "fragment": "fun_dividends", + "info": "

dividends()

Requests dividends data for the specified symbol.
Syntax
dividends(ticker, field, gaps, lookahead, ignore_invalid_symbol) \u2192 series[float]
Arguments
ticker (string) Symbol. Note that the symbol should be passed with a prefix. For example: \"NASDAQ:AAPL\" instead of \"AAPL\". Using syminfo.ticker will cause an error. Use syminfo.tickerid instead.
field (string) Input string. Possible values include: dividends.net, dividends.gross. Default value is dividends.gross.
gaps (bool) Merge strategy for the requested data (requested data automatically merges with the main series OHLC data). Possible values: barmerge.gaps_on, barmerge.gaps_off. barmerge.gaps_on - requested data is merged with possible gaps (na values). barmerge.gaps_off - requested data is merged continuously without gaps, all the gaps are filled with the previous nearest existing values. Default value is barmerge.gaps_off.
lookahead (bool) Merge strategy for the requested data position. Possible values: barmerge.lookahead_on, barmerge.lookahead_off. Default value is barmerge.lookahead_off starting from version 3. Note that behavour is the same on real-time, and differs only on history.
ignore_invalid_symbol (const bool) An optional parameter. Determines the behavior of the function if the specified symbol is not found: if false, the script will halt and return a runtime error; if true, the function will return na and execution will continue. The default value is false.
Example
s1\u00a0=\u00a0dividends(\"NASDAQ:BELFA\")
plot(s1)
s2\u00a0=\u00a0dividends(\"NASDAQ:BELFA\",\u00a0dividends.net,\u00a0gaps=barmerge.gaps_on,\u00a0lookahead=barmerge.lookahead_on)
plot(s2)
See also
", + "description": "Requests dividends data for the specified symbol.", + "arguments": [ + { + "argument": "ticker", + "type": "string" + }, + { + "argument": "field", + "type": "string" + }, + { + "argument": "gaps", + "type": "bool" + }, + { + "argument": "lookahead", + "type": "bool" + }, + { + "argument": "ignore_invalid_symbol", + "type": "const bool" + } + ], + "syntax": "dividends(ticker, field, gaps, lookahead, ignore_invalid_symbol) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "dmi()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_dmi", + "fragment": "fun_dmi", + "info": "

dmi()

The dmi function returns the directional movement index.
Syntax
dmi(diLength, adxSmoothing) \u2192 [series[float], series[float], series[float]]
Arguments
diLength (integer) DI Period.
adxSmoothing (integer) ADX Smoothing Period.
Example
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\")
See also
", + "description": "The dmi function returns the directional movement index.", + "arguments": [ + { + "argument": "diLength", + "type": "integer" + }, + { + "argument": "adxSmoothing", + "type": "integer" + } + ], + "syntax": "dmi(diLength, adxSmoothing) \u2192 [series[float], series[float], series[float]]", + "returnType": "[series[float], series[float], series[float]]", + "returns": "" + }, + { + "name": "earnings()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_earnings", + "fragment": "fun_earnings", + "info": "

earnings()

Requests earnings data for the specified symbol.
Syntax
earnings(ticker, field, gaps, lookahead, ignore_invalid_symbol) \u2192 series[float]
Arguments
ticker (string) Symbol. Note that the symbol should be passed with a prefix. For example: \"NASDAQ:AAPL\" instead of \"AAPL\". Using syminfo.ticker will cause an error. Use syminfo.tickerid instead.
field (string) Input string. Possible values include: earnings.actual, earnings.estimate. Default value is earnings.actual.
gaps (bool) Merge strategy for the requested data (requested data automatically merges with the main series OHLC data). Possible values: barmerge.gaps_on, barmerge.gaps_off. barmerge.gaps_on - requested data is merged with possible gaps (na values). barmerge.gaps_off - requested data is merged continuously without gaps, all the gaps are filled with the previous nearest existing values. Default value is barmerge.gaps_off.
lookahead (bool) Merge strategy for the requested data position. Possible values: barmerge.lookahead_on, barmerge.lookahead_off. Default value is barmerge.lookahead_off starting from version 3. Note that behavour is the same on real-time, and differs only on history.
ignore_invalid_symbol (const bool) An optional parameter. Determines the behavior of the function if the specified symbol is not found: if false, the script will halt and return a runtime error; if true, the function will return na and execution will continue. The default value is false.
Example
s1\u00a0=\u00a0earnings(\"NASDAQ:BELFA\")
plot(s1)
s2\u00a0=\u00a0earnings(\"NASDAQ:BELFA\",\u00a0earnings.actual,\u00a0gaps=barmerge.gaps_on,\u00a0lookahead=barmerge.lookahead_on)
plot(s2)
See also
", + "description": "Requests earnings data for the specified symbol.", + "arguments": [ + { + "argument": "ticker", + "type": "string" + }, + { + "argument": "field", + "type": "string" + }, + { + "argument": "gaps", + "type": "bool" + }, + { + "argument": "lookahead", + "type": "bool" + }, + { + "argument": "ignore_invalid_symbol", + "type": "const bool" + } + ], + "syntax": "earnings(ticker, field, gaps, lookahead, ignore_invalid_symbol) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "ema()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_ema", + "fragment": "fun_ema", + "info": "

ema()

The ema function returns the exponentially weighted moving average. In ema weighting factors decrease exponentially. It calculates by using a formula: EMA = alpha * x + (1 - alpha) * EMA[1], where alpha = 2 / (y + 1)
Syntax
ema(source, length) \u2192 series[float]
Arguments
source (series) Series of values to process.
length (integer) Number of bars (length).
Example
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))
Remarks
Please note that using this variable/function can cause indicator repainting.
See also
", + "description": "The ema function returns the exponentially weighted moving average. In ema weighting factors decrease exponentially. It calculates by using a formula: EMA = alpha * x + (1 - alpha) * EMA[1], where alpha = 2 / (y + 1)", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "ema(source, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "exp()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_exp", + "fragment": "fun_exp", + "info": "

exp()

The exp function of x is e^x, where x is the argument and e is Euler's number.
Syntax
exp(x) \u2192 float
exp(x) \u2192 input float
exp(x) \u2192 const float
exp(x) \u2192 series[float]
See also
", + "description": "The exp function of x is e^x, where x is the argument and e is Euler's number.", + "arguments": [], + "syntax": "exp(x) \u2192 float", + "returnType": "float", + "returns": "" + }, + { + "name": "falling()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_falling", + "fragment": "fun_falling", + "info": "

falling()

Test if the x series is now falling for y bars long.
Syntax
falling(source, length) \u2192 series[bool]
Arguments
source (series[float]) Series of values to process.
length (series[integer]) Number of bars (length).
See also
", + "description": "Test if the x series is now falling for y bars long.", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "falling(source, length) \u2192 series[bool]", + "returnType": "series[bool]", + "returns": "" + }, + { + "name": "fill()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_fill", + "fragment": "fun_fill", + "info": "

fill()

Fills background between two plots or hlines with a given color.
Syntax
fill(hline1, hline2, color, transp, title, editable, fillgaps) \u2192 void
fill(plot1, plot2, color, transp, title, editable, show_last, fillgaps) \u2192 void
Arguments
hline1 (hline) The first hline object. Required argument.
hline2 (hline) The second hline object. Required argument.
plot1 (plot) The first plot object. Required argument.
plot2 (plot) The second plot object. Required argument.
color (color) Color of the plot. You can use constants like 'color=color.red' or 'color=#ff001a' as well as complex expressions like 'color = close >= open ? color.green : color.red'. Optional argument.
transp (integer) Transparency of the filled background. Possible values are from 0 (not transparent) to 100 (invisible). Optional argument.
title (string) Title of the created fill object. Optional argument.
editable (bool) If true then fill style will be editable in Format dialog. Default is true.
show_last (integer) If set, defines the number of bars (from the last bar back to the past) to fill on chart.
fillgaps (bool) Controls continuing fills on gaps, i.e., when one of the plot() calls returns an na value. When true, the last fill will continue on gaps. The default is false.
Example
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)
See also
", + "description": "Fills background between two plots or hlines with a given color.", + "arguments": [ + { + "argument": "hline1", + "type": "hline" + }, + { + "argument": "hline2", + "type": "hline" + }, + { + "argument": "plot1", + "type": "plot" + }, + { + "argument": "plot2", + "type": "plot" + }, + { + "argument": "color", + "type": "color" + }, + { + "argument": "transp", + "type": "integer" + }, + { + "argument": "title", + "type": "string" + }, + { + "argument": "editable", + "type": "bool" + }, + { + "argument": "show_last", + "type": "integer" + }, + { + "argument": "fillgaps", + "type": "bool" + } + ], + "syntax": "fill(hline1, hline2, color, transp, title, editable, fillgaps) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "financial()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_financial", + "fragment": "fun_financial", + "info": "

financial()

Requests financial series for symbol.
Syntax
financial(symbol, financial_id, period, gaps, ignore_invalid_symbol) \u2192 series[float]
Arguments
symbol (string) Symbol. Note that the symbol should be passed with a prefix. For example: \"NASDAQ:AAPL\" instead of \"AAPL\".
financial_id (string) Financial identifier. You can find the list of available ids via our Help Center.
period (string) Reporting period. Possible values are \"TTM\", \"FY\", \"FQ\".
gaps (bool) Merge strategy for the requested data (requested data automatically merges with the main series: OHLC data). Possible values include: barmerge.gaps_on, barmerge.gaps_off. barmerge.gaps_on - requested data is merged with possible gaps (na values). barmerge.gaps_off - requested data is merged continuously without gaps, all the gaps are filled with the previous, nearest existing values. Default value is barmerge.gaps_off.
ignore_invalid_symbol (const bool) An optional parameter. Determines the behavior of the function if the specified symbol is not found: if false, the script will halt and return a runtime error; if true, the function will return na and execution will continue. The default value is false.
Example
f\u00a0=\u00a0financial(\"NASDAQ:MSFT\",\u00a0\"ACCOUNTS_PAYABLE\",\u00a0\"FY\")
plot(f)
See also
", + "description": "Requests financial series for symbol.", + "arguments": [ + { + "argument": "symbol", + "type": "string" + }, + { + "argument": "financial_id", + "type": "string" + }, + { + "argument": "period", + "type": "string" + }, + { + "argument": "gaps", + "type": "bool" + }, + { + "argument": "ignore_invalid_symbol", + "type": "const bool" + } + ], + "syntax": "financial(symbol, financial_id, period, gaps, ignore_invalid_symbol) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "fixnan()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_fixnan", + "fragment": "fun_fixnan", + "info": "

fixnan()

For a given series replaces NaN values with previous nearest non-NaN value.
Syntax
fixnan(x) \u2192 series[float]
fixnan(x) \u2192 series[integer]
fixnan(x) \u2192 series[bool]
fixnan(x) \u2192 series[color]
Arguments
x (series)
See also
", + "description": "For a given series replaces NaN values with previous nearest non-NaN value.", + "arguments": [ + { + "argument": "x", + "type": "series" + } + ], + "syntax": "fixnan(x) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "float()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_float", + "fragment": "fun_float", + "info": "

float()

Casts na to float
Syntax
float(x) \u2192 const float
float(x) \u2192 input float
float(x) \u2192 float
float(x) \u2192 series[float]
See also
", + "description": "Casts na to float", + "arguments": [], + "syntax": "float(x) \u2192 const float", + "returnType": "const float", + "returns": "" + }, + { + "name": "floor()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_floor", + "fragment": "fun_floor", + "info": "

floor()

Syntax
floor(x) \u2192 integer
floor(x) \u2192 input integer
floor(x) \u2192 const integer
floor(x) \u2192 series[integer]
See also
", + "description": "", + "arguments": [], + "syntax": "floor(x) \u2192 integer", + "returnType": "integer", + "returns": "" + }, + { + "name": "heikinashi()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_heikinashi", + "fragment": "fun_heikinashi", + "info": "

heikinashi()

Creates a ticker identifier for requesting Heikin Ashi bar values.
Syntax
heikinashi(symbol) \u2192 string
Arguments
symbol (string) Symbol ticker identifier.
Example
heikinashi_close\u00a0=\u00a0security(heikinashi(syminfo.tickerid),\u00a0timeframe.period,\u00a0close)

heikinashi_aapl_60_close\u00a0=\u00a0security(heikinashi(\"AAPL\"),\u00a0\"60\",\u00a0close)
See also
", + "description": "Creates a ticker identifier for requesting Heikin Ashi bar values.", + "arguments": [ + { + "argument": "symbol", + "type": "string" + } + ], + "syntax": "heikinashi(symbol) \u2192 string", + "returnType": "string", + "returns": "" + }, + { + "name": "highest()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_highest", + "fragment": "fun_highest", + "info": "

highest()

Highest value for a given number of bars back.
Syntax
highest(source, length) \u2192 series[float]
highest(length) \u2192 series[float]
Arguments
source (series[float])
length (series[integer])
Remarks
Two args version: x is a series and y is a length.
One arg version: x is a length. Algorithm uses high as a source series.
See also
", + "description": "Highest value for a given number of bars back.", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "highest(source, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "highestbars()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_highestbars", + "fragment": "fun_highestbars", + "info": "

highestbars()

Highest value offset for a given number of bars back.
Syntax
highestbars(source, length) \u2192 series[integer]
highestbars(length) \u2192 series[integer]
Arguments
source (series[float])
length (series[integer])
Remarks
Two args version: x is a series and y is a length.
One arg version: x is a length. Algorithm uses high as a source series.
See also
", + "description": "Highest value offset for a given number of bars back.", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "highestbars(source, length) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "hline()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_hline", + "fragment": "fun_hline", + "info": "

hline()

Renders a horizontal line at a given fixed price level.
Syntax
hline(price, title, color, linestyle, linewidth, editable) \u2192 hline
Arguments
price (float) Price value at which the object will be rendered. Required argument.
title (string) Title of the object.
color (color) Color of the rendered line. Must be a constant value (not an expression). Optional argument.
linestyle (integer) Style of the rendered line. Possible values are: hline.style_solid, hline.style_dotted, hline.style_dashed. Optional argument.
linewidth (integer) Width of the rendered line. Default value is 1.
editable (bool) If true then hline style will be editable in Format dialog. Default is true.
Example
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)
See also
", + "description": "Renders a horizontal line at a given fixed price level.", + "arguments": [ + { + "argument": "price", + "type": "float" + }, + { + "argument": "title", + "type": "string" + }, + { + "argument": "color", + "type": "color" + }, + { + "argument": "linestyle", + "type": "integer" + }, + { + "argument": "linewidth", + "type": "integer" + }, + { + "argument": "editable", + "type": "bool" + } + ], + "syntax": "hline(price, title, color, linestyle, linewidth, editable) \u2192 hline", + "returnType": "hline", + "returns": "" + }, + { + "name": "hma()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_hma", + "fragment": "fun_hma", + "info": "

hma()

The hma function returns the Hull Moving Average.
Syntax
hma(source, length) \u2192 series[float]
Arguments
source (series) Series of values to process.
length (integer) Number of bars.
Example
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)
See also
", + "description": "The hma function returns the Hull Moving Average.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "hma(source, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "hour()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_hour", + "fragment": "fun_hour", + "info": "

hour()

Syntax
hour(time) \u2192 series[integer]
hour(time, timezone) \u2192 series[integer]
Arguments
time (series) UNIX time in milliseconds.
timezone (string) An optional parameter. Timezone.
Remarks
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970. By default, the Timezone is syminfo.timezone, possible values can be seen in timestamp.
See also
", + "description": "", + "arguments": [ + { + "argument": "time", + "type": "series" + }, + { + "argument": "timezone", + "type": "string" + } + ], + "syntax": "hour(time) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "iff()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_iff", + "fragment": "fun_iff", + "info": "

iff()

If ... then ... else ...
Syntax
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>]
Arguments
condition (series) Series with condition values. Zero value (0 and also NaN, +Infinity, -Infinity) is considered to be false, any other value is true.
then (series) Series with values to return if condition is true.
_else (series) Series with values to return if condition is false. Use na for _else argument if you do not need 'else' branch.
Example
//\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)
Remarks
iff does exactly the same thing as ternary conditional operator ?: but in a functional style. Also iff is slightly less efficient than operator ?:
See also
", + "description": "If ... then ... else ...", + "arguments": [ + { + "argument": "condition", + "type": "series" + }, + { + "argument": "then", + "type": "series" + }, + { + "argument": "_else", + "type": "series" + } + ], + "syntax": "iff(condition, then, _else) \u2192 bool", + "returnType": "bool", + "returns": "" + }, + { + "name": "input()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_input", + "fragment": "fun_input", + "info": "

input()

Adds an input to your script indicator. User can see and edit inputs on the Format Object dialog of the script study. Script inputs look and behave exactly the same as inputs of built-in Technical Analysis indicators.
Syntax
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]
Arguments
defval (Its type must match the type defined with the 'type' parameter's value) Determines the default value of the input variable proposed in the script's \"Settings/Inputs\" tab, from where the user can change it. When used with the input.time type, the value can be a timestamp function, but only if it uses a date argument in const string format.
title (const string) Title of the input. If not specified, the variable name is used as the input's title. If the title is specified, but it is empty, the name will be an empty string.
minval (const integer, float) Minimal possible value of the input variable. This argument is used only when input type is input.integer or input.float.
maxval (const integer, float) Maximum possible value of the input variable. This argument is used only when input type is input.integer or input.float.
confirm (const bool) If true, the user will be asked to confirm the input value when the indicator is added to the chart. If true and the input is of type input.time or input.price, then an interactive input mode is enabled, where the selection is made by clicking on the chart, or by selecting the indicator and moving the selection after that. This argument cannot be used with inputs of type input.source. Optional. The default is false.
step (const integer, float) Step value to use for incrementing/decrementing input from format dialog. Default value is 1. This argument is used only for input types input.integer and input.float.
options (List of constants: [<type>...]) A list of options to choose from. This argument is used only for input types input.integer, input.float and input.string.
tooltip (const string) The string that will be shown to the user when hovering over the tooltip icon.
inline (const string) Combines all the input calls using the same argument in one line. The string used as an argument is not displayed. It is only used to identify inputs belonging to the same line.
group (const string) Creates a header above all inputs using the same group argument string. The string is also used as the header's text.
Example
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)
Remarks
Result of input function always should be assigned to a variable, see examples above.
", + "description": "Adds an input to your script indicator. User can see and edit inputs on the Format Object dialog of the script study. Script inputs look and behave exactly the same as inputs of built-in Technical Analysis indicators.", + "arguments": [ + { + "argument": "defval", + "type": "Its type must match the type defined with the 'type' parameter's value" + }, + { + "argument": "title", + "type": "const string" + }, + { + "argument": "type", + "type": "const string" + }, + { + "argument": "minval", + "type": "const integer, float" + }, + { + "argument": "maxval", + "type": "const integer, float" + }, + { + "argument": "confirm", + "type": "const bool" + }, + { + "argument": "step", + "type": "const integer, float" + }, + { + "argument": "options", + "type": "List of constants: [...]" + }, + { + "argument": "tooltip", + "type": "const string" + }, + { + "argument": "inline", + "type": "const string" + }, + { + "argument": "group", + "type": "const string" + } + ], + "syntax": "input(defval, title, type, confirm, tooltip, inline, group) \u2192 input bool", + "returnType": "input bool", + "returns": "" + }, + { + "name": "int()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_int", + "fragment": "fun_int", + "info": "

int()

Casts na or truncates float value to int
Syntax
int(x) \u2192 integer
int(x) \u2192 input integer
int(x) \u2192 const integer
int(x) \u2192 series[integer]
See also
", + "description": "Casts na or truncates float value to int", + "arguments": [], + "syntax": "int(x) \u2192 integer", + "returnType": "integer", + "returns": "" + }, + { + "name": "kagi()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_kagi", + "fragment": "fun_kagi", + "info": "

kagi()

Creates a ticker identifier for requesting Kagi values.
Syntax
kagi(symbol, reversal) \u2192 string
Arguments
symbol (string) Symbol ticker identifier.
reversal (float) Reversal amount (absolute price value).
Example
kagi_tickerid\u00a0=\u00a0kagi(syminfo.tickerid,\u00a03)
kagi_close\u00a0=\u00a0security(kagi_tickerid,\u00a0timeframe.period,\u00a0close)
plot(kagi_close)
See also
", + "description": "Creates a ticker identifier for requesting Kagi values.", + "arguments": [ + { + "argument": "symbol", + "type": "string" + }, + { + "argument": "reversal", + "type": "float" + } + ], + "syntax": "kagi(symbol, reversal) \u2192 string", + "returnType": "string", + "returns": "" + }, + { + "name": "kc()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_kc", + "fragment": "fun_kc", + "info": "

kc()

Keltner Channels. Keltner channel is a technical analysis indicator showing a central moving average line plus channel lines at a distance above and below.
Syntax
kc(series, length, mult) \u2192 [series[float], series[float], series[float]]
kc(series, length, mult, useTrueRange) \u2192 [series[float], series[float], series[float]]
Arguments
series (series) Series of values to process.
length (integer) Number of bars (length).
mult (float) Standard deviation factor.
useTrueRange (bool) An optional parameter. Specifies if True Range is used; default is true. If the value is false, the range will be calculated with the expression (high - low).
Example
//@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)
See also
", + "description": "Keltner Channels. Keltner channel is a technical analysis indicator showing a central moving average line plus channel lines at a distance above and below.", + "arguments": [ + { + "argument": "series", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + }, + { + "argument": "mult", + "type": "float" + }, + { + "argument": "useTrueRange", + "type": "bool" + } + ], + "syntax": "kc(series, length, mult) \u2192 [series[float], series[float], series[float]]", + "returnType": "[series[float], series[float], series[float]]", + "returns": "" + }, + { + "name": "kcw()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_kcw", + "fragment": "fun_kcw", + "info": "

kcw()

Keltner Channels Width. The Keltner Channels Width is the difference between the upper and the lower Keltner Channels divided by the middle channel.
Syntax
kcw(series, length, mult) \u2192 series[float]
kcw(series, length, mult, useTrueRange) \u2192 series[float]
Arguments
series (series) Series of values to process.
length (integer) Number of bars (length).
mult (float) Standard deviation factor.
useTrueRange (bool) An optional parameter. Specifies if True Range is used; default is true. If the value is false, the range will be calculated with the expression (high - low).
Example
//@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))
See also
", + "description": "Keltner Channels Width. The Keltner Channels Width is the difference between the upper and the lower Keltner Channels divided by the middle channel.", + "arguments": [ + { + "argument": "series", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + }, + { + "argument": "mult", + "type": "float" + }, + { + "argument": "useTrueRange", + "type": "bool" + } + ], + "syntax": "kcw(series, length, mult) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "label()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_label", + "fragment": "fun_label", + "info": "

label()

Casts na to label
Syntax
label(x) \u2192 series[label]
See also
", + "description": "Casts na to label", + "arguments": [], + "syntax": "label(x) \u2192 series[label]", + "returnType": "series[label]", + "returns": "" + }, + { + "name": "label.delete()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_label.delete", + "fragment": "fun_label.delete", + "info": "

label.delete()

Deletes the specified label object. If it has already been deleted, does nothing.
Syntax
label.delete(id) \u2192 void
Arguments
id (label) Label object to delete.
See also
", + "description": "Deletes the specified label object. If it has already been deleted, does nothing.", + "arguments": [ + { + "argument": "id", + "type": "label" + } + ], + "syntax": "label.delete(id) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "label.get_text()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_label.get_text", + "fragment": "fun_label.get_text", + "info": "

label.get_text()

Returns the text of this label object.
Syntax
label.get_text(id) \u2192 series[string]
Arguments
id (label) Label object.
Example
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)
See also
", + "description": "Returns the text of this label object.", + "arguments": [ + { + "argument": "id", + "type": "label" + } + ], + "syntax": "label.get_text(id) \u2192 series[string]", + "returnType": "series[string]", + "returns": "" + }, + { + "name": "label.get_x()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_label.get_x", + "fragment": "fun_label.get_x", + "info": "

label.get_x()

Returns UNIX time or bar index (depending on the last xloc value set) of this label's position.
Syntax
label.get_x(id) \u2192 series[integer]
Arguments
id (label) Label object.
Example
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\u00a0plot
See also
", + "description": "Returns UNIX time or bar index (depending on the last xloc value set) of this label's position.", + "arguments": [ + { + "argument": "id", + "type": "label" + } + ], + "syntax": "label.get_x(id) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "label.get_y()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_label.get_y", + "fragment": "fun_label.get_y", + "info": "

label.get_y()

Returns price of this label's position.
Syntax
label.get_y(id) \u2192 series[float]
Arguments
id (label) Label object.
See also
", + "description": "Returns price of this label's position.", + "arguments": [ + { + "argument": "id", + "type": "label" + } + ], + "syntax": "label.get_y(id) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "label.new()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_label.new", + "fragment": "fun_label.new", + "info": "

label.new()

Creates new label object.
Syntax
label.new(x, y, text, xloc, yloc, color, style, textcolor, size, textalign, tooltip) \u2192 series[label]
Arguments
x (series) Bar index (if xloc = xloc.bar_index) or bar UNIX time (if xloc = xloc.bar_time) of the label position. Note that objects positioned using xloc.bar_index cannot be drawn further than 500 bars into the future.
y (series) Price of the label position. It is taken into account only if yloc=yloc.price.
text (string) Label text. Default is empty string.
xloc (string) See description of x argument. Possible values: xloc.bar_index and xloc.bar_time. Default is xloc.bar_index.
yloc (string) Possible values are yloc.price, yloc.abovebar, yloc.belowbar. If yloc=yloc.price, y argument specifies the price of the label position. If yloc=yloc.abovebar, label is located above bar. If yloc=yloc.belowbar, label is located below bar. Default is yloc.price.
color (color) Color of the label border and arrow
textcolor (color) Text color.
size (string) Label size. Possible values: size.auto, size.tiny, size.small, size.normal, size.large, size.huge. Default value is size.normal.
textalign (string) Label text alignment. Possible values: text.align_left, text.align_center, text.align_right. Default value is text.align_center.
tooltip (string) Hover to see tooltip label.
Example
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)
See also
", + "description": "Creates new label object.", + "arguments": [ + { + "argument": "x", + "type": "series" + }, + { + "argument": "y", + "type": "series" + }, + { + "argument": "text", + "type": "string" + }, + { + "argument": "xloc", + "type": "string" + }, + { + "argument": "yloc", + "type": "string" + }, + { + "argument": "color", + "type": "color" + }, + { + "argument": "style", + "type": "string" + }, + { + "argument": "textcolor", + "type": "color" + }, + { + "argument": "size", + "type": "string" + }, + { + "argument": "textalign", + "type": "string" + }, + { + "argument": "tooltip", + "type": "string" + } + ], + "syntax": "label.new(x, y, text, xloc, yloc, color, style, textcolor, size, textalign, tooltip) \u2192 series[label]", + "returnType": "series[label]", + "returns": "" + }, + { + "name": "label.set_color()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_label.set_color", + "fragment": "fun_label.set_color", + "info": "

label.set_color()

Sets label border and arrow color.
Syntax
label.set_color(id, color) \u2192 void
Arguments
id (label) Label object.
color (color) New label border and arrow color.
See also
", + "description": "Sets label border and arrow color.", + "arguments": [ + { + "argument": "id", + "type": "label" + }, + { + "argument": "color", + "type": "color" + } + ], + "syntax": "label.set_color(id, color) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "label.set_size()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_label.set_size", + "fragment": "fun_label.set_size", + "info": "

label.set_size()

Sets arrow and text size of the specified label object.
Syntax
label.set_size(id, size) \u2192 void
Arguments
id (label) Label object.
size (string) Possible values: size.auto, size.tiny, size.small, size.normal, size.large, size.huge. Default value is size.auto.
See also
", + "description": "Sets arrow and text size of the specified label object.", + "arguments": [ + { + "argument": "id", + "type": "label" + }, + { + "argument": "size", + "type": "string" + } + ], + "syntax": "label.set_size(id, size) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "label.set_style()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_label.set_style", + "fragment": "fun_label.set_style", + "info": "", + "description": "Sets label style.", + "arguments": [ + { + "argument": "id", + "type": "label" + }, + { + "argument": "style", + "type": "string" + } + ], + "syntax": "label.set_style(id, style) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "label.set_text()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_label.set_text", + "fragment": "fun_label.set_text", + "info": "

label.set_text()

Sets label text
Syntax
label.set_text(id, text) \u2192 void
Arguments
id (label) Label object.
text (string) New label text.
See also
", + "description": "Sets label text", + "arguments": [ + { + "argument": "id", + "type": "label" + }, + { + "argument": "text", + "type": "string" + } + ], + "syntax": "label.set_text(id, text) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "label.set_textalign()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_label.set_textalign", + "fragment": "fun_label.set_textalign", + "info": "

label.set_textalign()

Sets the alignment for the label text.
Syntax
label.set_textalign(id, textalign) \u2192 void
Arguments
id (label) Label object.
textalign (string) Label text alignment. Possible values: text.align_left, text.align_center, text.align_right.
See also
", + "description": "Sets the alignment for the label text.", + "arguments": [ + { + "argument": "id", + "type": "label" + }, + { + "argument": "textalign", + "type": "string" + } + ], + "syntax": "label.set_textalign(id, textalign) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "label.set_textcolor()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_label.set_textcolor", + "fragment": "fun_label.set_textcolor", + "info": "

label.set_textcolor()

Sets color of the label text.
Syntax
label.set_textcolor(id, textcolor) \u2192 void
Arguments
id (label) Label object.
textcolor (color) New text color.
See also
", + "description": "Sets color of the label text.", + "arguments": [ + { + "argument": "id", + "type": "label" + }, + { + "argument": "textcolor", + "type": "color" + } + ], + "syntax": "label.set_textcolor(id, textcolor) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "label.set_tooltip()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_label.set_tooltip", + "fragment": "fun_label.set_tooltip", + "info": "

label.set_tooltip()

Sets the tooltip text.
Syntax
label.set_tooltip(id, tooltip) \u2192 void
Arguments
id (label) Label object.
tooltip (string) Tooltip text.
See also
", + "description": "Sets the tooltip text.", + "arguments": [ + { + "argument": "id", + "type": "label" + }, + { + "argument": "tooltip", + "type": "string" + } + ], + "syntax": "label.set_tooltip(id, tooltip) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "label.set_x()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_label.set_x", + "fragment": "fun_label.set_x", + "info": "

label.set_x()

Sets bar index or bar time (depending on the xloc) of the label position.
Syntax
label.set_x(id, x) \u2192 void
Arguments
id (label) Label object.
x (series) New bar index or bar time of the label position. Note that objects positioned using xloc.bar_index cannot be drawn further than 500 bars into the future.
See also
", + "description": "Sets bar index or bar time (depending on the xloc) of the label position.", + "arguments": [ + { + "argument": "id", + "type": "label" + }, + { + "argument": "x", + "type": "series" + } + ], + "syntax": "label.set_x(id, x) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "label.set_xloc()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_label.set_xloc", + "fragment": "fun_label.set_xloc", + "info": "

label.set_xloc()

Sets x-location and new bar index/time value.
Syntax
label.set_xloc(id, x, xloc) \u2192 void
Arguments
id (label) Label object.
x (series) New bar index or bar time of the label position.
xloc (string) New x-location value.
See also
", + "description": "Sets x-location and new bar index/time value.", + "arguments": [ + { + "argument": "id", + "type": "label" + }, + { + "argument": "x", + "type": "series" + }, + { + "argument": "xloc", + "type": "string" + } + ], + "syntax": "label.set_xloc(id, x, xloc) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "label.set_xy()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_label.set_xy", + "fragment": "fun_label.set_xy", + "info": "

label.set_xy()

Sets bar index/time and price of the label position.
Syntax
label.set_xy(id, x, y) \u2192 void
Arguments
id (label) Label object.
x (series) New bar index or bar time of the label position. Note that objects positioned using xloc.bar_index cannot be drawn further than 500 bars into the future.
y (series) New price of the label position.
See also
", + "description": "Sets bar index/time and price of the label position.", + "arguments": [ + { + "argument": "id", + "type": "label" + }, + { + "argument": "x", + "type": "series" + }, + { + "argument": "y", + "type": "series" + } + ], + "syntax": "label.set_xy(id, x, y) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "label.set_y()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_label.set_y", + "fragment": "fun_label.set_y", + "info": "

label.set_y()

Sets price of the label position
Syntax
label.set_y(id, y) \u2192 void
Arguments
id (label) Label object.
y (series) New price of the label position.
See also
", + "description": "Sets price of the label position", + "arguments": [ + { + "argument": "id", + "type": "label" + }, + { + "argument": "y", + "type": "series" + } + ], + "syntax": "label.set_y(id, y) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "label.set_yloc()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_label.set_yloc", + "fragment": "fun_label.set_yloc", + "info": "

label.set_yloc()

Sets new y-location calculation algorithm.
Syntax
label.set_yloc(id, yloc) \u2192 void
Arguments
id (label) Label object.
yloc (string) New y-location value.
See also
", + "description": "Sets new y-location calculation algorithm.", + "arguments": [ + { + "argument": "id", + "type": "label" + }, + { + "argument": "yloc", + "type": "string" + } + ], + "syntax": "label.set_yloc(id, yloc) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "line()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_line", + "fragment": "fun_line", + "info": "

line()

Casts na to line
Syntax
line(x) \u2192 series[line]
See also
", + "description": "Casts na to line", + "arguments": [], + "syntax": "line(x) \u2192 series[line]", + "returnType": "series[line]", + "returns": "" + }, + { + "name": "line.delete()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_line.delete", + "fragment": "fun_line.delete", + "info": "

line.delete()

Deletes the specified line object. If it has already been deleted, does nothing.
Syntax
line.delete(id) \u2192 void
Arguments
id (line) Line object to delete.
See also
", + "description": "Deletes the specified line object. If it has already been deleted, does nothing.", + "arguments": [ + { + "argument": "id", + "type": "line" + } + ], + "syntax": "line.delete(id) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "line.get_price()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_line.get_price", + "fragment": "fun_line.get_price", + "info": "

line.get_price()

Returns the price level of a line at a given bar index.
Syntax
line.get_price(id, x) \u2192 series[float]
Arguments
id (line) Line object.
x (series) Bar index for which price is required.
Example
//@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)
Remarks
The line is considered to have been created using 'extend=extend.both'.
This function can only be called for lines created using 'xloc.bar_index'. If you try to call it for a line created with 'xloc.bar_time', it will generate an error.
See also
", + "description": "Returns the price level of a line at a given bar index.", + "arguments": [ + { + "argument": "id", + "type": "line" + }, + { + "argument": "x", + "type": "series" + } + ], + "syntax": "line.get_price(id, x) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "line.get_x1()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_line.get_x1", + "fragment": "fun_line.get_x1", + "info": "

line.get_x1()

Returns UNIX time or bar index (depending on the last xloc value set) of the first point of the line.
Syntax
line.get_x1(id) \u2192 series[integer]
Arguments
id (line) Line object.
Example
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\u00a0plot
See also
", + "description": "Returns UNIX time or bar index (depending on the last xloc value set) of the first point of the line.", + "arguments": [ + { + "argument": "id", + "type": "line" + } + ], + "syntax": "line.get_x1(id) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "line.get_x2()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_line.get_x2", + "fragment": "fun_line.get_x2", + "info": "

line.get_x2()

Returns UNIX time or bar index (depending on the last xloc value set) of the second point of the line.
Syntax
line.get_x2(id) \u2192 series[integer]
Arguments
id (line) Line object.
See also
", + "description": "Returns UNIX time or bar index (depending on the last xloc value set) of the second point of the line.", + "arguments": [ + { + "argument": "id", + "type": "line" + } + ], + "syntax": "line.get_x2(id) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "line.get_y1()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_line.get_y1", + "fragment": "fun_line.get_y1", + "info": "

line.get_y1()

Returns price of the first point of the line.
Syntax
line.get_y1(id) \u2192 series[float]
Arguments
id (line) Line object.
See also
", + "description": "Returns price of the first point of the line.", + "arguments": [ + { + "argument": "id", + "type": "line" + } + ], + "syntax": "line.get_y1(id) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "line.get_y2()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_line.get_y2", + "fragment": "fun_line.get_y2", + "info": "

line.get_y2()

Returns price of the second point of the line.
Syntax
line.get_y2(id) \u2192 series[float]
Arguments
id (line) Line object.
See also
", + "description": "Returns price of the second point of the line.", + "arguments": [ + { + "argument": "id", + "type": "line" + } + ], + "syntax": "line.get_y2(id) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "line.new()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_line.new", + "fragment": "fun_line.new", + "info": "

line.new()

Creates new line object.
Syntax
line.new(x1, y1, x2, y2, xloc, extend, color, style, width) \u2192 series[line]
Arguments
x1 (series) Bar index (if xloc = xloc.bar_index) or bar UNIX time (if xloc = xloc.bar_time) of the first point of the line. Note that objects positioned using xloc.bar_index cannot be drawn further than 500 bars into the future.
y1 (series) Price of the first point of the line.
x2 (series) Bar index (if xloc = xloc.bar_index) or bar UNIX time (if xloc = xloc.bar_time) of the second point of the line. Note that objects positioned using xloc.bar_index cannot be drawn further than 500 bars into the future.
y2 (series) Price of the second point of the line.
xloc (string) See description of x1 argument. Possible values: xloc.bar_index and xloc.bar_time. Default is xloc.bar_index.
extend (string) If extend=extend.none, draws segment starting at point (x1, y1) and ending at point (x2, y2). If extend is equal to extend.right or extend.left, draws a ray starting at point (x1, y1) or (x2, y2), respectively. If extend=extend.both, draws a straight line that goes through these points. Default value is extend.none.
color (color) Line color.
width (integer) Line width in pixels.
Example
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)
See also
", + "description": "Creates new line object.", + "arguments": [ + { + "argument": "x1", + "type": "series" + }, + { + "argument": "y1", + "type": "series" + }, + { + "argument": "x2", + "type": "series" + }, + { + "argument": "y2", + "type": "series" + }, + { + "argument": "xloc", + "type": "string" + }, + { + "argument": "extend", + "type": "string" + }, + { + "argument": "color", + "type": "color" + }, + { + "argument": "style", + "type": "string" + }, + { + "argument": "width", + "type": "integer" + } + ], + "syntax": "line.new(x1, y1, x2, y2, xloc, extend, color, style, width) \u2192 series[line]", + "returnType": "series[line]", + "returns": "" + }, + { + "name": "line.set_color()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_line.set_color", + "fragment": "fun_line.set_color", + "info": "

line.set_color()

Sets the line color
Syntax
line.set_color(id, color) \u2192 void
Arguments
id (line) Line object.
color (color) New line color
See also
", + "description": "Sets the line color", + "arguments": [ + { + "argument": "id", + "type": "line" + }, + { + "argument": "color", + "type": "color" + } + ], + "syntax": "line.set_color(id, color) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "line.set_extend()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_line.set_extend", + "fragment": "fun_line.set_extend", + "info": "

line.set_extend()

Sets extending type of this line object. If extend=extend.none, draws segment starting at point (x1, y1) and ending at point (x2, y2). If extend is equal to extend.right or extend.left, draws a ray starting at point (x1, y1) or (x2, y2), respectively. If extend=extend.both, draws a straight line that goes through these points.
Syntax
line.set_extend(id, extend) \u2192 void
Arguments
id (line) Line object.
extend (string) New extending type.
See also
", + "description": "Sets extending type of this line object. If extend=extend.none, draws segment starting at point (x1, y1) and ending at point (x2, y2). If extend is equal to extend.right or extend.left, draws a ray starting at point (x1, y1) or (x2, y2), respectively. If extend=extend.both, draws a straight line that goes through these points.", + "arguments": [ + { + "argument": "id", + "type": "line" + }, + { + "argument": "extend", + "type": "string" + } + ], + "syntax": "line.set_extend(id, extend) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "line.set_style()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_line.set_style", + "fragment": "fun_line.set_style", + "info": "

line.set_style()

Sets the line style
Syntax
line.set_style(id, style) \u2192 void
Arguments
id (line) Line object.
style (string) New line style.
See also
", + "description": "Sets the line style", + "arguments": [ + { + "argument": "id", + "type": "line" + }, + { + "argument": "style", + "type": "string" + } + ], + "syntax": "line.set_style(id, style) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "line.set_width()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_line.set_width", + "fragment": "fun_line.set_width", + "info": "

line.set_width()

Sets the line width.
Syntax
line.set_width(id, width) \u2192 void
Arguments
id (line) Line object.
width (integer) New line width in pixels.
See also
", + "description": "Sets the line width.", + "arguments": [ + { + "argument": "id", + "type": "line" + }, + { + "argument": "width", + "type": "integer" + } + ], + "syntax": "line.set_width(id, width) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "line.set_x1()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_line.set_x1", + "fragment": "fun_line.set_x1", + "info": "

line.set_x1()

Sets bar index or bar time (depending on the xloc) of the first point.
Syntax
line.set_x1(id, x) \u2192 void
Arguments
id (line) Line object.
x (series) Bar index or bar time. Note that objects positioned using xloc.bar_index cannot be drawn further than 500 bars into the future.
See also
", + "description": "Sets bar index or bar time (depending on the xloc) of the first point.", + "arguments": [ + { + "argument": "id", + "type": "line" + }, + { + "argument": "x", + "type": "series" + } + ], + "syntax": "line.set_x1(id, x) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "line.set_x2()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_line.set_x2", + "fragment": "fun_line.set_x2", + "info": "

line.set_x2()

Sets bar index or bar time (depending on the xloc) of the second point.
Syntax
line.set_x2(id, x) \u2192 void
Arguments
id (line) Line object.
x (series) Bar index or bar time. Note that objects positioned using xloc.bar_index cannot be drawn further than 500 bars into the future.
See also
", + "description": "Sets bar index or bar time (depending on the xloc) of the second point.", + "arguments": [ + { + "argument": "id", + "type": "line" + }, + { + "argument": "x", + "type": "series" + } + ], + "syntax": "line.set_x2(id, x) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "line.set_xloc()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_line.set_xloc", + "fragment": "fun_line.set_xloc", + "info": "

line.set_xloc()

Sets x-location and new bar index/time values.
Syntax
line.set_xloc(id, x1, x2, xloc) \u2192 void
Arguments
id (line) Line object.
x1 (series) Bar index or bar time of the first point.
x2 (series) Bar index or bar time of the second point.
xloc (string) New x-location value.
See also
", + "description": "Sets x-location and new bar index/time values.", + "arguments": [ + { + "argument": "id", + "type": "line" + }, + { + "argument": "x1", + "type": "series" + }, + { + "argument": "x2", + "type": "series" + }, + { + "argument": "xloc", + "type": "string" + } + ], + "syntax": "line.set_xloc(id, x1, x2, xloc) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "line.set_xy1()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_line.set_xy1", + "fragment": "fun_line.set_xy1", + "info": "

line.set_xy1()

Sets bar index/time and price of the first point.
Syntax
line.set_xy1(id, x, y) \u2192 void
Arguments
id (line) Line object.
x (series) Bar index or bar time. Note that objects positioned using xloc.bar_index cannot be drawn further than 500 bars into the future.
y (series) Price.
See also
", + "description": "Sets bar index/time and price of the first point.", + "arguments": [ + { + "argument": "id", + "type": "line" + }, + { + "argument": "x", + "type": "series" + }, + { + "argument": "y", + "type": "series" + } + ], + "syntax": "line.set_xy1(id, x, y) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "line.set_xy2()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_line.set_xy2", + "fragment": "fun_line.set_xy2", + "info": "

line.set_xy2()

Sets bar index/time and price of the second point
Syntax
line.set_xy2(id, x, y) \u2192 void
Arguments
id (line) Line object.
x (series) Bar index or bar time.
y (series) Price.
See also
", + "description": "Sets bar index/time and price of the second point", + "arguments": [ + { + "argument": "id", + "type": "line" + }, + { + "argument": "x", + "type": "series" + }, + { + "argument": "y", + "type": "series" + } + ], + "syntax": "line.set_xy2(id, x, y) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "line.set_y1()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_line.set_y1", + "fragment": "fun_line.set_y1", + "info": "

line.set_y1()

Sets price of the first point
Syntax
line.set_y1(id, y) \u2192 void
Arguments
id (line) Line object.
y (series) Price.
See also
", + "description": "Sets price of the first point", + "arguments": [ + { + "argument": "id", + "type": "line" + }, + { + "argument": "y", + "type": "series" + } + ], + "syntax": "line.set_y1(id, y) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "line.set_y2()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_line.set_y2", + "fragment": "fun_line.set_y2", + "info": "

line.set_y2()

Sets price of the second point.
Syntax
line.set_y2(id, y) \u2192 void
Arguments
id (line) Line object.
y (series) Price.
See also
", + "description": "Sets price of the second point.", + "arguments": [ + { + "argument": "id", + "type": "line" + }, + { + "argument": "y", + "type": "series" + } + ], + "syntax": "line.set_y2(id, y) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "linebreak()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_linebreak", + "fragment": "fun_linebreak", + "info": "

linebreak()

Creates a ticker identifier for requesting Line Break values.
Syntax
linebreak(symbol, number_of_lines) \u2192 string
Arguments
symbol (string) Symbol ticker identifier.
number_of_lines (integer) Number of line.
Example
linebreak_tickerid\u00a0=\u00a0linebreak(syminfo.tickerid,\u00a03)
linebreak_close\u00a0=\u00a0security(linebreak_tickerid,\u00a0timeframe.period,\u00a0close)
plot(linebreak_close)
See also
", + "description": "Creates a ticker identifier for requesting Line Break values.", + "arguments": [ + { + "argument": "symbol", + "type": "string" + }, + { + "argument": "number_of_lines", + "type": "integer" + } + ], + "syntax": "linebreak(symbol, number_of_lines) \u2192 string", + "returnType": "string", + "returns": "" + }, + { + "name": "linreg()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_linreg", + "fragment": "fun_linreg", + "info": "

linreg()

Linear regression curve. A line that best fits the prices specified over a user-defined time period. It is calculated using the least squares method. The result of this function is calculated using the formula: linreg = intercept + slope * (length - 1 - offset), where length is the y argument, offset is the z argument, intercept and slope are the values calculated with the least squares method on source series (x argument).
Syntax
linreg(source, length, offset) \u2192 series[float]
Arguments
source (series[float]) Source series.
length (series[integer])
offset (integer) Offset.
", + "description": "Linear regression curve. A line that best fits the prices specified over a user-defined time period. It is calculated using the least squares method. The result of this function is calculated using the formula: linreg = intercept + slope * (length - 1 - offset), where length is the y argument, offset is the z argument, intercept and slope are the values calculated with the least squares method on source series (x argument).", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + }, + { + "argument": "offset", + "type": "integer" + } + ], + "syntax": "linreg(source, length, offset) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "log()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_log", + "fragment": "fun_log", + "info": "

log()

Natural logarithm of any x > 0 is the unique y such that e^y = x
Syntax
log(x) \u2192 float
log(x) \u2192 input float
log(x) \u2192 const float
log(x) \u2192 series[float]
See also
", + "description": "Natural logarithm of any x > 0 is the unique 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()

Base 10 logarithm of any x > 0 is the unique y such that 10^y = x
Syntax
log10(x) \u2192 float
log10(x) \u2192 input float
log10(x) \u2192 const float
log10(x) \u2192 series[float]
See also
", + "description": "Base 10 logarithm of any x > 0 is the unique 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 value for a given number of bars back.
Syntax
lowest(source, length) \u2192 series[float]
lowest(length) \u2192 series[float]
Arguments
source (series[float])
length (series[integer])
Remarks
Two args version: x is a series and y is a length.
One arg version: x is a length. Algorithm uses low as a source series.
See also
", + "description": "Lowest value for a given number of bars back.", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "lowest(source, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "lowestbars()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_lowestbars", + "fragment": "fun_lowestbars", + "info": "

lowestbars()

Lowest value offset for a given number of bars back.
Syntax
lowestbars(source, length) \u2192 series[integer]
lowestbars(length) \u2192 series[integer]
Arguments
source (series[float])
length (series[integer])
Remarks
Two args version: x is a series and y is a length.
One arg version: x is a length. Algorithm uses low as a source series.
See also
", + "description": "Lowest value offset for a given number of bars back.", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "lowestbars(source, length) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "macd()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_macd", + "fragment": "fun_macd", + "info": "

macd()

MACD (moving average convergence/divergence). It is supposed to reveal changes in the strength, direction, momentum, and duration of a trend in a stock's price.
Syntax
macd(source, fastlen, slowlen, siglen) \u2192 [series[float], series[float], series[float]]
Arguments
source (series) Series of values to process.
fastlen (integer) Fast Length parameter.
slowlen (integer) Slow Length parameter.
siglen (integer) Signal Length parameter.
Example
//\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)
See also
", + "description": "MACD (moving average convergence/divergence). It is supposed to reveal changes in the strength, direction, momentum, and duration of a trend in a stock's price.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "fastlen", + "type": "integer" + }, + { + "argument": "slowlen", + "type": "integer" + }, + { + "argument": "siglen", + "type": "integer" + } + ], + "syntax": "macd(source, fastlen, slowlen, siglen) \u2192 [series[float], series[float], series[float]]", + "returnType": "[series[float], series[float], series[float]]", + "returns": "" + }, + { + "name": "max()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_max", + "fragment": "fun_max", + "info": "

max()

Returns the greatest of multiple values.
Syntax
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]
Example
max(close,\u00a0open)
max(close,\u00a0max(open,\u00a042))
See also
", + "description": "Returns the greatest of multiple values.", + "arguments": [], + "syntax": "max(x1, x2, ...) -> const integer", + "returnType": "", + "returns": "" + }, + { + "name": "max_bars_back()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_max_bars_back", + "fragment": "fun_max_bars_back", + "info": "

max_bars_back()

Function sets the maximum number of bars that is available for historical reference of a given built-in or user variable. When operator '[]' is applied to a variable - it is a reference to a historical value of that variable.
If an argument of an operator '[]' is a compile time constant value (e.g. 'v[10]', 'close[500]') then there is no need to use 'max_bars_back' function for that variable. Pine Script compiler will use that constant value as history buffer size.
If an argument of an operator '[]' is a value, calculated at runtime (e.g. 'v[i]' where 'i' - is a series variable) then Pine Script attempts to autodetect the history buffer size at runtime. Sometimes it fails and the script crashes at runtime because it eventually refers to historical values that are out of the buffer. In that case you should use 'max_bars_back' to fix that problem manually.
Syntax
max_bars_back(var, num) \u2192 void
Arguments
var (series, color, bool) Series variable identifier for which history buffer should be resized. Possible values are: 'open', 'high', 'low', 'close', 'volume', 'time', or any user defined variable id.
num (integer) History buffer size which is the number of bars that could be referenced for variable 'var'. This should be a literal integer.
Example
//@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)
Remarks
At the moment 'max_bars_back' cannot be applied to built-ins like 'hl2', 'hlc3', 'ohlc4'. Please use multiple 'max_bars_back' calls as workaround here (e.g. instead of a single \u2018max_bars_back(hl2, 100)\u2019 call you should call the function twice: \u2018max_bars_back(high, 100), max_bars_back(low, 100)\u2019).
If the study or strategy 'max_bars_back' parameter is used, all variables in the study are affected. This may result in excessive memory usage and cause runtime problems. When possible (i.e. when the cause is a variable rather than a function), please use the max_bars_back function instead.
See also
", + "description": "Function sets the maximum number of bars that is available for historical reference of a given built-in or user variable. When operator '[]' is applied to a variable - it is a reference to a historical value of that variable.", + "arguments": [ + { + "argument": "var", + "type": "series, color, bool" + }, + { + "argument": "num", + "type": "integer" + } + ], + "syntax": "max_bars_back(var, num) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "median()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_median", + "fragment": "fun_median", + "info": "

median()

Returns the median of the series.
Syntax
median(source, length) \u2192 series[float]
median(source, length) \u2192 series[integer]
Arguments
source (series) Series of values to process.
length (series[integer]) Number of bars (length).
", + "description": "Returns the median of the series.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "median(source, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "mfi()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_mfi", + "fragment": "fun_mfi", + "info": "

mfi()

Money Flow Index. The Money Flow Index (MFI) is a technical oscillator that uses price and volume for identifying overbought or oversold conditions in an asset.
Syntax
mfi(series, length) \u2192 series[float]
Arguments
series (series[float]) Series of values to process.
length (series[integer]) Number of bars (length).
Example
//@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))
See also
", + "description": "Money Flow Index. The Money Flow Index (MFI) is a technical oscillator that uses price and volume for identifying overbought or oversold conditions in an asset.", + "arguments": [ + { + "argument": "series", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "mfi(series, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "min()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_min", + "fragment": "fun_min", + "info": "

min()

Returns the smallest of multiple values.
Syntax
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]
Example
min(close,\u00a0open)
min(close,\u00a0min(open,\u00a042))
See also
", + "description": "Returns the smallest of multiple values.", + "arguments": [], + "syntax": "min(x1, x2, ...) -> const integer", + "returnType": "", + "returns": "" + }, + { + "name": "minute()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_minute", + "fragment": "fun_minute", + "info": "

minute()

Syntax
minute(time) \u2192 series[integer]
minute(time, timezone) \u2192 series[integer]
Arguments
time (series) UNIX time in milliseconds.
timezone (string) An optional parameter. Timezone.
Remarks
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970. By default, the Timezone is syminfo.timezone, possible values can be seen in timestamp.
See also
", + "description": "", + "arguments": [ + { + "argument": "time", + "type": "series" + }, + { + "argument": "timezone", + "type": "string" + } + ], + "syntax": "minute(time) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "mode()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_mode", + "fragment": "fun_mode", + "info": "

mode()

Returns the mode of the series. If there are several values with the same frequency, it returns the smallest value.
Syntax
mode(source, length) \u2192 series[float]
mode(source, length) \u2192 series[integer]
Arguments
source (series) Series of values to process.
length (series[integer]) Number of bars (length).
", + "description": "Returns the mode of the series. If there are several values with the same frequency, it returns the smallest value.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "mode(source, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "mom()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_mom", + "fragment": "fun_mom", + "info": "

mom()

Momentum of x price and x price y bars ago. This is simply a difference x - x[y].
Syntax
mom(source, length) \u2192 series[float]
Arguments
source (series[float]) Series of values to process.
length (series[integer]) Offset from the current bar to the previous bar. Can be series[integer].
See also
", + "description": "Momentum of x price and x price y bars ago. This is simply a difference x - x[y].", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "mom(source, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "month()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_month", + "fragment": "fun_month", + "info": "

month()

Syntax
month(time) \u2192 series[integer]
month(time, timezone) \u2192 series[integer]
Arguments
time (series) UNIX time in milliseconds.
timezone (string) An optional parameter. Timezone.
Remarks
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970. By default, the Timezone is syminfo.timezone, possible values can be seen in timestamp.
Note that this function returns the month based on the time of the bar's open. For overnight sessions (e.g. EURUSD, where Monday session starts on Sunday, 17:00 UTC-4) this value can be lower by 1 than the month of the trading day.
See also
", + "description": "", + "arguments": [ + { + "argument": "time", + "type": "series" + }, + { + "argument": "timezone", + "type": "string" + } + ], + "syntax": "month(time) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "na()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_na", + "fragment": "fun_na", + "info": "

na()

Test value if it's a NaN.
Syntax
na(x) \u2192 bool
na(x) \u2192 series[bool]
See also
", + "description": "Test value if it's a NaN.", + "arguments": [], + "syntax": "na(x) \u2192 bool", + "returnType": "bool", + "returns": "" + }, + { + "name": "nz()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_nz", + "fragment": "fun_nz", + "info": "

nz()

Replaces NaN values with zeros (or given value) in a series.
Syntax
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]
Arguments
x (series) Series of values to process.
y (float) Value that will be inserted instead of all NaN values in x series.
Example
nz(sma(close,\u00a0100))
See also
", + "description": "Replaces NaN values with zeros (or given value) in a series.", + "arguments": [ + { + "argument": "x", + "type": "series" + }, + { + "argument": "y", + "type": "float" + } + ], + "syntax": "nz(x, y) \u2192 integer", + "returnType": "integer", + "returns": "" + }, + { + "name": "offset()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_offset", + "fragment": "fun_offset", + "info": "

offset()

Shifts series x on the y bars to the right.
Syntax
offset(source, offset) \u2192 series[bool]
offset(source, offset) \u2192 series[color]
offset(source, offset) \u2192 series[integer]
offset(source, offset) \u2192 series[float]
Arguments
source (series) Series of values to process.
offset (integer) Number of bars to offset, must be a positive number. Negative offsets are not supported.
Remarks
If you need to shift the series to the left, use combination of offset and plot (with offset argument).
See also
", + "description": "Shifts series x on the y bars to the right.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "offset", + "type": "integer" + } + ], + "syntax": "offset(source, offset) \u2192 series[bool]", + "returnType": "series[bool]", + "returns": "" + }, + { + "name": "percentile_linear_interpolation()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_percentile_linear_interpolation", + "fragment": "fun_percentile_linear_interpolation", + "info": "

percentile_linear_interpolation()

Calculates percentile using method of linear interpolation between the two nearest ranks.
Syntax
percentile_linear_interpolation(source, length, percentage) \u2192 series[float]
Arguments
source (series[float]) Series of values to process (source).
length (series[integer]) Number of bars back (length).
percentage (float) Percentage, a number from range 0..100.
Remarks
Note that a percentile calculated using this method will NOT always be a member of the input data set.
See also
", + "description": "Calculates percentile using method of linear interpolation between the two nearest ranks.", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + }, + { + "argument": "percentage", + "type": "float" + } + ], + "syntax": "percentile_linear_interpolation(source, length, percentage) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "percentile_nearest_rank()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_percentile_nearest_rank", + "fragment": "fun_percentile_nearest_rank", + "info": "

percentile_nearest_rank()

Calculates percentile using method of Nearest Rank.
Syntax
percentile_nearest_rank(source, length, percentage) \u2192 series[float]
Arguments
source (series[float]) Series of values to process (source).
length (series[integer]) Number of bars back (length).
percentage (float) Percentage, a number from range 0..100.
Remarks
Using the Nearest Rank method on lengths less than 100 bars back can result in the same number being used for more than one percentile.
A percentile calculated using the Nearest Rank method will always be a member of the input data set.
The 100th percentile is defined to be the largest value in the input data set.
See also
", + "description": "Calculates percentile using method of Nearest Rank.", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + }, + { + "argument": "percentage", + "type": "float" + } + ], + "syntax": "percentile_nearest_rank(source, length, percentage) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "percentrank()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_percentrank", + "fragment": "fun_percentrank", + "info": "

percentrank()

Percent rank is the percents of how many previous values was less than or equal to the current value of given series.
Syntax
percentrank(source, length) \u2192 series[float]
Arguments
source (series[float]) Series of values to process.
length (series[integer]) Number of bars (length).
", + "description": "Percent rank is the percents of how many previous values was less than or equal to the current value of given series.", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "percentrank(source, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "pivothigh()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_pivothigh", + "fragment": "fun_pivothigh", + "info": "

pivothigh()

This function returns price of the pivot high point. It returns 'NaN', if there was no pivot high point.
Syntax
pivothigh(source, leftbars, rightbars) \u2192 series[float]
pivothigh(leftbars, rightbars) \u2192 series[float]
Arguments
source (series) An optional parameter. Data series to calculate the value. 'High' by default.
leftbars (series) Left strength.
rightbars (series) Right strength.
Example
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)
Remarks
If parameters 'leftbars' or 'rightbars' are series you should use max_bars_back function for the 'source' variable.
", + "description": "This function returns price of the pivot high point. It returns 'NaN', if there was no pivot high point.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "leftbars", + "type": "series" + }, + { + "argument": "rightbars", + "type": "series" + } + ], + "syntax": "pivothigh(source, leftbars, rightbars) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "pivotlow()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_pivotlow", + "fragment": "fun_pivotlow", + "info": "

pivotlow()

This function returns price of the pivot low point. It returns 'NaN', if there was no pivot low point.
Syntax
pivotlow(source, leftbars, rightbars) \u2192 series[float]
pivotlow(leftbars, rightbars) \u2192 series[float]
Arguments
source (series) An optional parameter. Data series to calculate the value. 'Low' by default.
leftbars (series) Left strength.
rightbars (series) Right strength.
Example
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)
Remarks
If parameters 'leftbars' or 'rightbars' are series you should use max_bars_back function for the 'source' variable.
", + "description": "This function returns price of the pivot low point. It returns 'NaN', if there was no pivot low point.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "leftbars", + "type": "series" + }, + { + "argument": "rightbars", + "type": "series" + } + ], + "syntax": "pivotlow(source, leftbars, rightbars) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "plot()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_plot", + "fragment": "fun_plot", + "info": "

plot()

Plots a series of data on the chart.
Syntax
plot(series, title, color, linewidth, style, trackprice, transp, histbase, offset, join, editable, show_last, display) \u2192 plot
Arguments
series (series) Series of data to be plotted. Required argument.
title (string) Title of the plot.
color (color) Color of the plot. You can use constants like 'color=color.red' or 'color=#ff001a' as well as complex expressions like 'color = close >= open ? color.green : color.red'. Optional argument.
linewidth (integer) Width of the plotted line. Default value is 1. Not applicable to every style.
transp (integer) Transparency of the plot. Possible values are from 0 (not transparent) to 100 (invisible). Optional argument.
trackprice (bool) If true then a horizontal price line will be shown at the level of the last study value. Default is false.
histbase (float) The price value used as the reference level when rendering plot with plot.style_histogram, plot.style_columns or plot.style_area style. Default is 0.0.
offset (integer) Shifts the plot to the left or to the right on the given number of bars. Default is 0.
join (bool) If true then plot points will be joined with line, applicable only to plot.style_cross and plot.style_circles styles. Default is false.
editable (bool) If true then plot style will be editable in Format dialog. Default is true.
show_last (integer) If set, defines the number of bars (from the last bar back to the past) to plot on chart.
display (integer) Controls where the plot is displayed. Possible values are: display.none, display.all. Default is display.all.
Example
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)
See also
", + "description": "Plots a series of data on the chart.", + "arguments": [ + { + "argument": "series", + "type": "series" + }, + { + "argument": "title", + "type": "string" + }, + { + "argument": "color", + "type": "color" + }, + { + "argument": "linewidth", + "type": "integer" + }, + { + "argument": "style", + "type": "integer" + }, + { + "argument": "transp", + "type": "integer" + }, + { + "argument": "trackprice", + "type": "bool" + }, + { + "argument": "histbase", + "type": "float" + }, + { + "argument": "offset", + "type": "integer" + }, + { + "argument": "join", + "type": "bool" + }, + { + "argument": "editable", + "type": "bool" + }, + { + "argument": "show_last", + "type": "integer" + }, + { + "argument": "display", + "type": "integer" + } + ], + "syntax": "plot(series, title, color, linewidth, style, trackprice, transp, histbase, offset, join, editable, show_last, display) \u2192 plot", + "returnType": "plot", + "returns": "" + }, + { + "name": "plotarrow()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_plotarrow", + "fragment": "fun_plotarrow", + "info": "

plotarrow()

Plots up and down arrows on the chart. Up arrow is drawn at every indicator positive value, down arrow is drawn at every negative value. If indicator returns na then no arrow is drawn. Arrows has different height, the more absolute indicator value the longer arrow is drawn.
Syntax
plotarrow(series, title, colorup, colordown, transp, offset, minheight, maxheight, editable, show_last, display) \u2192 void
Arguments
series (series) Series of data to be plotted as arrows. Required argument.
title (string) Title of the plot.
colorup (series[color]) Color of the up arrows. Optional argument.
colordown (series[color]) Color of the down arrows. Optional argument.
transp (integer) Transparency of the arrows. Possible values are from 0 (not transparent) to 100 (invisible). Optional argument.
offset (integer) Shifts arrows to the left or to the right on the given number of bars. Default is 0.
minheight (integer) Minimal possible arrow height in pixels. Default is 5.
maxheight (integer) Maximum possible arrow height in pixels. Default is 100.
editable (bool) If true then plotarrow style will be editable in Format dialog. Default is true.
show_last (integer) If set, defines the number of arrows (from the last bar back to the past) to plot on chart.
display (integer) Controls where the plot is displayed. Possible values are: display.none, display.all. Default is display.all.
Example
study(\"plotarrow\u00a0example\",\u00a0overlay=true)
codiff\u00a0=\u00a0close\u00a0-\u00a0open
plotarrow(codiff,\u00a0colorup=color.teal,\u00a0colordown=color.orange,\u00a0transp=40)
Remarks
Use plotarrow function in conjunction with 'overlay=true' study parameter!
See also
", + "description": "Plots up and down arrows on the chart. Up arrow is drawn at every indicator positive value, down arrow is drawn at every negative value. If indicator returns na then no arrow is drawn. Arrows has different height, the more absolute indicator value the longer arrow is drawn.", + "arguments": [ + { + "argument": "series", + "type": "series" + }, + { + "argument": "title", + "type": "string" + }, + { + "argument": "colorup", + "type": "series[color]" + }, + { + "argument": "colordown", + "type": "series[color]" + }, + { + "argument": "transp", + "type": "integer" + }, + { + "argument": "offset", + "type": "integer" + }, + { + "argument": "minheight", + "type": "integer" + }, + { + "argument": "maxheight", + "type": "integer" + }, + { + "argument": "editable", + "type": "bool" + }, + { + "argument": "show_last", + "type": "integer" + }, + { + "argument": "display", + "type": "integer" + } + ], + "syntax": "plotarrow(series, title, colorup, colordown, transp, offset, minheight, maxheight, editable, show_last, display) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "plotbar()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_plotbar", + "fragment": "fun_plotbar", + "info": "

plotbar()

Plots ohlc bars on the chart.
Syntax
plotbar(open, high, low, close, title, color, editable, show_last, display) \u2192 void
Arguments
open (series) Open series of data to be used as open values of bars. Required argument.
high (series) High series of data to be used as high values of bars. Required argument.
low (series) Low series of data to be used as low values of bars. Required argument.
close (series) Close series of data to be used as close values of bars. Required argument.
title (string) Title of the plotbar. Optional argument.
color (color) Color of the ohlc bars. You can use constants like 'color=color.red' or 'color=#ff001a' as well as complex expressions like 'color = close >= open ? color.green : color.red'. Optional argument.
editable (bool) If true then plotbar style will be editable in Format dialog. Default is true.
show_last (integer) If set, defines the number of bars (from the last bar back to the past) to plot on chart.
display (integer) Controls where the plot is displayed. Possible values are: display.none, display.all. Default is display.all.
Example
plotbar(open,\u00a0high,\u00a0low,\u00a0close,\u00a0title='Title',\u00a0color\u00a0=\u00a0open\u00a0<\u00a0close\u00a0?\u00a0color.green\u00a0:\u00a0color.red)
Remarks
Even if one value of open, high, low or close equal NaN then bar no draw.
The maximal value of open, high, low or close will be set as 'high', and the minimal value will be set as 'low'.
See also
", + "description": "Plots ohlc bars on the chart.", + "arguments": [ + { + "argument": "open", + "type": "series" + }, + { + "argument": "high", + "type": "series" + }, + { + "argument": "low", + "type": "series" + }, + { + "argument": "close", + "type": "series" + }, + { + "argument": "title", + "type": "string" + }, + { + "argument": "color", + "type": "color" + }, + { + "argument": "editable", + "type": "bool" + }, + { + "argument": "show_last", + "type": "integer" + }, + { + "argument": "display", + "type": "integer" + } + ], + "syntax": "plotbar(open, high, low, close, title, color, editable, show_last, display) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "plotcandle()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_plotcandle", + "fragment": "fun_plotcandle", + "info": "

plotcandle()

Plots candles on the chart.
Syntax
plotcandle(open, high, low, close, title, color, wickcolor, editable, show_last, bordercolor, display) \u2192 void
Arguments
open (series) Open series of data to be used as open values of candles. Required argument.
high (series) High series of data to be used as high values of candles. Required argument.
low (series) Low series of data to be used as low values of candles. Required argument.
close (series) Close series of data to be used as close values of candles. Required argument.
title (string) Title of the plotcandles. Optional argument.
color (color) Color of the candles. You can use constants like 'color=color.red' or 'color=#ff001a' as well as complex expressions like 'color = close >= open ? color.green : color.red'. Optional argument.
wickcolor (series[color]) The color of the wick of candles. An optional argument.
editable (bool) If true then plotcandle style will be editable in Format dialog. Default is true.
show_last (integer) If set, defines the number of candles (from the last bar back to the past) to plot on chart.
bordercolor (series[color]) The border color of candles. An optional argument.
display (integer) Controls where the plot is displayed. Possible values are: display.none, display.all. Default is display.all.
Example
plotcandle(open,\u00a0high,\u00a0low,\u00a0close,\u00a0title='Title',\u00a0color\u00a0=\u00a0open\u00a0<\u00a0close\u00a0?\u00a0color.green\u00a0:\u00a0color.red,\u00a0wickcolor=color.black)
Remarks
Even if one value of open, high, low or close equal NaN then bar no draw.
The maximal value of open, high, low or close will be set as 'high', and the minimal value will be set as 'low'.
See also
", + "description": "Plots candles on the chart.", + "arguments": [ + { + "argument": "open", + "type": "series" + }, + { + "argument": "high", + "type": "series" + }, + { + "argument": "low", + "type": "series" + }, + { + "argument": "close", + "type": "series" + }, + { + "argument": "title", + "type": "string" + }, + { + "argument": "color", + "type": "color" + }, + { + "argument": "wickcolor", + "type": "series[color]" + }, + { + "argument": "editable", + "type": "bool" + }, + { + "argument": "show_last", + "type": "integer" + }, + { + "argument": "bordercolor", + "type": "series[color]" + }, + { + "argument": "display", + "type": "integer" + } + ], + "syntax": "plotcandle(open, high, low, close, title, color, wickcolor, editable, show_last, bordercolor, display) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "plotchar()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_plotchar", + "fragment": "fun_plotchar", + "info": "

plotchar()

Plots visual shapes using any given one Unicode character on the chart.
Syntax
plotchar(series, title, char, location, color, transp, offset, text, textcolor, editable, size, show_last, display) \u2192 void
Arguments
series (series) Series of data to be plotted as shapes. Series is treated as a series of boolean values for all location values except location.absolute. Required argument.
title (string) Title of the plot.
char (string) Character to use as a visual shape.
location (string) Location of shapes on the chart. Possible values are: location.abovebar, location.belowbar, location.top, location.bottom, location.absolute. Default value is location.abovebar.
color (color) Color of the shapes. You can use constants like 'color=color.red' or 'color=#ff001a' as well as complex expressions like 'color = close >= open ? color.green : color.red'. Optional argument.
transp (integer) Transparency of the shapes. Possible values are from 0 (not transparent) to 100 (invisible). Optional argument.
offset (integer) Shifts shapes to the left or to the right on the given number of bars. Default is 0.
text (string) Text to display with the shape. You can use multiline text, to separate lines use '' escape sequence. Example: 'line oneline two'.
textcolor (color) Color of the text. You can use constants like 'textcolor=color.red' or 'textcolor=#ff001a' as well as complex expressions like 'textcolor = close >= open ? color.green : color.red'. Optional argument.
editable (bool) If true then plotchar style will be editable in Format dialog. Default is true.
show_last (integer) If set, defines the number of chars (from the last bar back to the past) to plot on chart.
size (string) Size of characters on the chart. Possible values are: size.auto, size.tiny, size.small, size.normal, size.large, size.huge. Default is size.auto.
display (integer) Controls where the plot is displayed. Possible values are: display.none, display.all. Default is display.all.
Example
study('plotchar\u00a0example',\u00a0overlay=true)
data\u00a0=\u00a0close\u00a0>=\u00a0open
plotchar(data,\u00a0char='\u2744')
Remarks
Use plotchar function in conjunction with 'overlay=true' study parameter!
See also
", + "description": "Plots visual shapes using any given one Unicode character on the chart.", + "arguments": [ + { + "argument": "series", + "type": "series" + }, + { + "argument": "title", + "type": "string" + }, + { + "argument": "char", + "type": "string" + }, + { + "argument": "location", + "type": "string" + }, + { + "argument": "color", + "type": "color" + }, + { + "argument": "transp", + "type": "integer" + }, + { + "argument": "offset", + "type": "integer" + }, + { + "argument": "text", + "type": "string" + }, + { + "argument": "textcolor", + "type": "color" + }, + { + "argument": "editable", + "type": "bool" + }, + { + "argument": "show_last", + "type": "integer" + }, + { + "argument": "size", + "type": "string" + }, + { + "argument": "display", + "type": "integer" + } + ], + "syntax": "plotchar(series, title, char, location, color, transp, offset, text, textcolor, editable, size, show_last, display) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "plotshape()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_plotshape", + "fragment": "fun_plotshape", + "info": "

plotshape()

Plots visual shapes on the chart.
Syntax
plotshape(series, title, style, location, color, transp, offset, text, textcolor, editable, size, show_last, display) \u2192 void
Arguments
series (series) Series of data to be plotted as shapes. Series is treated as a series of boolean values for all location values except location.absolute. Required argument.
title (string) Title of the plot.
location (string) Location of shapes on the chart. Possible values are: location.abovebar, location.belowbar, location.top, location.bottom, location.absolute. Default value is location.abovebar.
color (color) Color of the shapes. You can use constants like 'color=color.red' or 'color=#ff001a' as well as complex expressions like 'color = close >= open ? color.green : color.red'. Optional argument.
transp (integer) Transparency of the shapes. Possible values are from 0 (not transparent) to 100 (invisible). Optional argument.
offset (integer) Shifts shapes to the left or to the right on the given number of bars. Default is 0.
text (string) Text to display with the shape. You can use multiline text, to separate lines use '' escape sequence. Example: 'line oneline two'.
textcolor (color) Color of the text. You can use constants like 'textcolor=color.red' or 'textcolor=#ff001a' as well as complex expressions like 'textcolor = close >= open ? color.green : color.red'. Optional argument.
editable (bool) If true then plotshape style will be editable in Format dialog. Default is true.
show_last (integer) If set, defines the number of shapes (from the last bar back to the past) to plot on chart.
size (string) Size of shapes on the chart. Possible values are: size.auto, size.tiny, size.small, size.normal, size.large, size.huge. Default is size.auto.
display (integer) Controls where the plot is displayed. Possible values are: display.none, display.all. Default is display.all.
Example
study('plotshape\u00a0example\u00a01',\u00a0overlay=true)
data\u00a0=\u00a0close\u00a0>=\u00a0open
plotshape(data,\u00a0style=shape.xcross)
Remarks
Use plotshape function in conjunction with 'overlay=true' study parameter!
See also
", + "description": "Plots visual shapes on the chart.", + "arguments": [ + { + "argument": "series", + "type": "series" + }, + { + "argument": "title", + "type": "string" + }, + { + "argument": "style", + "type": "string" + }, + { + "argument": "location", + "type": "string" + }, + { + "argument": "color", + "type": "color" + }, + { + "argument": "transp", + "type": "integer" + }, + { + "argument": "offset", + "type": "integer" + }, + { + "argument": "text", + "type": "string" + }, + { + "argument": "textcolor", + "type": "color" + }, + { + "argument": "editable", + "type": "bool" + }, + { + "argument": "show_last", + "type": "integer" + }, + { + "argument": "size", + "type": "string" + }, + { + "argument": "display", + "type": "integer" + } + ], + "syntax": "plotshape(series, title, style, location, color, transp, offset, text, textcolor, editable, size, show_last, display) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "pointfigure()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_pointfigure", + "fragment": "fun_pointfigure", + "info": "

pointfigure()

Creates a ticker identifier for requesting Point & Figure values.
Syntax
pointfigure(symbol, source, style, param, reversal) \u2192 string
Arguments
symbol (string) Symbol ticker identifier.
source (string) The source for calculating Point & Figure. Possible values are: 'hl', 'close'.
style (string) Box Size Assignment Method: 'ATR', 'Traditional'.
param (float) ATR Length if style is equal to 'ATR', or Box Size if style is equal to 'Traditional'.
reversal (integer) Reversal amount.
Example
pnf_tickerid\u00a0=\u00a0pointfigure(syminfo.tickerid,\u00a0\"hl\",\u00a0\"Traditional\",\u00a01,\u00a03)
pnf_close\u00a0=\u00a0security(pnf_tickerid,\u00a0timeframe.period,\u00a0close)
plot(pnf_close)
See also
", + "description": "Creates a ticker identifier for requesting Point & Figure values.", + "arguments": [ + { + "argument": "symbol", + "type": "string" + }, + { + "argument": "source", + "type": "string" + }, + { + "argument": "style", + "type": "string" + }, + { + "argument": "param", + "type": "float" + }, + { + "argument": "reversal", + "type": "integer" + } + ], + "syntax": "pointfigure(symbol, source, style, param, reversal) \u2192 string", + "returnType": "string", + "returns": "" + }, + { + "name": "pow()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_pow", + "fragment": "fun_pow", + "info": "

pow()

Mathematical power function.
Syntax
pow(base, exponent) \u2192 float
pow(base, exponent) \u2192 input float
pow(base, exponent) \u2192 const float
pow(base, exponent) \u2192 series[float]
Arguments
base (series[float]) Specify the base to use.
exponent (float) Specifies the exponent.
Example
pow(close,\u00a02)
See also
", + "description": "Mathematical power function.", + "arguments": [ + { + "argument": "base", + "type": "series[float]" + }, + { + "argument": "exponent", + "type": "float" + } + ], + "syntax": "pow(base, exponent) \u2192 float", + "returnType": "float", + "returns": "" + }, + { + "name": "quandl()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_quandl", + "fragment": "fun_quandl", + "info": "

quandl()

Requests [Quandl](https://www.quandl.com\" rel=\"nofollow) data for a symbol.
Syntax
quandl(ticker, gaps, index, ignore_invalid_symbol) \u2192 series[float]
Arguments
ticker (string) Symbol. Note that the name of a time series and Quandl data feed should be divided by a forward slash. For example: \"CFTC/SB_FO_ALL\".
gaps (bool) Merge strategy for the requested data (requested data automatically merges with the main series: OHLC data). Possible values include: barmerge.gaps_on, barmerge.gaps_off. barmerge.gaps_on - requested data is merged with possible gaps (na values). barmerge.gaps_off - requested data is merged continuously without gaps, all the gaps are filled with the previous, nearest existing values. Default value is barmerge.gaps_off.
index (integer) A Quandl time-series column index.
ignore_invalid_symbol (const bool) An optional parameter. Determines the behavior of the function if the specified symbol is not found: if false, the script will halt and return a runtime error; if true, the function will return na and execution will continue. The default value is false.
Example
f\u00a0=\u00a0quandl(\"CFTC/SB_FO_ALL\",\u00a0barmerge.gaps_off,\u00a00)
plot(f)
Remarks
You can learn more about how to find ticker and index values in our Help Center.
See also
", + "description": "Requests [Quandl](https://www.quandl.com\" rel=\"nofollow) data for a symbol.", + "arguments": [ + { + "argument": "ticker", + "type": "string" + }, + { + "argument": "gaps", + "type": "bool" + }, + { + "argument": "index", + "type": "integer" + }, + { + "argument": "ignore_invalid_symbol", + "type": "const bool" + } + ], + "syntax": "quandl(ticker, gaps, index, ignore_invalid_symbol) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "random()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_random", + "fragment": "fun_random", + "info": "

random()

Returns a pseudo-random value. The function will generate a different sequence of values for each script execution. Using the same value for the optional seed argument will produce a repeatable sequence.
Syntax
random(min, max, seed) \u2192 series[float]
Arguments
min (series[float]) The lower bound of the range of random values. The value is not included in the range. The default is 0.
max (series[float]) The upper bound of the range of random values. The value is not included in the range. The default is 1.
seed (input integer) Optional argument. When the same seed is used, allows successive calls to the function to produce a repeatable set of values.
", + "description": "Returns a pseudo-random value. The function will generate a different sequence of values for each script execution. Using the same value for the optional seed argument will produce a repeatable sequence.", + "arguments": [ + { + "argument": "min", + "type": "series[float]" + }, + { + "argument": "max", + "type": "series[float]" + }, + { + "argument": "seed", + "type": "input integer" + } + ], + "syntax": "random(min, max, seed) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "range()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_range", + "fragment": "fun_range", + "info": "

range()

Returns the difference between the min and max values in a series.
Syntax
range(source, length) \u2192 series[float]
range(source, length) \u2192 series[integer]
Arguments
source (series) Series of values to process.
length (series[integer]) Number of bars (length).
", + "description": "Returns the difference between the min and max values in a series.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "range(source, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "renko()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_renko", + "fragment": "fun_renko", + "info": "

renko()

Creates a ticker identifier for requesting Renko values.
Syntax
renko(symbol, style, param) \u2192 string
Arguments
symbol (string) Symbol ticker identifier.
style (string) Box Size Assignment Method: 'ATR', 'Traditional'.
param (float) ATR Length if style is equal to 'ATR', or Box Size if style is equal to 'Traditional'.
Example
renko_tickerid\u00a0=\u00a0renko(syminfo.tickerid,\u00a0\"ATR\",\u00a010)
renko_close\u00a0=\u00a0security(renko_tickerid,\u00a0timeframe.period,\u00a0close)
plot(renko_close)
See also
", + "description": "Creates a ticker identifier for requesting Renko values.", + "arguments": [ + { + "argument": "symbol", + "type": "string" + }, + { + "argument": "style", + "type": "string" + }, + { + "argument": "param", + "type": "float" + } + ], + "syntax": "renko(symbol, style, param) \u2192 string", + "returnType": "string", + "returns": "" + }, + { + "name": "rising()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_rising", + "fragment": "fun_rising", + "info": "

rising()

Test if the x series is now rising for y bars long.
Syntax
rising(source, length) \u2192 series[bool]
Arguments
source (series[float]) Series of values to process.
length (series[integer]) Number of bars (length).
See also
", + "description": "Test if the x series is now rising for y bars long.", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "rising(source, length) \u2192 series[bool]", + "returnType": "series[bool]", + "returns": "" + }, + { + "name": "rma()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_rma", + "fragment": "fun_rma", + "info": "

rma()

Moving average used in RSI. It is the exponentially weighted moving average with alpha = 1 / length.
Syntax
rma(source, length) \u2192 series[float]
Arguments
source (series) Series of values to process.
length (integer) Number of bars (length).
Example
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))
See also
", + "description": "Moving average used in RSI. It is the exponentially weighted moving average with alpha = 1 / length.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "length", + "type": "integer" + } + ], + "syntax": "rma(source, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "roc()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_roc", + "fragment": "fun_roc", + "info": "

roc()

Function roc (rate of change) showing the difference between current value of x and the value of x that was y days ago.
It is calculated by the formula: 100 * change(src, length) / src[length].
Syntax
roc(source, length) \u2192 series[float]
Arguments
source (series[float]) Series of values to process.
length (series[integer]) Number of bars (length).
", + "description": "Function roc (rate of change) showing the difference between current value of x and the value of x that was y days ago.", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "roc(source, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "round()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_round", + "fragment": "fun_round", + "info": "

round()

Returns the value of x rounded to the nearest integer, with ties rounding up. If the precision parameter is used, returns a float value rounded to that number of decimal places.
Syntax
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]
Arguments
x (series) The value to be rounded.
precision (integer) Optional argument. Decimal places to which x will be rounded. When no argument is supplied, rounding is to the nearest integer.
Remarks
Note that for 'na' values function returns 'na'.
See also
", + "description": "Returns the value of x rounded to the nearest integer, with ties rounding up. If the precision parameter is used, returns a float value rounded to that number of decimal places.", + "arguments": [ + { + "argument": "x", + "type": "series" + }, + { + "argument": "precision", + "type": "integer" + } + ], + "syntax": "round(x) \u2192 integer", + "returnType": "integer", + "returns": "" + }, + { + "name": "round_to_mintick()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_round_to_mintick", + "fragment": "fun_round_to_mintick", + "info": "

round_to_mintick()

Returns the value rounded to the symbol's mintick, i.e. the nearest value that can be divided by syminfo.mintick, without the remainder, with ties rounding up.
Syntax
round_to_mintick(x) \u2192 float
round_to_mintick(x) \u2192 series[float]
Arguments
x (series[float]) The value to be rounded.
See also
", + "description": "Returns the value rounded to the symbol's mintick, i.e. the nearest value that can be divided by syminfo.mintick, without the remainder, with ties rounding up.", + "arguments": [ + { + "argument": "x", + "type": "series[float]" + } + ], + "syntax": "round_to_mintick(x) \u2192 float", + "returnType": "float", + "returns": "" + }, + { + "name": "rsi()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_rsi", + "fragment": "fun_rsi", + "info": "

rsi()

Relative strength index. It is calculated based on rma's of upward and downward change of x.
Syntax
rsi(x, y) \u2192 series[float]
Arguments
x (series)
y (integer, series)
Example
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))
Remarks
If x is a series and y is integer then x is a source series and y is a length.
If x is a series and y is a series then x and y are considered to be 2 calculated MAs for upward and downward changes.
See also
", + "description": "Relative strength index. It is calculated based on rma's of upward and downward change of x.", + "arguments": [ + { + "argument": "x", + "type": "series" + }, + { + "argument": "y", + "type": "integer, series" + } + ], + "syntax": "rsi(x, y) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "sar()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_sar", + "fragment": "fun_sar", + "info": "

sar()

Parabolic SAR (parabolic stop and reverse) is a method devised by J. Welles Wilder, Jr., to find potential reversals in the market price direction of traded goods.
Syntax
sar(start, inc, max) \u2192 series[float]
Arguments
start (float) Start.
inc (float) Increment.
max (float) Maximum.
Example
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)
", + "description": "Parabolic SAR (parabolic stop and reverse) is a method devised by J. Welles Wilder, Jr., to find potential reversals in the market price direction of traded goods.", + "arguments": [ + { + "argument": "start", + "type": "float" + }, + { + "argument": "inc", + "type": "float" + }, + { + "argument": "max", + "type": "float" + } + ], + "syntax": "sar(start, inc, max) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "second()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_second", + "fragment": "fun_second", + "info": "

second()

Syntax
second(time) \u2192 series[integer]
second(time, timezone) \u2192 series[integer]
Arguments
time (series) UNIX time in milliseconds.
timezone (string) An optional parameter. Timezone.
Remarks
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970. By default, the Timezone is syminfo.timezone, possible values can be seen in timestamp.
See also
", + "description": "", + "arguments": [ + { + "argument": "time", + "type": "series" + }, + { + "argument": "timezone", + "type": "string" + } + ], + "syntax": "second(time) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "security()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_security", + "fragment": "fun_security", + "info": "

security()

Request another symbol/resolution
Syntax
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>
Arguments
symbol (string) Symbol.
resolution (string) Resolution. An empty string is interpreted as the current resolution of the chart.
expression (series[bool], series[integer], series[float], series[color]) An expression can be calculated and returned from the security call. It can be a series or a tuple containing elements that can be cast to series.
gaps (bool) Merge strategy for the requested data (requested data automatically merges with the main series OHLC data). Possible values: barmerge.gaps_on, barmerge.gaps_off. barmerge.gaps_on - requested data is merged with possible gaps (na values). barmerge.gaps_off - requested data is merged continuously without gaps, all the gaps are filled with the previous nearest existing values. Default value is barmerge.gaps_off.
lookahead (bool) Merge strategy for the requested data position. Possible values: barmerge.lookahead_on, barmerge.lookahead_off. Default value is barmerge.lookahead_off starting from version 3. Note that behavour is the same on real-time, and differs only on history.
ignore_invalid_symbol (const bool) An optional parameter. Determines the behavior of the function if the specified symbol is not found: if false, the script will halt and return a runtime error; if true, the function will return na and execution will continue. The default value is false.
Example
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)
Remarks
PineScript code that uses this function could calculate differently on history and real-time data.
If you want to specify additional parameters for the requested symbol, e.g. session or adjustment type, you can use the tickerid() function.
It is not possible to pass a spread to this function using the 'ticker' variable. You can use the 'tickerid' variable or a string representation of the ticker, e.g. \u201cAAPL+MSFT*TSLA\u201d.
At the moment, up to 40 security calls can be present in a script.
Please note that using this variable/function can cause indicator repainting.
The resolution argument allowable values are: 1S, 5S, 15S, 30S - for seconds intervals (chart resolution should be less than or equal to the requested resolution) from 1 to 1440 for minutes from 1D to 365D for days from 1W to 52W for weeks from 1M to 12M for months
See also
", + "description": "Request another symbol/resolution", + "arguments": [ + { + "argument": "symbol", + "type": "string" + }, + { + "argument": "resolution", + "type": "string" + }, + { + "argument": "expression", + "type": "series[bool], series[integer], series[float], series[color]" + }, + { + "argument": "gaps", + "type": "bool" + }, + { + "argument": "lookahead", + "type": "bool" + }, + { + "argument": "ignore_invalid_symbol", + "type": "const bool" + } + ], + "syntax": "security(symbol, resolution, expression, gaps, lookahead, ignore_invalid_symbol) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "sign()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_sign", + "fragment": "fun_sign", + "info": "

sign()

Sign (signum) of x is zero if the x is zero, 1.0 if the x is greater than zero, -1.0 if the x is less than zero.
Syntax
sign(x) \u2192 float
sign(x) \u2192 input float
sign(x) \u2192 const float
sign(x) \u2192 series[float]
", + "description": "Sign (signum) of x is zero if the x is zero, 1.0 if the x is greater than zero, -1.0 if the x is less than zero.", + "arguments": [], + "syntax": "sign(x) \u2192 float", + "returnType": "float", + "returns": "" + }, + { + "name": "sin()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_sin", + "fragment": "fun_sin", + "info": "

sin()

The sin function returns the trigonometric sine of an angle.
Syntax
sin(x) \u2192 float
sin(x) \u2192 input float
sin(x) \u2192 const float
sin(x) \u2192 series[float]
Arguments
x (series[float]) Angle, in radians.
", + "description": "The sin function returns the trigonometric sine of an angle.", + "arguments": [ + { + "argument": "x", + "type": "series[float]" + } + ], + "syntax": "sin(x) \u2192 float", + "returnType": "float", + "returns": "" + }, + { + "name": "sma()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_sma", + "fragment": "fun_sma", + "info": "

sma()

The sma function returns the moving average, that is the sum of last y values of x, divided by y.
Syntax
sma(source, length) \u2192 series[float]
Arguments
source (series[float]) Series of values to process.
length (series[integer]) Number of bars (length). Can be series[integer].
Example
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))
See also
", + "description": "The sma function returns the moving average, that is the sum of last y values of x, divided by y.", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "sma(source, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "splits()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_splits", + "fragment": "fun_splits", + "info": "

splits()

Requests splits data for the specified symbol.
Syntax
splits(ticker, field, gaps, lookahead, ignore_invalid_symbol) \u2192 series[float]
Arguments
ticker (string) Symbol. Note that the symbol should be passed with a prefix. For example: \"NASDAQ:AAPL\" instead of \"AAPL\". Using syminfo.ticker will cause an error. Use syminfo.tickerid instead.
field (string) Input string. Possible values include: splits.denominator, splits.numerator.
gaps (bool) Merge strategy for the requested data (requested data automatically merges with the main series OHLC data). Possible values: barmerge.gaps_on, barmerge.gaps_off. barmerge.gaps_on - requested data is merged with possible gaps (na values). barmerge.gaps_off - requested data is merged continuously without gaps, all the gaps are filled with the previous nearest existing values. Default value is barmerge.gaps_off.
lookahead (bool) Merge strategy for the requested data position. Possible values: barmerge.lookahead_on, barmerge.lookahead_off. Default value is barmerge.lookahead_off starting from version 3. Note that behavour is the same on real-time, and differs only on history.
ignore_invalid_symbol (const bool) An optional parameter. Determines the behavior of the function if the specified symbol is not found: if false, the script will halt and return a runtime error; if true, the function will return na and execution will continue. The default value is false.
Example
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)
See also
", + "description": "Requests splits data for the specified symbol.", + "arguments": [ + { + "argument": "ticker", + "type": "string" + }, + { + "argument": "field", + "type": "string" + }, + { + "argument": "gaps", + "type": "bool" + }, + { + "argument": "lookahead", + "type": "bool" + }, + { + "argument": "ignore_invalid_symbol", + "type": "const bool" + } + ], + "syntax": "splits(ticker, field, gaps, lookahead, ignore_invalid_symbol) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "sqrt()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_sqrt", + "fragment": "fun_sqrt", + "info": "

sqrt()

Square root of any x >= 0 is the unique y >= 0 such that y^2 = x
Syntax
sqrt(x) \u2192 float
sqrt(x) \u2192 input float
sqrt(x) \u2192 const float
sqrt(x) \u2192 series[float]
See also
", + "description": "Square root of any x >= 0 is the unique y >= 0 such that y^2 = x", + "arguments": [], + "syntax": "sqrt(x) \u2192 float", + "returnType": "float", + "returns": "" + }, + { + "name": "stdev()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_stdev", + "fragment": "fun_stdev", + "info": "

stdev()

Syntax
stdev(source, length) \u2192 series[float]
Arguments
source (series[float]) Series of values to process.
length (series[integer]) Number of bars (length).
Example
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))
Remarks
This is a biased estimation of standard deviation.
See also
", + "description": "", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "stdev(source, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "stoch()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_stoch", + "fragment": "fun_stoch", + "info": "

stoch()

Stochastic. It is calculated by a formula: 100 * (close - lowest(low, length)) / (highest(high, length) - lowest(low, length)).
Syntax
stoch(source, high, low, length) \u2192 series[float]
Arguments
source (series[float]) Source series.
high (series[float]) Series of high.
low (series[float]) Series of low.
length (series[integer]) Length (number of bars back).
See also
", + "description": "Stochastic. It is calculated by a formula: 100 * (close - lowest(low, length)) / (highest(high, length) - lowest(low, length)).", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "high", + "type": "series[float]" + }, + { + "argument": "low", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "stoch(source, high, low, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "str.format()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_str.format", + "fragment": "fun_str.format", + "info": "

str.format()

Converts the formatting string and value(s) into a formatted string. The formatting string can contain literal text and one placeholder in curly braces {} for each value to be formatted. Each placeholder consists of the index of the required argument (beginning at 0) that will replace it, and an optional format specifier. The index represents the position of that argument in the str.format argument list.
Syntax
str.format(formatString, arg0, arg1, ...) -> string
str.format(formatString, arg0, arg1, ...) -> series[string]
Arguments
formatString (series[string]) Format string.
arg0, arg1, ... (const integer, float, string, bool, na, series[integer], series[float], series[string], series[bool], series[na], array[series[integer]], array[series[float]], array[series[string]], array[series[bool]]) Values to format.
Example
//\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)
Remarks
Any curly braces within an unquoted pattern must be balanced. For example, \"ab {0} de\" and \"ab '}' de\" are valid patterns, but \"ab {0'}' de\", \"ab } de\" and \"''{''\" are not.
", + "description": "Converts the formatting string and value(s) into a formatted string. The formatting string can contain literal text and one placeholder in curly braces {} for each value to be formatted. Each placeholder consists of the index of the required argument (beginning at 0) that will replace it, and an optional format specifier. The index represents the position of that argument in the str.format argument list.", + "arguments": [ + { + "argument": "formatString", + "type": "series[string]" + }, + { + "argument": "arg0, arg1, ...", + "type": "const integer, float, string, bool, na, series[integer], series[float], series[string], series[bool], series[na], array[series[integer]], array[series[float]], array[series[string]], array[series[bool]]" + } + ], + "syntax": "str.format(formatString, arg0, arg1, ...) -> string", + "returnType": "", + "returns": "" + }, + { + "name": "str.length()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_str.length", + "fragment": "fun_str.length", + "info": "

str.length()

Returns an integer corresponding to the amount of chars in that string.
Syntax
str.length(string) \u2192 const integer
str.length(string) \u2192 integer
str.length(string) \u2192 series[integer]
Arguments
string (series[string]) Source string.
", + "description": "Returns an integer corresponding to the amount of chars in that string.", + "arguments": [ + { + "argument": "string", + "type": "series[string]" + } + ], + "syntax": "str.length(string) \u2192 const integer", + "returnType": "const integer", + "returns": "" + }, + { + "name": "str.replace_all()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_str.replace_all", + "fragment": "fun_str.replace_all", + "info": "

str.replace_all()

Replaces each occurrence of the target string in the source string with the replacement string.
Syntax
str.replace_all(source, target, replacement) \u2192 string
str.replace_all(source, target, replacement) \u2192 series[string]
Arguments
source (series[string]) Source string.
target (series[string]) String to be replaced.
replacement (series[string]) String to be substituted for each occurrence of target string.
", + "description": "Replaces each occurrence of the target string in the source string with the replacement string.", + "arguments": [ + { + "argument": "source", + "type": "series[string]" + }, + { + "argument": "target", + "type": "series[string]" + }, + { + "argument": "replacement", + "type": "series[string]" + } + ], + "syntax": "str.replace_all(source, target, replacement) \u2192 string", + "returnType": "string", + "returns": "" + }, + { + "name": "str.split()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_str.split", + "fragment": "fun_str.split", + "info": "

str.split()

Divides a string into an array of substrings and returns its array id.
Syntax
str.split(string, separator) \u2192 string[]
Arguments
string (series[string]) Source string.
separator (series[string]) The string separating each substring.
", + "description": "Divides a string into an array of substrings and returns its array id.", + "arguments": [ + { + "argument": "string", + "type": "series[string]" + }, + { + "argument": "separator", + "type": "series[string]" + } + ], + "syntax": "str.split(string, separator) \u2192 string[]", + "returnType": "string[]", + "returns": "" + }, + { + "name": "strategy()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_strategy", + "fragment": "fun_strategy", + "info": "

strategy()

The function sets a number of strategy properties.
Syntax
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
Arguments
title (const string) study title that would be seen in Indicators/Strategies widget. Argument IS REQUIRED.
shorttitle (const string) study short title that would be seen in the chart legend. Argument is optional.
overlay (const bool) if true the study will be added as an overlay for the main series. If false - it would be added on a separate chart pane. Default is false.
format (const string) type of formatting study values on the price axis. Possible values are: format.inherit, format.price, format.volume. Default is format.inherit.
precision (const integer) number of digits after the floating point for study values on the price axis. Must be a non negative integer and not greater than 16. If omitted, using formatting from parent series. If format is format.inherit and this argument is set, then format becomes format.price.
scale (const integer) price scale that the indicator should be attached to. Possible values are: scale.right, scale.left, scale.none. Value scale.none can be applied only in combination with 'overlay=true' setting. If omitted, using scale from main series.
pyramiding (const integer) The maximum number of entries allowed in the same direction. If the value is 0, only one entry order in the same direction can be opened, and additional entry orders are rejected. The default value is 0.
calc_on_order_fills (const bool) Additional one time intrabar order calculation. If the parameter is set to 'true', then the strategy is recalculated once intrabar after an order is filled (not only at close of the bar). The default value is 'false'.
calc_on_every_tick (const bool) Additional intrabar strategy calculations. If the parameter is 'true', then the strategy will calculate on every tick in real-time, rather than on bars' closes. The parameter does not affect strategy calculation on historical data. The default value is 'false'.
max_bars_back (const integer) Maximum number of bars available for a strategy for historical reference. This parameter is applied to every built-in or user variable in the script if there is a reference to historical data of a variable in the script code (\u2018[]\u2019 operator is used). Variable buffer sizes in the Pine Script are typically autodetected. This however is not possible in certain cases which is why the parameter allows a user to manually set the lower bound of this value. NOTE: using of the max_bars_back function instead of the parameter is optimal because it applies to only one variable.
backtest_fill_limits_assumption (const integer) Limit order execution assumption. Limit orders are filled intrabar only if market price exceeds the limit order level by the specified number of ticks.
default_qty_type (const string) Parameter to determine the number of contracts/shares/lots/units to trade, if the 'qty' = 'NaN'. The allowed values are: strategy.fixed (fixed quantity by default), strategy.cash (specified in currency of the symbol and the amount is converted into quantity), strategy.percent_of_equity (% of currently available equity).
default_qty_value (const float) Number of contracts/shares/lots/units if 'default_qty_type'=strategy.fixed is used; or amount of cash in currency of the symbol if 'default_qty_type'=strategy.cash is used; or number of percents of currently available equity if 'default_qty_type'=strategy.percent_of_equity is used.
currency (const string) Account currency for this strategy. Optional. The default is the currency that the symbol on the chart is traded on. Possible values: currency.NONE, currency.USD, currency.EUR, currency.AUD, currency.GBP, currency.NZD, currency.CAD, currency.CHF, currency.HKD, currency.JPY, currency.NOK, currency.SEK, currency.SGD, currency.TRY, currency.ZAR.
slippage (const integer) Slippage in ticks to be added to/subtracted from the fill price of buy/sell market or stop orders. If mintick=0.01 and slippage=5, the amount of slippage will be 5*0.01=0.05.
commission_type (const string) Commission type for an order. The allowed values are: strategy.commission.percent (a percentage of the cash volume of order), strategy.commission.cash_per_contract (money displayed in the account currency per contract), strategy.commission.cash_per_order (money displayed in the account currency per order).
commission_value (const float) Commission value for an order. Depending on the type selected (commission_type) includes percentage or money.
process_orders_on_close (const bool) When set to 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'.
close_entries_rule (const string) Determines the order in which orders are closed. Allowed values are: 'FIFO' or 'ANY'. FIFO (First-In, First-Out) means that when several trades are open, the earliest trades must be closed first. This rule applies to stocks, futures and US forex (NFA Compliance Rule 2-43b). 'ANY' means that trades may be closed in any order; this is allowed in non-US forex. The default value is 'FIFO'.
max_lines_count (const integer) The number of last line drawings displayed. The default value is 50 and the maximum allowed is 500.
max_labels_count (const integer) The number of last label drawings displayed. The default value is 50 and the maximum allowed is 500.
max_boxes_count (const integer) The number of last box drawings displayed. The default value is 50 and the maximum allowed is 500.
margin_long (const integer) Margin long is the percentage of the purchase price of a security that must be covered by cash or collateral for long positions. The default value is 100 and must be a non negative integer.
margin_short (const integer) Margin short is the percentage of the purchase price of a security that must be covered by cash or collateral for short positions. The default value is 100 and must be a non negative integer.
explicit_plot_zorder (const bool) Specifies the order in which the indicator's plots, fills, and hlines are rendered. If true, the plots will be drawn based on the order in which they appear in the indicator's code, each newer plot being drawn above the previous ones. This only applies to plot*() functions, fill, and hline. Optional. The default is false.
initial_capital (const float) The amount of funds initially available for the strategy to trade, in the currency defined in currency. Optional. The default is 100000.
Example
strategy(title='MyStrategy')
strategy(title=\"MyStrategy\",\u00a0shorttitle=\"MS\",\u00a0pyramiding\u00a0=\u00a010)
Remarks
Every strategy script must have one strategy call.
PineScript code that uses argument calc_on_every_tick=true could calculate differently on history and real-time data.
When using non-standard types of chart as a basis for strategy, you need to realize that the result will be different. The orders will be executed at the prices of this chart (e.g.for Heikin Ashi it\u2019ll take Heikin Ashi prices (the average ones) not the real market prices). Therefore we highly recommend you to use standard chart type for strategies.
", + "description": "The function sets a number of strategy properties.", + "arguments": [ + { + "argument": "title", + "type": "const string" + }, + { + "argument": "shorttitle", + "type": "const string" + }, + { + "argument": "overlay", + "type": "const bool" + }, + { + "argument": "format", + "type": "const string" + }, + { + "argument": "precision", + "type": "const integer" + }, + { + "argument": "scale", + "type": "const integer" + }, + { + "argument": "pyramiding", + "type": "const integer" + }, + { + "argument": "calc_on_order_fills", + "type": "const bool" + }, + { + "argument": "calc_on_every_tick", + "type": "const bool" + }, + { + "argument": "max_bars_back", + "type": "const integer" + }, + { + "argument": "backtest_fill_limits_assumption", + "type": "const integer" + }, + { + "argument": "default_qty_type", + "type": "const string" + }, + { + "argument": "default_qty_value", + "type": "const float" + }, + { + "argument": "currency", + "type": "const string" + }, + { + "argument": "slippage", + "type": "const integer" + }, + { + "argument": "commission_type", + "type": "const string" + }, + { + "argument": "commission_value", + "type": "const float" + }, + { + "argument": "process_orders_on_close", + "type": "const bool" + }, + { + "argument": "close_entries_rule", + "type": "const string" + }, + { + "argument": "max_lines_count", + "type": "const integer" + }, + { + "argument": "max_labels_count", + "type": "const integer" + }, + { + "argument": "max_boxes_count", + "type": "const integer" + }, + { + "argument": "margin_long", + "type": "const integer" + }, + { + "argument": "margin_short", + "type": "const integer" + }, + { + "argument": "explicit_plot_zorder", + "type": "const bool" + }, + { + "argument": "initial_capital", + "type": "const float" + } + ], + "syntax": "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", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.cancel()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_strategy.cancel", + "fragment": "fun_strategy.cancel", + "info": "

strategy.cancel()

It is a command to cancel/deactivate pending orders by referencing their names, which were generated by the functions: strategy.order, strategy.entry and strategy.exit.
Syntax
strategy.cancel(id, when) \u2192 void
Arguments
id (series[string]) A required parameter. The order identifier. It is possible to cancel an order by referencing its identifier.
when (bool) An optional parameter. Condition to cancel an order with specified ID. If condition is true, then the order with specified ID will be cancelled. Default value is 'true'.
Example
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\u00a0false
", + "description": "It is a command to cancel/deactivate pending orders by referencing their names, which were generated by the functions: strategy.order, strategy.entry and strategy.exit.", + "arguments": [ + { + "argument": "id", + "type": "series[string]" + }, + { + "argument": "when", + "type": "bool" + } + ], + "syntax": "strategy.cancel(id, when) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.cancel_all()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_strategy.cancel_all", + "fragment": "fun_strategy.cancel_all", + "info": "

strategy.cancel_all()

It is a command to cancel/deactivate all pending orders, which were generated by the functions: strategy.order, strategy.entry and strategy.exit.
Syntax
strategy.cancel_all(when) \u2192 void
Arguments
when (bool) An optional parameter. Condition to cancel all orders. If condition is true, then all active orders will be cancelled. Default value is 'true'.
Example
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\u00a0true
", + "description": "It is a command to cancel/deactivate all pending orders, which were generated by the functions: strategy.order, strategy.entry and strategy.exit.", + "arguments": [ + { + "argument": "when", + "type": "bool" + } + ], + "syntax": "strategy.cancel_all(when) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.close()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_strategy.close", + "fragment": "fun_strategy.close", + "info": "

strategy.close()

It is a command to exit from the entry with the specified ID. If there were multiple entry orders with the same ID, all of them are exited at once. If there are no open entries with the specified ID by the moment the command is triggered, the command will not come into effect. The command uses market order. Every entry is closed by a separate market order.
Syntax
strategy.close(id, when, comment, qty, qty_percent, alert_message) \u2192 void
Arguments
id (series[string]) A required parameter. The order identifier. It is possible to close an order by referencing its identifier.
when (bool) An optional parameter. Condition of the command.
qty (float) An optional parameter. Number of contracts/shares/lots/units to exit a trade with. The default value is 'NaN'.
qty_percent (float) An optional parameter. Defines the percentage of entered contracts/shares/lots/units to exit a trade with. When its value is not NaN, its priority is lower than that of the 'qty' parameter. Its value can range from 0 to 100. If 'qty' is NaN, the default value of 'qty_percent' is 100.
comment (string) An optional parameter. Additional notes on the order.
alert_message (string) An optional parameter which replaces the {{strategy.order.alert_message}} placeholder when it is used in the \"Create Alert\" dialog box's \"Message\" field.
Example
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)
", + "description": "It is a command to exit from the entry with the specified ID. If there were multiple entry orders with the same ID, all of them are exited at once. If there are no open entries with the specified ID by the moment the command is triggered, the command will not come into effect. The command uses market order. Every entry is closed by a separate market order.", + "arguments": [ + { + "argument": "id", + "type": "series[string]" + }, + { + "argument": "when", + "type": "bool" + }, + { + "argument": "qty", + "type": "float" + }, + { + "argument": "qty_percent", + "type": "float" + }, + { + "argument": "comment", + "type": "string" + }, + { + "argument": "alert_message", + "type": "string" + } + ], + "syntax": "strategy.close(id, when, comment, qty, qty_percent, alert_message) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.close_all()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_strategy.close_all", + "fragment": "fun_strategy.close_all", + "info": "

strategy.close_all()

It is a command to exit from current market position making it flat. If there is no open market position by the moment the command is triggered, the command will not come into effect.
Syntax
strategy.close_all(when, comment, alert_message) \u2192 void
Arguments
when (bool) An optional parameter. Condition of the command.
comment (string) An optional parameter. Additional notes on the order.
alert_message (string) An optional parameter which replaces the {{strategy.order.alert_message}} placeholder when it is used in the \"Create Alert\" dialog box's \"Message\" field.
Example
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)
", + "description": "It is a command to exit from current market position making it flat. If there is no open market position by the moment the command is triggered, the command will not come into effect.", + "arguments": [ + { + "argument": "when", + "type": "bool" + }, + { + "argument": "comment", + "type": "string" + }, + { + "argument": "alert_message", + "type": "string" + } + ], + "syntax": "strategy.close_all(when, comment, alert_message) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.entry()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_strategy.entry", + "fragment": "fun_strategy.entry", + "info": "

strategy.entry()

It is a command to enter market position. If an order with the same ID is already pending, it is possible to modify the order. If there is no order with the specified ID, a new order is placed. To deactivate an entry order, the command strategy.cancel or strategy.cancel_all should be used. In comparison to the function strategy.order, the function strategy.entry is affected by pyramiding and it can reverse market position correctly. If both 'limit' and 'stop' parameters are 'NaN', the order type is market order.
Syntax
strategy.entry(id, long, qty, limit, stop, oca_name, oca_type, comment, when, alert_message) \u2192 void
Arguments
id (series[string]) A required parameter. The order identifier. It is possible to cancel or modify an order by referencing its identifier.
long (bool) A required parameter. Market position direction: 'true' or 'strategy.long' is for long, 'false' or 'strategy.short' is for short.
qty (float) An optional parameter. Number of contracts/shares/lots/units to trade. The default value is 'NaN'.
limit (float) An optional parameter. Limit price of the order. If it is specified, the order type is either 'limit', or 'stop-limit'. 'NaN' should be specified for any other order type.
stop (float) An optional parameter. Stop price of the order. If it is specified, the order type is either 'stop', or 'stop-limit'. 'NaN' should be specified for any other order type.
oca_name (string) An optional parameter. Name of the OCA group the order belongs to. If the order should not belong to any particular OCA group, there should be an empty string.
oca_type (string) An optional parameter. Type of the OCA group. The allowed values are: strategy.oca.none - the order should not belong to any particular OCA group; strategy.oca.cancel - the order should belong to an OCA group, where as soon as an order is filled, all other orders of the same group are cancelled; strategy.oca.reduce - the order should belong to an OCA group, where if X number of contracts of an order is filled, number of contracts for each other order of the same OCA group is decreased by X.
comment (string) An optional parameter. Additional notes on the order.
when (bool) An optional parameter. Condition of the order. The order is placed if condition is 'true'. If condition is 'false', nothing happens (the previously placed order with the same ID is not cancelled). Default value is 'true'.
alert_message (string) An optional parameter which replaces the {{strategy.order.alert_message}} placeholder when it is used in the \"Create Alert\" dialog box's \"Message\" field.
Example
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\u00a0low
", + "description": "It is a command to enter market position. If an order with the same ID is already pending, it is possible to modify the order. If there is no order with the specified ID, a new order is placed. To deactivate an entry order, the command strategy.cancel or strategy.cancel_all should be used. In comparison to the function strategy.order, the function strategy.entry is affected by pyramiding and it can reverse market position correctly. If both 'limit' and 'stop' parameters are 'NaN', the order type is market order.", + "arguments": [ + { + "argument": "id", + "type": "series[string]" + }, + { + "argument": "long", + "type": "bool" + }, + { + "argument": "qty", + "type": "float" + }, + { + "argument": "limit", + "type": "float" + }, + { + "argument": "stop", + "type": "float" + }, + { + "argument": "oca_name", + "type": "string" + }, + { + "argument": "oca_type", + "type": "string" + }, + { + "argument": "comment", + "type": "string" + }, + { + "argument": "when", + "type": "bool" + }, + { + "argument": "alert_message", + "type": "string" + } + ], + "syntax": "strategy.entry(id, long, qty, limit, stop, oca_name, oca_type, comment, when, alert_message) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.exit()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_strategy.exit", + "fragment": "fun_strategy.exit", + "info": "

strategy.exit()

It is a command to exit either a specific entry, or whole market position. If an order with the same ID is already pending, it is possible to modify the order. If an entry order was not filled, but an exit order is generated, the exit order will wait till entry order is filled and then the exit order is placed. To deactivate an exit order, the command strategy.cancel or strategy.cancel_all should be used. If the function strategy.exit is called once, it exits a position only once. If you want to exit multiple times, the command strategy.exit should be called multiple times. If you use a stop loss and a trailing stop, their order type is 'stop', so only one of them is placed (the one that is supposed to be filled first). If all the following parameters 'profit', 'limit', 'loss', 'stop', 'trail_points', 'trail_offset' are 'NaN', the command will fail. To use market order to exit, the command strategy.close or strategy.close_all should be used.
Syntax
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
Arguments
id (series[string]) A required parameter. The order identifier. It is possible to cancel or modify an order by referencing its identifier.
from_entry (series[string]) An optional parameter. The identifier of a specific entry order to exit from it. To exit all entries an empty string should be used. The default values is empty string.
qty (float) An optional parameter. Number of contracts/shares/lots/units to exit a trade with. The default value is 'NaN'.
qty_percent (float) An optional parameter. Defines the percentage of entered contracts/shares/lots/units to exit a trade with. When its value is not NaN, its priority is lower than that of the 'qty' parameter. Its value can range from 0 to 100. If 'qty' is NaN, the default value of 'qty_percent' is 100.
profit (float) An optional parameter. Profit target (specified in ticks). If it is specified, a limit order is placed to exit market position when the specified amount of profit (in ticks) is reached. The default value is 'NaN'.
limit (float) An optional parameter. Profit target (requires a specific price). If it is specified, a limit order is placed to exit market position at the specified price (or better). Priority of the parameter 'limit' is higher than priority of the parameter 'profit' ('limit' is used instead of 'profit', if its value is not 'NaN'). The default value is 'NaN'.
loss (float) An optional parameter. Stop loss (specified in ticks). If it is specified, a stop order is placed to exit market position when the specified amount of loss (in ticks) is reached. The default value is 'NaN'.
stop (float) An optional parameter. Stop loss (requires a specific price). If it is specified, a stop order is placed to exit market position at the specified price (or worse). Priority of the parameter 'stop' is higher than priority of the parameter 'loss' ('stop' is used instead of 'loss', if its value is not 'NaN'). The default value is 'NaN'.
trail_price (float) An optional parameter. Trailing stop activation level (requires a specific price). If it is specified, a trailing stop order will be placed when the specified price level is reached. The offset (in ticks) to determine initial price of the trailing stop order is specified in the 'trail_offset' parameter: X ticks lower than activation level to exit long position; X ticks higher than activation level to exit short position. The default value is 'NaN'.
trail_points (float) An optional parameter. Trailing stop activation level (profit specified in ticks). If it is specified, a trailing stop order will be placed when the calculated price level (specified amount of profit) is reached. The offset (in ticks) to determine initial price of the trailing stop order is specified in the 'trail_offset' parameter: X ticks lower than activation level to exit long position; X ticks higher than activation level to exit short position. The default value is 'NaN'.
trail_offset (float) An optional parameter. Trailing stop price (specified in ticks). The offset in ticks to determine initial price of the trailing stop order: X ticks lower than 'trail_price' or 'trail_points' to exit long position; X ticks higher than 'trail_price' or 'trail_points' to exit short position. The default value is 'NaN'.
oca_name (string) An optional parameter. Name of the OCA group (oca_type = strategy.oca.reduce) the profit target, the stop loss / the trailing stop orders belong to. If the name is not specified, it will be generated automatically.
comment (string) An optional parameter. Additional notes on the order.
when (bool) An optional parameter. Condition of the order. The order is placed if condition is 'true'. If condition is 'false', nothing happens (the previously placed order with the same ID is not cancelled). Default value is 'true'.
alert_message (string) An optional parameter which replaces the {{strategy.order.alert_message}} placeholder when it is used in the \"Create Alert\" dialog box's \"Message\" field.
Example
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\"
", + "description": "It is a command to exit either a specific entry, or whole market position. If an order with the same ID is already pending, it is possible to modify the order. If an entry order was not filled, but an exit order is generated, the exit order will wait till entry order is filled and then the exit order is placed. To deactivate an exit order, the command strategy.cancel or strategy.cancel_all should be used. If the function strategy.exit is called once, it exits a position only once. If you want to exit multiple times, the command strategy.exit should be called multiple times. If you use a stop loss and a trailing stop, their order type is 'stop', so only one of them is placed (the one that is supposed to be filled first). If all the following parameters 'profit', 'limit', 'loss', 'stop', 'trail_points', 'trail_offset' are 'NaN', the command will fail. To use market order to exit, the command strategy.close or strategy.close_all should be used.", + "arguments": [ + { + "argument": "id", + "type": "series[string]" + }, + { + "argument": "from_entry", + "type": "series[string]" + }, + { + "argument": "qty", + "type": "float" + }, + { + "argument": "qty_percent", + "type": "float" + }, + { + "argument": "profit", + "type": "float" + }, + { + "argument": "limit", + "type": "float" + }, + { + "argument": "loss", + "type": "float" + }, + { + "argument": "stop", + "type": "float" + }, + { + "argument": "trail_price", + "type": "float" + }, + { + "argument": "trail_points", + "type": "float" + }, + { + "argument": "trail_offset", + "type": "float" + }, + { + "argument": "oca_name", + "type": "string" + }, + { + "argument": "comment", + "type": "string" + }, + { + "argument": "when", + "type": "bool" + }, + { + "argument": "alert_message", + "type": "string" + } + ], + "syntax": "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", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.order()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_strategy.order", + "fragment": "fun_strategy.order", + "info": "

strategy.order()

It is a command to place order. If an order with the same ID is already pending, it is possible to modify the order. If there is no order with the specified ID, a new order is placed. To deactivate order, the command strategy.cancel or strategy.cancel_all should be used. In comparison to the function strategy.entry, the function strategy.order is not affected by pyramiding. If both 'limit' and 'stop' parameters are 'NaN', the order type is market order.
Syntax
strategy.order(id, long, qty, limit, stop, oca_name, oca_type, comment, when, alert_message) \u2192 void
Arguments
id (series[string]) A required parameter. The order identifier. It is possible to cancel or modify an order by referencing its identifier.
long (bool) A required parameter. Order direction: 'true' or 'strategy.long' is for buy, 'false' or 'strategy.short' is for sell.
qty (float) An optional parameter. Number of contracts/shares/lots/units to trade. The default value is 'NaN'.
limit (float) An optional parameter. Limit price of the order. If it is specified, the order type is either 'limit', or 'stop-limit'. 'NaN' should be specified for any other order type.
stop (float) An optional parameter. Stop price of the order. If it is specified, the order type is either 'stop', or 'stop-limit'. 'NaN' should be specified for any other order type.
oca_name (string) An optional parameter. Name of the OCA group the order belongs to. If the order should not belong to any particular OCA group, there should be an empty string.
oca_type (string) An optional parameter. Type of the OCA group. The allowed values are: strategy.oca.none - the order should not belong to any particular OCA group; strategy.oca.cancel - the order should belong to an OCA group, where as soon as an order is filled, all other orders of the same group are cancelled; strategy.oca.reduce - the order should belong to an OCA group, where if X number of contracts of an order is filled, number of contracts for each other order of the same OCA group is decreased by X.
comment (string) An optional parameter. Additional notes on the order.
when (bool) An optional parameter. Condition of the order. The order is placed if condition is 'true'. If condition is 'false', nothing happens (the previously placed order with the same ID is not cancelled). Default value is 'true'.
alert_message (string) An optional parameter which replaces the {{strategy.order.alert_message}} placeholder when it is used in the \"Create Alert\" dialog box's \"Message\" field.
Example
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\u00a0low
", + "description": "It is a command to place order. If an order with the same ID is already pending, it is possible to modify the order. If there is no order with the specified ID, a new order is placed. To deactivate order, the command strategy.cancel or strategy.cancel_all should be used. In comparison to the function strategy.entry, the function strategy.order is not affected by pyramiding. If both 'limit' and 'stop' parameters are 'NaN', the order type is market order.", + "arguments": [ + { + "argument": "id", + "type": "series[string]" + }, + { + "argument": "long", + "type": "bool" + }, + { + "argument": "qty", + "type": "float" + }, + { + "argument": "limit", + "type": "float" + }, + { + "argument": "stop", + "type": "float" + }, + { + "argument": "oca_name", + "type": "string" + }, + { + "argument": "oca_type", + "type": "string" + }, + { + "argument": "comment", + "type": "string" + }, + { + "argument": "when", + "type": "bool" + }, + { + "argument": "alert_message", + "type": "string" + } + ], + "syntax": "strategy.order(id, long, qty, limit, stop, oca_name, oca_type, comment, when, alert_message) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.risk.allow_entry_in()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_strategy.risk.allow_entry_in", + "fragment": "fun_strategy.risk.allow_entry_in", + "info": "

strategy.risk.allow_entry_in()

The purpose of this rule is to forbid short entries, only long etries will be placed. The rule affects the following function: 'entry'.
Syntax
strategy.risk.allow_entry_in(value) \u2192 void
Arguments
value (string) To determine allowed market position direction, please specify one of the following values: strategy.direction.all (by default), strategy.direction.long, strategy.direction.short
Example
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)
", + "description": "The purpose of this rule is to forbid short entries, only long etries will be placed. The rule affects the following function: 'entry'.", + "arguments": [ + { + "argument": "value", + "type": "string" + } + ], + "syntax": "strategy.risk.allow_entry_in(value) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.risk.max_cons_loss_days()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_strategy.risk.max_cons_loss_days", + "fragment": "fun_strategy.risk.max_cons_loss_days", + "info": "

strategy.risk.max_cons_loss_days()

The purpose of this rule is to cancel all pending orders, close all open positions and stop placing orders after a specified number of consecutive days with losses. The rule affects the whole strategy.
Syntax
strategy.risk.max_cons_loss_days(count, alert_message) \u2192 void
Arguments
count (float) A required parameter. The allowed number of consecutive days with losses.
alert_message (string) An optional parameter which replaces the {{strategy.order.alert_message}} placeholder when it is used in the \"Create Alert\" dialog box's \"Message\" field.
Example
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...
", + "description": "The purpose of this rule is to cancel all pending orders, close all open positions and stop placing orders after a specified number of consecutive days with losses. The rule affects the whole strategy.", + "arguments": [ + { + "argument": "count", + "type": "float" + }, + { + "argument": "alert_message", + "type": "string" + } + ], + "syntax": "strategy.risk.max_cons_loss_days(count, alert_message) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.risk.max_drawdown()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_strategy.risk.max_drawdown", + "fragment": "fun_strategy.risk.max_drawdown", + "info": "

strategy.risk.max_drawdown()

The purpose of this rule is to determine maximum drawdown. The rule affects the whole strategy. Once the maximum drawdown value is reached, all pending orders are cancelled, all open positions are closed and no new orders can be placed.
Syntax
strategy.risk.max_drawdown(value, type, alert_message) \u2192 void
Arguments
value (float) A required parameter. The maximum drawdown value. It is specified either in money (base currency), or in percentage of maximum equity. For % of equity the range of allowed values is from 0 to 100.
type (string) A required parameter. The type of the value. Please specify one of the following values: strategy.percent_of_equity or strategy.cash. Note: if equity drops down to zero or to a negative and the 'strategy.percent_of_equity' is specified, all pending orders are cancelled, all open positions are closed and no new orders can be placed for good.
alert_message (string) An optional parameter which replaces the {{strategy.order.alert_message}} placeholder when it is used in the \"Create Alert\" dialog box's \"Message\" field.
Example
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...\u00a0
", + "description": "The purpose of this rule is to determine maximum drawdown. The rule affects the whole strategy. Once the maximum drawdown value is reached, all pending orders are cancelled, all open positions are closed and no new orders can be placed.", + "arguments": [ + { + "argument": "value", + "type": "float" + }, + { + "argument": "type", + "type": "string" + }, + { + "argument": "alert_message", + "type": "string" + } + ], + "syntax": "strategy.risk.max_drawdown(value, type, alert_message) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.risk.max_intraday_filled_orders()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_strategy.risk.max_intraday_filled_orders", + "fragment": "fun_strategy.risk.max_intraday_filled_orders", + "info": "

strategy.risk.max_intraday_filled_orders()

The purpose of this rule is to determine maximum number of filled orders per 1 day (per 1 bar, if chart resolution is higher than 1 day). The rule affects the whole strategy. Once the maximum number of filled orders is reached, all pending orders are cancelled, all open positions are closed and no new orders can be placed till the end of the current trading session.
Syntax
strategy.risk.max_intraday_filled_orders(count, alert_message) \u2192 void
Arguments
count (float) A required parameter. The maximum number of filled orders per 1 day.
alert_message (string) An optional parameter which replaces the {{strategy.order.alert_message}} placeholder when it is used in the \"Create Alert\" dialog box's \"Message\" field.
Example
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)
", + "description": "The purpose of this rule is to determine maximum number of filled orders per 1 day (per 1 bar, if chart resolution is higher than 1 day). The rule affects the whole strategy. Once the maximum number of filled orders is reached, all pending orders are cancelled, all open positions are closed and no new orders can be placed till the end of the current trading session.", + "arguments": [ + { + "argument": "count", + "type": "float" + }, + { + "argument": "alert_message", + "type": "string" + } + ], + "syntax": "strategy.risk.max_intraday_filled_orders(count, alert_message) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.risk.max_intraday_loss()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_strategy.risk.max_intraday_loss", + "fragment": "fun_strategy.risk.max_intraday_loss", + "info": "

strategy.risk.max_intraday_loss()

The purpose of this rule is to determine maximum loss per 1 day (per 1 bar, if chart resolution is higher than 1 day). The rule affects the whole strategy. Once the maximum loss value is reached, all pending orders are cancelled, all open positions are closed and no new orders can be placed till the end of the current trading session.
Syntax
strategy.risk.max_intraday_loss(value, type, alert_message) \u2192 void
Arguments
value (float) A required parameter. The maximum loss value. It is specified either in money (base currency), or in percentage of maximum intraday equity. For % of equity the range of allowed values is from 0 to 1 (where 1 = 100%).
type (string) A required parameter. The type of the value. Please specify one of the following values: strategy.percent_of_equity or strategy.cash. Note: if equity drops down to zero or to a negative and the strategy.percent_of_equity is specified, all pending orders are cancelled, all open positions are closed and no new orders can be placed for good.
alert_message (string) An optional parameter which replaces the {{strategy.order.alert_message}} placeholder when it is used in the \"Create Alert\" dialog box's \"Message\" field.
Example
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...\u00a0
", + "description": "The purpose of this rule is to determine maximum loss per 1 day (per 1 bar, if chart resolution is higher than 1 day). The rule affects the whole strategy. Once the maximum loss value is reached, all pending orders are cancelled, all open positions are closed and no new orders can be placed till the end of the current trading session.", + "arguments": [ + { + "argument": "value", + "type": "float" + }, + { + "argument": "type", + "type": "string" + }, + { + "argument": "alert_message", + "type": "string" + } + ], + "syntax": "strategy.risk.max_intraday_loss(value, type, alert_message) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "strategy.risk.max_position_size()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_strategy.risk.max_position_size", + "fragment": "fun_strategy.risk.max_position_size", + "info": "

strategy.risk.max_position_size()

The purpose of this rule is to determine maximum size of a market position. The rule affects the following function: strategy.entry. The 'entry' quantity can be reduced (if needed) to such number of contracts/shares/lots/units, so the total position size doesn't exceed the value specified in 'strategy.risk.max_position_size'. If minimum possible quantity still violates the rule, the order will not be placed.
Syntax
strategy.risk.max_position_size(contracts) \u2192 void
Arguments
contracts (float) A required parameter. Maximum number of contracts/shares/lots/units in a position.
Example
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\u00a010
", + "description": "The purpose of this rule is to determine maximum size of a market position. The rule affects the following function: strategy.entry. The 'entry' quantity can be reduced (if needed) to such number of contracts/shares/lots/units, so the total position size doesn't exceed the value specified in 'strategy.risk.max_position_size'. If minimum possible quantity still violates the rule, the order will not be placed.", + "arguments": [ + { + "argument": "contracts", + "type": "float" + } + ], + "syntax": "strategy.risk.max_position_size(contracts) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "string()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_string", + "fragment": "fun_string", + "info": "

string()

Casts na to string
Syntax
string(x) \u2192 const string
string(x) \u2192 input string
string(x) \u2192 string
string(x) \u2192 series[string]
See also
", + "description": "Casts na to string", + "arguments": [], + "syntax": "string(x) \u2192 const string", + "returnType": "const string", + "returns": "" + }, + { + "name": "study()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_study", + "fragment": "fun_study", + "info": "

study()

The function sets a number of study properties.
Syntax
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
Arguments
title (const string) study title that would be seen in Indicators widget. Argument IS REQUIRED.
shorttitle (const string) study short title that would be seen in the chart legend. Argument is optional.
overlay (const bool) if true the study will be added as an overlay for the main series. If false - it would be added on a separate chart pane. Default is false.
format (const string) type of formatting study values on the price axis. Possible values are: format.inherit, format.price, format.volume. Default is format.inherit.
precision (const integer) number of digits after the floating point for study values on the price axis. Must be a non negative integer and not greater than 16. If omitted, using formatting from parent series. If format is format.inherit and this argument is set, then format becomes format.price.
scale (const integer) price scale that the indicator should be attached to. Possible values are: scale.right, scale.left, scale.none. Value scale.none can be applied only in combination with 'overlay=true' setting. If omitted, using scale from main series.
max_bars_back (const integer) Maximum number of bars available for a study for historical reference. This parameter is applied to every built-in or user variable in the script if there is a reference to historical data of a variable in the script code (\u2018[]\u2019 operator is used). Variable buffer sizes in the Pine Script are typically autodetected. This however is not possible in certain cases which is why the parameter allows a user to manually set the lower bound of this value. NOTE: using of the max_bars_back function instead of the parameter is optimal because it applies to only one variable.
linktoseries (const bool) if true then the study will be always on the same pane and same price scale as the main series. Should be used only in combination with 'overlay=true'. Default is false.
resolution (const string) custom resolution of the study, which defines study input and behavior like a study body in the security context. If you specify the empty string resolution, it will appear the same as on the chart. Argument is optional.
max_lines_count (const integer) The number of last line drawings displayed. The default value is 50 and the maximum allowed is 500.
max_labels_count (const integer) The number of last label drawings displayed. The default value is 50 and the maximum allowed is 500.
resolution_gaps (const bool) Merge strategy for the requested data (requested data automatically merges with the main series OHLC data). Possible values: false, true. true - requested data is merged with possible gaps. false - requested data is merged continuously without gaps, all the gaps are filled with the previous nearest existing values. Default value is true.
max_boxes_count (const integer) The number of last box drawings displayed. The default value is 50 and the maximum allowed is 500.
explicit_plot_zorder (const bool) Specifies the order in which the indicator's plots, fills, and hlines are rendered. If true, the plots will be drawn based on the order in which they appear in the indicator's code, each newer plot being drawn above the previous ones. This only applies to plot*() functions, fill, and hline. Optional. The default is false.
Example
study(title='MyScriptStudy')
study(title=\"MyScriptStudy\",\u00a0shorttitle=\"MSS\",\u00a0precision=6,\u00a0overlay=true)
Remarks
Every script must have one study call.
Any function call with side effects will produce errors with the resolution param with any value
See also
", + "description": "The function sets a number of study properties.", + "arguments": [ + { + "argument": "title", + "type": "const string" + }, + { + "argument": "shorttitle", + "type": "const string" + }, + { + "argument": "overlay", + "type": "const bool" + }, + { + "argument": "format", + "type": "const string" + }, + { + "argument": "precision", + "type": "const integer" + }, + { + "argument": "scale", + "type": "const integer" + }, + { + "argument": "max_bars_back", + "type": "const integer" + }, + { + "argument": "linktoseries", + "type": "const bool" + }, + { + "argument": "resolution", + "type": "const string" + }, + { + "argument": "max_lines_count", + "type": "const integer" + }, + { + "argument": "max_labels_count", + "type": "const integer" + }, + { + "argument": "resolution_gaps", + "type": "const bool" + }, + { + "argument": "max_boxes_count", + "type": "const integer" + }, + { + "argument": "explicit_plot_zorder", + "type": "const bool" + } + ], + "syntax": "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", + "returnType": "void", + "returns": "" + }, + { + "name": "sum()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_sum", + "fragment": "fun_sum", + "info": "

sum()

The sum function returns the sliding sum of last y values of x.
Syntax
sum(source, length) \u2192 series[float]
Arguments
source (series[float]) Series of values to process.
length (series[integer]) Number of bars (length). Can be series[integer].
See also
", + "description": "The sum function returns the sliding sum of last y values of x.", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "sum(source, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "supertrend()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_supertrend", + "fragment": "fun_supertrend", + "info": "

supertrend()

The Supertrend Indicator. The Supertrend is a trend following indicator.
Syntax
supertrend(factor, atrPeriod) \u2192 [series[float], series[float]]
Arguments
factor (series) The multiplier by which the ATR will get multiplied.
atrPeriod (integer) Length of ATR.
Example
//@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)
See also
", + "description": "The Supertrend Indicator. The Supertrend is a trend following indicator.", + "arguments": [ + { + "argument": "factor", + "type": "series" + }, + { + "argument": "atrPeriod", + "type": "integer" + } + ], + "syntax": "supertrend(factor, atrPeriod) \u2192 [series[float], series[float]]", + "returnType": "[series[float], series[float]]", + "returns": "" + }, + { + "name": "swma()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_swma", + "fragment": "fun_swma", + "info": "

swma()

Symmetrically weighted moving average with fixed length: 4. Weights: [1/6, 2/6, 2/6, 1/6].
Syntax
swma(x) \u2192 series[float]
Arguments
x (series) Source series.
Example
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))
See also
", + "description": "Symmetrically weighted moving average with fixed length: 4. Weights: [1/6, 2/6, 2/6, 1/6].", + "arguments": [ + { + "argument": "x", + "type": "series" + } + ], + "syntax": "swma(x) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "table()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_table", + "fragment": "fun_table", + "info": "

table()

Casts na to table
Syntax
table(x) \u2192 series[table]
See also
", + "description": "Casts na to table", + "arguments": [], + "syntax": "table(x) \u2192 series[table]", + "returnType": "series[table]", + "returns": "" + }, + { + "name": "table.cell()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_table.cell", + "fragment": "fun_table.cell", + "info": "

table.cell()

The function defines a cell in the table and sets its attributes.
Syntax
table.cell(table_id, column, row, text, width, height, text_color, text_halign, text_valign, text_size, bgcolor) \u2192 void
Arguments
table_id (series[table]) A table object.
column (series[integer]) The index of the cell's column. Numbering starts at 0.
row (series[integer]) The index of the cell's row. Numbering starts at 0.
text (series[string]) The text to be displayed inside the cell. Optional. The default is empty string.
width (series[float]) The width of the cell as a % of the indicator's visual space. Optional. By default, auto-adjusts the width based on the text inside the cell. Value 0 has the same effect.
height (series[float]) The height of the cell as a % of the indicator's visual space. Optional. By default, auto-adjusts the height based on the text inside of the cell. Value 0 has the same effect.
text_color (series[color]) The color of the text. Optional. The default is color.black.
text_halign (series[string]) The horizontal alignment of the cell's text. Optional. The default value is text.align_center. Possible values: text.align_left, text.align_center, text.align_right.
text_valign (series[string]) The vertical alignment of the cell's text. Optional. The default value is text.align_center. Possible values: text.align_top, text.align_center, text.align_bottom.
text_size (series[string]) The size of the text. An optional parameter, the default value is size.normal. Possible values: size.auto, size.tiny, size.small, size.normal, size.large, size.huge.
bgcolor (series[color]) The background color of the text. Optional. The default is no color.
Remarks
This function does not create the table itself, but defines the table\u2019s cells. To use it, you first need to create a table object with table.new.
Each table.cell call overwrites all previously defined properties of a cell. If you call table.cell twice in a row, e.g., the first time with text='Test Text', and the second time with text_color=color.red but without a new text argument, the default value of the 'text' being an empty string, it will overwrite 'Test Text', and your cell will display an empty string. If you want, instead, to modify any of the cell's properties, use the table.cell_set_*() functions.
A single script can only display one table in each of the possible locations. If table.cell is used on several bars to change the same attribute of a cell (e.g. change the background color of the cell to red on the first bar, then to yellow on the second bar), only the last change will be reflected in the table, i.e., the cell\u2019s background will be yellow. Avoid unnecessary setting of cell properties by enclosing function calls in an if barstate.islast block whenever possible, to restrict their execution to the last bar of the series.
See also
", + "description": "The function defines a cell in the table and sets its attributes.", + "arguments": [ + { + "argument": "table_id", + "type": "series[table]" + }, + { + "argument": "column", + "type": "series[integer]" + }, + { + "argument": "row", + "type": "series[integer]" + }, + { + "argument": "text", + "type": "series[string]" + }, + { + "argument": "width", + "type": "series[float]" + }, + { + "argument": "height", + "type": "series[float]" + }, + { + "argument": "text_color", + "type": "series[color]" + }, + { + "argument": "text_halign", + "type": "series[string]" + }, + { + "argument": "text_valign", + "type": "series[string]" + }, + { + "argument": "text_size", + "type": "series[string]" + }, + { + "argument": "bgcolor", + "type": "series[color]" + } + ], + "syntax": "table.cell(table_id, column, row, text, width, height, text_color, text_halign, text_valign, text_size, bgcolor) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "table.cell_set_bgcolor()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_table.cell_set_bgcolor", + "fragment": "fun_table.cell_set_bgcolor", + "info": "

table.cell_set_bgcolor()

The function sets the background color of the cell.
Syntax
table.cell_set_bgcolor(table_id, column, row, bgcolor) \u2192 void
Arguments
table_id (series[table]) A table object.
column (series[integer]) The index of the cell's column. Numbering starts at 0.
row (series[integer]) The index of the cell's row. Numbering starts at 0.
bgcolor (series[color]) The background color of the cell.
See also
", + "description": "The function sets the background color of the cell.", + "arguments": [ + { + "argument": "table_id", + "type": "series[table]" + }, + { + "argument": "column", + "type": "series[integer]" + }, + { + "argument": "row", + "type": "series[integer]" + }, + { + "argument": "bgcolor", + "type": "series[color]" + } + ], + "syntax": "table.cell_set_bgcolor(table_id, column, row, bgcolor) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "table.cell_set_height()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_table.cell_set_height", + "fragment": "fun_table.cell_set_height", + "info": "

table.cell_set_height()

The function sets the height of cell.
Syntax
table.cell_set_height(table_id, column, row, height) \u2192 void
Arguments
table_id (series[table]) A table object.
column (series[integer]) The index of the cell's column. Numbering starts at 0.
row (series[integer]) The index of the cell's row. Numbering starts at 0.
height (series[float]) The height of the cell as a % of the chart window. Passing 0 auto-adjusts the height based on the text inside of the cell.
See also
", + "description": "The function sets the height of cell.", + "arguments": [ + { + "argument": "table_id", + "type": "series[table]" + }, + { + "argument": "column", + "type": "series[integer]" + }, + { + "argument": "row", + "type": "series[integer]" + }, + { + "argument": "height", + "type": "series[float]" + } + ], + "syntax": "table.cell_set_height(table_id, column, row, height) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "table.cell_set_text()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_table.cell_set_text", + "fragment": "fun_table.cell_set_text", + "info": "

table.cell_set_text()

The function sets the text in the specified cell.
Syntax
table.cell_set_text(table_id, column, row, text) \u2192 void
Arguments
table_id (series[table]) A table object.
column (series[integer]) The index of the cell's column. Numbering starts at 0.
row (series[integer]) The index of the cell's row. Numbering starts at 0.
text (series[string]) The text to be displayed inside the cell.
Example
//@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\")
See also
", + "description": "The function sets the text in the specified cell.", + "arguments": [ + { + "argument": "table_id", + "type": "series[table]" + }, + { + "argument": "column", + "type": "series[integer]" + }, + { + "argument": "row", + "type": "series[integer]" + }, + { + "argument": "text", + "type": "series[string]" + } + ], + "syntax": "table.cell_set_text(table_id, column, row, text) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "table.cell_set_text_color()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_table.cell_set_text_color", + "fragment": "fun_table.cell_set_text_color", + "info": "

table.cell_set_text_color()

The function sets the color of the text inside the cell.
Syntax
table.cell_set_text_color(table_id, column, row, text_color) \u2192 void
Arguments
table_id (series[table]) A table object.
column (series[integer]) The index of the cell's column. Numbering starts at 0.
row (series[integer]) The index of the cell's row. Numbering starts at 0.
text_color (series[color]) The color of the text.
See also
", + "description": "The function sets the color of the text inside the cell.", + "arguments": [ + { + "argument": "table_id", + "type": "series[table]" + }, + { + "argument": "column", + "type": "series[integer]" + }, + { + "argument": "row", + "type": "series[integer]" + }, + { + "argument": "text_color", + "type": "series[color]" + } + ], + "syntax": "table.cell_set_text_color(table_id, column, row, text_color) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "table.cell_set_text_halign()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_table.cell_set_text_halign", + "fragment": "fun_table.cell_set_text_halign", + "info": "

table.cell_set_text_halign()

The function sets the horizontal alignment of the cell's text.
Syntax
table.cell_set_text_halign(table_id, column, row, text_halign) \u2192 void
Arguments
table_id (series[table]) A table object.
column (series[integer]) The index of the cell's column. Numbering starts at 0.
row (series[integer]) The index of the cell's row. Numbering starts at 0.
text_halign (series[string]) The horizontal alignment of a cell's text. Possible values: text.align_left, text.align_center, text.align_right.
See also
", + "description": "The function sets the horizontal alignment of the cell's text.", + "arguments": [ + { + "argument": "table_id", + "type": "series[table]" + }, + { + "argument": "column", + "type": "series[integer]" + }, + { + "argument": "row", + "type": "series[integer]" + }, + { + "argument": "text_halign", + "type": "series[string]" + } + ], + "syntax": "table.cell_set_text_halign(table_id, column, row, text_halign) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "table.cell_set_text_size()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_table.cell_set_text_size", + "fragment": "fun_table.cell_set_text_size", + "info": "

table.cell_set_text_size()

The function sets the size of the cell's text.
Syntax
table.cell_set_text_size(table_id, column, row, text_size) \u2192 void
Arguments
table_id (series[table]) A table object.
column (series[integer]) The index of the cell's column. Numbering starts at 0.
row (series[integer]) The index of the cell's row. Numbering starts at 0.
text_size (series[string]) The size of the text. Possible values: size.auto, size.tiny, size.small, size.normal, size.large, size.huge.
See also
", + "description": "The function sets the size of the cell's text.", + "arguments": [ + { + "argument": "table_id", + "type": "series[table]" + }, + { + "argument": "column", + "type": "series[integer]" + }, + { + "argument": "row", + "type": "series[integer]" + }, + { + "argument": "text_size", + "type": "series[string]" + } + ], + "syntax": "table.cell_set_text_size(table_id, column, row, text_size) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "table.cell_set_text_valign()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_table.cell_set_text_valign", + "fragment": "fun_table.cell_set_text_valign", + "info": "

table.cell_set_text_valign()

The function sets the vertical alignment of a cell's text.
Syntax
table.cell_set_text_valign(table_id, column, row, text_valign) \u2192 void
Arguments
table_id (series[table]) A table object.
column (series[integer]) The index of the cell's column. Numbering starts at 0.
row (series[integer]) The index of the cell's row. Numbering starts at 0.
text_valign (series[string]) The vertical alignment of the cell's text. Possible values: text.align_top, text.align_center, text.align_bottom.
See also
", + "description": "The function sets the vertical alignment of a cell's text.", + "arguments": [ + { + "argument": "table_id", + "type": "series[table]" + }, + { + "argument": "column", + "type": "series[integer]" + }, + { + "argument": "row", + "type": "series[integer]" + }, + { + "argument": "text_valign", + "type": "series[string]" + } + ], + "syntax": "table.cell_set_text_valign(table_id, column, row, text_valign) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "table.cell_set_width()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_table.cell_set_width", + "fragment": "fun_table.cell_set_width", + "info": "

table.cell_set_width()

The function sets the width of the cell.
Syntax
table.cell_set_width(table_id, column, row, width) \u2192 void
Arguments
table_id (series[table]) A table object.
column (series[integer]) The index of the cell's column. Numbering starts at 0.
row (series[integer]) The index of the cell's row. Numbering starts at 0.
width (series[float]) The width of the cell as a % of the chart window. Passing 0 auto-adjusts the width based on the text inside of the cell.
See also
", + "description": "The function sets the width of the cell.", + "arguments": [ + { + "argument": "table_id", + "type": "series[table]" + }, + { + "argument": "column", + "type": "series[integer]" + }, + { + "argument": "row", + "type": "series[integer]" + }, + { + "argument": "width", + "type": "series[float]" + } + ], + "syntax": "table.cell_set_width(table_id, column, row, width) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "table.clear()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_table.clear", + "fragment": "fun_table.clear", + "info": "

table.clear()

The function removes a cell or a sequence of cells from the table. The cells are removed in a rectangle shape where the start_column and start_row specify the top-left corner, and end_column and end_row specify the bottom-right corner.
Syntax
table.clear(table_id, start_column, start_row, end_column, end_row) \u2192 void
Arguments
table_id (series[table]) A table object.
start_column (series[integer]) The index of the column of the first cell to delete. Numbering starts at 0.
start_row (series[integer]) The index of the row of the first cell to delete. Numbering starts at 0.
end_column (series[integer]) The index of the column of the last cell to delete. Optional. The default is the argument used for start_column. Numbering starts at 0.
end_row (series[integer]) The index of the row of the last cell to delete. Optional. The default is the argument used for start_row. Numbering starts at 0.
Example
//@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)
See also
", + "description": "The function removes a cell or a sequence of cells from the table. The cells are removed in a rectangle shape where the start_column and start_row specify the top-left corner, and end_column and end_row specify the bottom-right corner.", + "arguments": [ + { + "argument": "table_id", + "type": "series[table]" + }, + { + "argument": "start_column", + "type": "series[integer]" + }, + { + "argument": "start_row", + "type": "series[integer]" + }, + { + "argument": "end_column", + "type": "series[integer]" + }, + { + "argument": "end_row", + "type": "series[integer]" + } + ], + "syntax": "table.clear(table_id, start_column, start_row, end_column, end_row) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "table.delete()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_table.delete", + "fragment": "fun_table.delete", + "info": "

table.delete()

The function deletes a table.
Syntax
table.delete(table_id) \u2192 void
Arguments
table_id (series[table]) A table object.
Example
//@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)
See also
", + "description": "The function deletes a table.", + "arguments": [ + { + "argument": "table_id", + "type": "series[table]" + } + ], + "syntax": "table.delete(table_id) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "table.new()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_table.new", + "fragment": "fun_table.new", + "info": "

table.new()

The function creates a new table.
Syntax
table.new(position, columns, rows, bgcolor, frame_color, frame_width, border_color, border_width) \u2192 series[table]
Arguments
columns (series[integer]) The number of columns in the table.
rows (series[integer]) The number of rows in the table.
bgcolor (series[color]) The background color of the table. Optional. The default is no color.
frame_color (series[color]) The color of the outer frame of the table. Optional. The default is no color.
frame_width (series[integer]) The width of the outer frame of the table. Optional. The default is 0.
border_color (series[color]) The color of the borders of the cells (excluding the outer frame). Optional. The default is no color.
border_width (series[integer]) The width of the borders of the cells (excluding the outer frame). Optional. The default is 0.
Example
//@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)
Remarks
This function creates the table object itself, but the table will not be displayed until its cells are populated. To define a cell and change its contents or attributes, use table.cell and other table.cell_*() functions.
One table.new call can only display one table (the last one drawn), but the function itself will be recalculated on each bar it is used on. For performance reasons, it is wise to use table.new in conjunction with either the var keyword (so the table object is only created on the first bar) or in an if barstate.islast block (so the table object is only created on the last bar).
See also
", + "description": "The function creates a new table.", + "arguments": [ + { + "argument": "position", + "type": "series[string]" + }, + { + "argument": "columns", + "type": "series[integer]" + }, + { + "argument": "rows", + "type": "series[integer]" + }, + { + "argument": "bgcolor", + "type": "series[color]" + }, + { + "argument": "frame_color", + "type": "series[color]" + }, + { + "argument": "frame_width", + "type": "series[integer]" + }, + { + "argument": "border_color", + "type": "series[color]" + }, + { + "argument": "border_width", + "type": "series[integer]" + } + ], + "syntax": "table.new(position, columns, rows, bgcolor, frame_color, frame_width, border_color, border_width) \u2192 series[table]", + "returnType": "series[table]", + "returns": "" + }, + { + "name": "table.set_bgcolor()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_table.set_bgcolor", + "fragment": "fun_table.set_bgcolor", + "info": "

table.set_bgcolor()

The function sets the background color of a table.
Syntax
table.set_bgcolor(table_id, bgcolor) \u2192 void
Arguments
table_id (series[table]) A table object.
bgcolor (series[color]) The background color of the table. Optional. The default is no color.
See also
", + "description": "The function sets the background color of a table.", + "arguments": [ + { + "argument": "table_id", + "type": "series[table]" + }, + { + "argument": "bgcolor", + "type": "series[color]" + } + ], + "syntax": "table.set_bgcolor(table_id, bgcolor) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "table.set_border_color()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_table.set_border_color", + "fragment": "fun_table.set_border_color", + "info": "

table.set_border_color()

The function sets the color of the borders (excluding the outer frame) of the table's cells.
Syntax
table.set_border_color(table_id, border_color) \u2192 void
Arguments
table_id (series[table]) A table object.
border_color (series[color]) The color of the borders. Optional. The default is no color.
See also
", + "description": "The function sets the color of the borders (excluding the outer frame) of the table's cells.", + "arguments": [ + { + "argument": "table_id", + "type": "series[table]" + }, + { + "argument": "border_color", + "type": "series[color]" + } + ], + "syntax": "table.set_border_color(table_id, border_color) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "table.set_border_width()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_table.set_border_width", + "fragment": "fun_table.set_border_width", + "info": "

table.set_border_width()

The function sets the width of the borders (excluding the outer frame) of the table's cells.
Syntax
table.set_border_width(table_id, border_width) \u2192 void
Arguments
table_id (series[table]) A table object.
border_width (series[integer]) The width of the borders. Optional. The default is 0.
See also
", + "description": "The function sets the width of the borders (excluding the outer frame) of the table's cells.", + "arguments": [ + { + "argument": "table_id", + "type": "series[table]" + }, + { + "argument": "border_width", + "type": "series[integer]" + } + ], + "syntax": "table.set_border_width(table_id, border_width) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "table.set_frame_color()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_table.set_frame_color", + "fragment": "fun_table.set_frame_color", + "info": "

table.set_frame_color()

The function sets the color of the outer frame of a table.
Syntax
table.set_frame_color(table_id, frame_color) \u2192 void
Arguments
table_id (series[table]) A table object.
frame_color (series[color]) The color of the frame of the table. Optional. The default is no color.
See also
", + "description": "The function sets the color of the outer frame of a table.", + "arguments": [ + { + "argument": "table_id", + "type": "series[table]" + }, + { + "argument": "frame_color", + "type": "series[color]" + } + ], + "syntax": "table.set_frame_color(table_id, frame_color) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "table.set_frame_width()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_table.set_frame_width", + "fragment": "fun_table.set_frame_width", + "info": "

table.set_frame_width()

The function set the width of the outer frame of a table.
Syntax
table.set_frame_width(table_id, frame_width) \u2192 void
Arguments
table_id (series[table]) A table object.
frame_width (series[integer]) The width of the outer frame of the table. Optional. The default is 0.
See also
", + "description": "The function set the width of the outer frame of a table.", + "arguments": [ + { + "argument": "table_id", + "type": "series[table]" + }, + { + "argument": "frame_width", + "type": "series[integer]" + } + ], + "syntax": "table.set_frame_width(table_id, frame_width) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "table.set_position()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_table.set_position", + "fragment": "fun_table.set_position", + "info": "

table.set_position()

The function sets the position of a table.
Syntax
table.set_position(table_id, position) \u2192 void
Arguments
table_id (series[table]) A table object.
See also
", + "description": "The function sets the position of a table.", + "arguments": [ + { + "argument": "table_id", + "type": "series[table]" + }, + { + "argument": "position", + "type": "series[string]" + } + ], + "syntax": "table.set_position(table_id, position) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "tan()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_tan", + "fragment": "fun_tan", + "info": "

tan()

The tan function returns the trigonometric tangent of an angle.
Syntax
tan(x) \u2192 float
tan(x) \u2192 input float
tan(x) \u2192 const float
tan(x) \u2192 series[float]
Arguments
x (series[float]) Angle, in radians.
", + "description": "The tan function returns the trigonometric tangent of an angle.", + "arguments": [ + { + "argument": "x", + "type": "series[float]" + } + ], + "syntax": "tan(x) \u2192 float", + "returnType": "float", + "returns": "" + }, + { + "name": "tickerid()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_tickerid", + "fragment": "fun_tickerid", + "info": "

tickerid()

Creates a ticker identifier for requesting additional data for the script.
Syntax
tickerid(prefix, ticker, session, adjustment) \u2192 string
Arguments
prefix (string) Exchange prefix. For example: 'BATS', 'NYSE', 'NASDAQ'. Exchange prefix of main series is syminfo.prefix.
ticker (string) Ticker name. For example 'AAPL', 'MSFT', 'EURUSD'. Ticker name of the main series is syminfo.ticker.
session (string) Session type. Optional argument. Possible values: session.regular, session.extended. Session type of the current chart is syminfo.session. If session is not given, then syminfo.session value is used.
adjustment (string) Adjustment type. Optional argument. Possible values: adjustment.none, adjustment.splits, adjustment.dividends. If adjustment is not given, then default adjustment value is used (can be different depending on particular instrument).
Example
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)
Remarks
You may use return value of tickerid function as input argument for heikinashi, renko, linebreak, kagi, pointfigure functions.
See also
", + "description": "Creates a ticker identifier for requesting additional data for the script.", + "arguments": [ + { + "argument": "prefix", + "type": "string" + }, + { + "argument": "ticker", + "type": "string" + }, + { + "argument": "session", + "type": "string" + }, + { + "argument": "adjustment", + "type": "string" + } + ], + "syntax": "tickerid(prefix, ticker, session, adjustment) \u2192 string", + "returnType": "string", + "returns": "" + }, + { + "name": "time()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_time", + "fragment": "fun_time", + "info": "

time()

The time function returns the UNIX time of the current bar for the specified resolution and session or NaN if the time point is out of session.
Syntax
time(resolution, session, timezone) \u2192 series[integer]
time(resolution, session) \u2192 series[integer]
time(resolution) \u2192 series[integer]
Arguments
resolution (string) Resolution. An empty string is interpreted as the current resolution of the chart.
session (string) Session specification. Optional argument, session of the symbol is used by default. An empty string is interpreted as the session of the symbol.
timezone (string) Timezone of the 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\").
Example
//@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\"))
While setting up a session you can specify not just the hours and minutes but also the days of the week that will be included in that session.
If the days aren't specified, the session is considered to have been set from Monday to Friday (Saturday and Sunday are excluded as the weekend days), i.e. \"1100-2000\" is the same as \"1100-1200:23456\".
For example, on a symbol that is traded seven days a week with the 24-hour trading session the following script will not color Saturdays and Sundays:
Example
//@version=4
study(\"Time\",\u00a0overlay=true)
t1\u00a0=\u00a0time(timeframe.period,\u00a0\"0000-0000\")
bgcolor(t1\u00a0?\u00a0color.blue\u00a0:\u00a0na)
You can change that by specifying the days:
Example
//@version=4
study(\"Time\u00a0-\u00a0days\",\u00a0overlay=true)
t1\u00a0=\u00a0time(timeframe.period,\u00a0\"0000-0000:1234567\")
bgcolor(t1\u00a0?\u00a0color.green\u00a0:\u00a0na)
Remarks
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.
See also
", + "description": "The time function returns the UNIX time of the current bar for the specified resolution and session or NaN if the time point is out of session.", + "arguments": [ + { + "argument": "resolution", + "type": "string" + }, + { + "argument": "session", + "type": "string" + }, + { + "argument": "timezone", + "type": "string" + } + ], + "syntax": "time(resolution, session, timezone) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "time_close()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_time_close", + "fragment": "fun_time_close", + "info": "

time_close()

The time_close function returns the UNIX time of the close of the current bar for the specified resolution and session or NaN if the time point is out of session.
Syntax
time_close(resolution, session, timezone) \u2192 series[integer]
time_close(resolution, session) \u2192 series[integer]
time_close(resolution) \u2192 series[integer]
Arguments
resolution (string) Resolution. An empty string is interpreted as the current resolution of the chart.
session (string) Session specification. Optional argument, session of the symbol is used by default. An empty string is interpreted as the session of the symbol.
timezone (string) Timezone of the 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\").
Example
//@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)
Remarks
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.
See also
", + "description": "The time_close function returns the UNIX time of the close of the current bar for the specified resolution and session or NaN if the time point is out of session.", + "arguments": [ + { + "argument": "resolution", + "type": "string" + }, + { + "argument": "session", + "type": "string" + }, + { + "argument": "timezone", + "type": "string" + } + ], + "syntax": "time_close(resolution, session, timezone) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "timestamp()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_timestamp", + "fragment": "fun_timestamp", + "info": "

timestamp()

Function timestamp returns UNIX time of specified date and time.
Syntax
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]
Arguments
timezone (string) Timezone. 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\").
year (integer) Year.
month (integer) Month.
day (integer) Day.
hour (integer) (Optional argument) Hour. Default is 0.
minute (integer) (Optional argument) Minute. Default is 0.
second (integer) (Optional argument) Second. Default is 0.
dateString (string) A string containing the date and, optionally, the time and time zone. Its format must comply with either the [IETF RFC 2822](https://tools.ietf.org/html/rfc2822#section-3.3\" rel=\"nofollow) or [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601\" rel=\"nofollow) standards (\"DD MMM YYYY hh:mm:ss \u00b1hhmm\" or \"YYYY-MM-DDThh:mm:ss\u00b1hh:mm\", so \"20 Feb 2020\" or \"2020-02-20\"). If no time is supplied, \"00:00\" is used. If no time zone is supplied, GMT+0 will be used. Note that this diverges from the usual behavior of the function where it returns time in the exchange's timezone.
Example
//@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\"))
Remarks
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.
See also
", + "description": "Function timestamp returns UNIX time of specified date and time.", + "arguments": [ + { + "argument": "timezone", + "type": "string" + }, + { + "argument": "year", + "type": "integer" + }, + { + "argument": "month", + "type": "integer" + }, + { + "argument": "day", + "type": "integer" + }, + { + "argument": "hour", + "type": "integer" + }, + { + "argument": "minute", + "type": "integer" + }, + { + "argument": "second", + "type": "integer" + }, + { + "argument": "dateString", + "type": "string" + } + ], + "syntax": "timestamp(dateString) \u2192 const integer", + "returnType": "const integer", + "returns": "" + }, + { + "name": "todegrees()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_todegrees", + "fragment": "fun_todegrees", + "info": "

todegrees()

Returns an approximately equivalent angle in degrees from an angle measured in radians.
Syntax
todegrees(radians) \u2192 series[float]
Arguments
radians (series) Angle in radians.
", + "description": "Returns an approximately equivalent angle in degrees from an angle measured in radians.", + "arguments": [ + { + "argument": "radians", + "type": "series" + } + ], + "syntax": "todegrees(radians) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "tonumber()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_tonumber", + "fragment": "fun_tonumber", + "info": "

tonumber()

Syntax
tonumber(x) \u2192 series[float]
Arguments
x (string) String representation of an int or float.
", + "description": "", + "arguments": [ + { + "argument": "x", + "type": "string" + } + ], + "syntax": "tonumber(x) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "toradians()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_toradians", + "fragment": "fun_toradians", + "info": "

toradians()

Returns an approximately equivalent angle in radians from an angle measured in degrees.
Syntax
toradians(degrees) \u2192 series[float]
Arguments
degrees (series) Angle in degrees.
", + "description": "Returns an approximately equivalent angle in radians from an angle measured in degrees.", + "arguments": [ + { + "argument": "degrees", + "type": "series" + } + ], + "syntax": "toradians(degrees) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "tostring()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_tostring", + "fragment": "fun_tostring", + "info": "

tostring()

Syntax
tostring(x) \u2192 series[string]
tostring(x, y) \u2192 series[string]
tostring(x) \u2192 string
tostring(x, y) \u2192 string
Arguments
x (integer, float, bool, string, array ID) Value, or array ID of type int[], float[], bool[] or string[] whose elements are converted to a string.
y (string) Format string. Accepts these format.* constants: format.mintick, format.percent, format.volume. Optional. The default value is '#.##########'.
Remarks
The formatting of float values will also round those values when necessary, e.g. tostring(3.99, '#') will return \"4\".
To display trailing zeros, use '0' instead of '#'. For example, '#.000'.
When using format.mintick, the value will be rounded to the nearest number that can be divided by syminfo.mintick without the remainder. The string is returned with trailing zeroes.
If the x argument is a string, the same string value will be returned.
Bool type arguments return \"true\" or \"false\".
When x is na, the function returns \"NaN\".
", + "description": "", + "arguments": [ + { + "argument": "x", + "type": "integer, float, bool, string, array ID" + }, + { + "argument": "y", + "type": "string" + } + ], + "syntax": "tostring(x) \u2192 series[string]", + "returnType": "series[string]", + "returns": "" + }, + { + "name": "tr()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_tr", + "fragment": "fun_tr", + "info": "

tr()

Syntax
tr(handle_na) \u2192 series[float]
Arguments
handle_na (bool) How NaN values are handled. if true, and previous day's close is NaN then tr would be calculated as current day high-low. Otherwise (if false) tr would return NaN in such cases. Also note, that atr uses tr(true).
Remarks
tr(false) is exactly the same as tr.
See also
", + "description": "", + "arguments": [ + { + "argument": "handle_na", + "type": "bool" + } + ], + "syntax": "tr(handle_na) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "tsi()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_tsi", + "fragment": "fun_tsi", + "info": "

tsi()

True strength index. It uses moving averages of the underlying momentum of a financial instrument.
Syntax
tsi(source, short_length, long_length) \u2192 series[float]
Arguments
source (series) Source series.
short_length (integer) Short length.
long_length (integer) Long length.
", + "description": "True strength index. It uses moving averages of the underlying momentum of a financial instrument.", + "arguments": [ + { + "argument": "source", + "type": "series" + }, + { + "argument": "short_length", + "type": "integer" + }, + { + "argument": "long_length", + "type": "integer" + } + ], + "syntax": "tsi(source, short_length, long_length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "valuewhen()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_valuewhen", + "fragment": "fun_valuewhen", + "info": "

valuewhen()

Source series value when the condition was true on the n-th most recent occurrence.
Syntax
valuewhen(condition, source, occurrence) \u2192 series[float]
valuewhen(condition, source, occurrence) \u2192 series[integer]
Example
slow\u00a0=\u00a0sma(close,\u00a07)
fast\u00a0=\u00a0sma(close,\u00a014)
//\u00a0get\u00a0value\u00a0of\u00a0close\u00a0on\u00a0second\u00a0cross\u00a0occurrence
valuewhen(cross(slow,\u00a0fast),\u00a0close,\u00a01)
Remarks
Please note that using this variable/function can cause indicator repainting.
See also
", + "description": "Source series value when the condition was true on the n-th most recent occurrence.", + "arguments": [], + "syntax": "valuewhen(condition, source, occurrence) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "variance()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_variance", + "fragment": "fun_variance", + "info": "

variance()

Variance is the expectation of the squared deviation of a series from its mean (sma), and it informally measures how far a set of numbers are spread out from their mean.
Syntax
variance(source, length) \u2192 series[float]
Arguments
source (series[float]) Series of values to process.
length (series[integer]) Number of bars (length).
Remarks
This is a biased estimation of sample variance.
See also
", + "description": "Variance is the expectation of the squared deviation of a series from its mean (sma), and it informally measures how far a set of numbers are spread out from their mean.", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "variance(source, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "vwap()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_vwap", + "fragment": "fun_vwap", + "info": "

vwap()

Volume weighted average price.
Syntax
vwap(x) \u2192 series[float]
Arguments
x (series) Source series.
See also
", + "description": "Volume weighted average price.", + "arguments": [ + { + "argument": "x", + "type": "series" + } + ], + "syntax": "vwap(x) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "vwma()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_vwma", + "fragment": "fun_vwma", + "info": "

vwma()

The vwma function returns volume-weighted moving average of x for y bars back. It is the same as: sma(x * volume, y) / sma(volume, y)
Syntax
vwma(source, length) \u2192 series[float]
Arguments
source (series[float]) Series of values to process.
length (series[integer]) Number of bars (length). Can be series[integer].
Example
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))
See also
", + "description": "The vwma function returns volume-weighted moving average of x for y bars back. It is the same as: sma(x * volume, y) / sma(volume, y)", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "vwma(source, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "weekofyear()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_weekofyear", + "fragment": "fun_weekofyear", + "info": "

weekofyear()

Syntax
weekofyear(time) \u2192 series[integer]
weekofyear(time, timezone) \u2192 series[integer]
Arguments
time (series) UNIX time in milliseconds.
timezone (string) An optional parameter. Timezone.
Remarks
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970. By default, the Timezone is syminfo.timezone, possible values can be seen in timestamp.
Note that this function returns the week based on the time of the bar's open. For overnight sessions (e.g. EURUSD, where Monday session starts on Sunday, 17:00) this value can be lower by 1 than the week of the trading day.
See also
", + "description": "", + "arguments": [ + { + "argument": "time", + "type": "series" + }, + { + "argument": "timezone", + "type": "string" + } + ], + "syntax": "weekofyear(time) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + }, + { + "name": "wma()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_wma", + "fragment": "fun_wma", + "info": "

wma()

The wma function returns weighted moving average of x for y bars back. In wma weighting factors decrease in arithmetical progression.
Syntax
wma(source, length) \u2192 series[float]
Arguments
source (series[float]) Series of values to process.
length (series[integer]) Number of bars (length). Can be series[integer].
Example
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))
See also
", + "description": "The wma function returns weighted moving average of x for y bars back. In wma weighting factors decrease in arithmetical progression.", + "arguments": [ + { + "argument": "source", + "type": "series[float]" + }, + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "wma(source, length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "wpr()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_wpr", + "fragment": "fun_wpr", + "info": "

wpr()

Williams %R. The oscillator shows the current closing price in relation to the high and low of the past 'length' bars.
Syntax
wpr(length) \u2192 series[float]
Arguments
length (series[integer]) Number of bars.
Example
//@version=4
study(\"Williams\u00a0%R\",\u00a0shorttitle=\"%R\",\u00a0format=format.price,\u00a0precision=2)
plot(wpr(14),\u00a0title=\"%R\",\u00a0color=#ff6d00,\u00a0transp=0)
See also
", + "description": "Williams %R. The oscillator shows the current closing price in relation to the high and low of the past 'length' bars.", + "arguments": [ + { + "argument": "length", + "type": "series[integer]" + } + ], + "syntax": "wpr(length) \u2192 series[float]", + "returnType": "series[float]", + "returns": "" + }, + { + "name": "year()", + "url": "https://www.tradingview.com/pine-script-reference/v4/#fun_year", + "fragment": "fun_year", + "info": "

year()

Syntax
year(time) \u2192 series[integer]
year(time, timezone) \u2192 series[integer]
Arguments
time (series) UNIX time in milliseconds.
timezone (string) An optional parameter. Timezone.
Remarks
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970. By default, the Timezone is syminfo.timezone, possible values can be seen in timestamp.
Note that this function returns the year based on the time of the bar's open. For overnight sessions (e.g. EURUSD, where Monday session starts on Sunday, 17:00 UTC-4) this value can be lower by 1 than the year of the trading day.
See also
", + "description": "", + "arguments": [ + { + "argument": "time", + "type": "series" + }, + { + "argument": "timezone", + "type": "string" + } + ], + "syntax": "year(time) \u2192 series[integer]", + "returnType": "series[integer]", + "returns": "" + } +] \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/definitions/v4/keywords.json b/pine-script-intellij-plugin/bin/main/definitions/v4/keywords.json new file mode 100644 index 0000000..8c1a311 --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/definitions/v4/keywords.json @@ -0,0 +1,38 @@ +[ + { + "name": "and", + "url": "https://www.tradingview.com/pine-script-reference/v4/#kw_and" + }, + { + "name": "false", + "url": "https://www.tradingview.com/pine-script-reference/v4/#kw_false" + }, + { + "name": "for", + "url": "https://www.tradingview.com/pine-script-reference/v4/#kw_for" + }, + { + "name": "if", + "url": "https://www.tradingview.com/pine-script-reference/v4/#kw_if" + }, + { + "name": "not", + "url": "https://www.tradingview.com/pine-script-reference/v4/#kw_not" + }, + { + "name": "or", + "url": "https://www.tradingview.com/pine-script-reference/v4/#kw_or" + }, + { + "name": "true", + "url": "https://www.tradingview.com/pine-script-reference/v4/#kw_true" + }, + { + "name": "var", + "url": "https://www.tradingview.com/pine-script-reference/v4/#kw_var" + }, + { + "name": "varip", + "url": "https://www.tradingview.com/pine-script-reference/v4/#kw_varip" + } +] \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/definitions/v4/operators.json b/pine-script-intellij-plugin/bin/main/definitions/v4/operators.json new file mode 100644 index 0000000..0166966 --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/definitions/v4/operators.json @@ -0,0 +1,74 @@ +[ + { + "name": "-", + "url": "https://www.tradingview.com/pine-script-reference/v4/#op_-" + }, + { + "name": "-=", + "url": "https://www.tradingview.com/pine-script-reference/v4/#op_-=" + }, + { + "name": "!=", + "url": "https://www.tradingview.com/pine-script-reference/v4/#op_!=" + }, + { + "name": "?:", + "url": "https://www.tradingview.com/pine-script-reference/v4/#op_?:" + }, + { + "name": "[]", + "url": "https://www.tradingview.com/pine-script-reference/v4/#op_[]" + }, + { + "name": "*", + "url": "https://www.tradingview.com/pine-script-reference/v4/#op_*" + }, + { + "name": "*=", + "url": "https://www.tradingview.com/pine-script-reference/v4/#op_*=" + }, + { + "name": "/", + "url": "https://www.tradingview.com/pine-script-reference/v4/#op_/" + }, + { + "name": "/=", + "url": "https://www.tradingview.com/pine-script-reference/v4/#op_/=" + }, + { + "name": "%", + "url": "https://www.tradingview.com/pine-script-reference/v4/#op_%" + }, + { + "name": "%=", + "url": "https://www.tradingview.com/pine-script-reference/v4/#op_%=" + }, + { + "name": "+", + "url": "https://www.tradingview.com/pine-script-reference/v4/#op_+" + }, + { + "name": "+=", + "url": "https://www.tradingview.com/pine-script-reference/v4/#op_+=" + }, + { + "name": "<", + "url": "https://www.tradingview.com/pine-script-reference/v4/#op_<" + }, + { + "name": "<=", + "url": "https://www.tradingview.com/pine-script-reference/v4/#op_<=" + }, + { + "name": "==", + "url": "https://www.tradingview.com/pine-script-reference/v4/#op_==" + }, + { + "name": ">", + "url": "https://www.tradingview.com/pine-script-reference/v4/#op_>" + }, + { + "name": ">=", + "url": "https://www.tradingview.com/pine-script-reference/v4/#op_>=" + } +] \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/definitions/v4/types.json b/pine-script-intellij-plugin/bin/main/definitions/v4/types.json new file mode 100644 index 0000000..2db89d6 --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/definitions/v4/types.json @@ -0,0 +1,38 @@ +[ + { + "name": "bool", + "url": "https://www.tradingview.com/pine-script-reference/v4/#type_bool" + }, + { + "name": "box", + "url": "https://www.tradingview.com/pine-script-reference/v4/#type_box" + }, + { + "name": "color", + "url": "https://www.tradingview.com/pine-script-reference/v4/#type_color" + }, + { + "name": "float", + "url": "https://www.tradingview.com/pine-script-reference/v4/#type_float" + }, + { + "name": "int", + "url": "https://www.tradingview.com/pine-script-reference/v4/#type_int" + }, + { + "name": "label", + "url": "https://www.tradingview.com/pine-script-reference/v4/#type_label" + }, + { + "name": "line", + "url": "https://www.tradingview.com/pine-script-reference/v4/#type_line" + }, + { + "name": "string", + "url": "https://www.tradingview.com/pine-script-reference/v4/#type_string" + }, + { + "name": "table", + "url": "https://www.tradingview.com/pine-script-reference/v4/#type_table" + } +] \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/definitions/v4/variables.json b/pine-script-intellij-plugin/bin/main/definitions/v4/variables.json new file mode 100644 index 0000000..7dac9bc --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/definitions/v4/variables.json @@ -0,0 +1,787 @@ +[ + { + "name": "accdist", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_accdist", + "fragment": "var_accdist", + "info": "

accdist

Accumulation/distribution index.
Type
series[float]
", + "description": "Accumulation/distribution index.", + "type": "series[float]", + "remarks": "" + }, + { + "name": "bar_index", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_bar_index", + "fragment": "var_bar_index", + "info": "

bar_index

Current bar index. Numbering is zero-based, index of the first bar is 0.
Type
series[integer]
Example
plot(bar_index)
plot(bar_index\u00a0>\u00a05000\u00a0?\u00a0close\u00a0:\u00a00)
Remarks
Note that bar_index has replaced n variable in version 4.
Note that bar indexing starts from 0 on the first historical bar.
Please note that using this variable/function can cause indicator repainting.
", + "description": "Current bar index. Numbering is zero-based, index of the first bar is 0.", + "type": "series[integer]", + "remarks": [ + "Note that bar_index has replaced n variable in version 4.", + "Note that bar indexing starts from 0 on the first historical bar.", + "Please note that using this variable/function can cause indicator repainting." + ] + }, + { + "name": "barstate.isconfirmed", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_barstate.isconfirmed", + "fragment": "var_barstate.isconfirmed", + "info": "

barstate.isconfirmed

Returns true if the script is calculating the last (closing) update of the current bar. The next script calculation will be on the new bar data.
Type
series[bool]
Remarks
PineScript code that uses this variable could calculate differently on history and real-time data.
It is NOT recommended to use barstate.isconfirmed in security expression. Its value requested from security is unpredictable.
Please note that using this variable/function can cause indicator repainting.
See also
", + "description": "Returns true if the script is calculating the last (closing) update of the current bar. The next script calculation will be on the new bar data.", + "type": "series[bool]", + "remarks": [ + "PineScript code that uses this variable could calculate differently on history and real-time data.", + "It is NOT recommended to use barstate.isconfirmed in security expression. Its value requested from security is unpredictable.", + "Please note that using this variable/function can cause indicator repainting." + ] + }, + { + "name": "barstate.isfirst", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_barstate.isfirst", + "fragment": "var_barstate.isfirst", + "info": "

barstate.isfirst

Returns true if current bar is first bar in barset, false otherwise.
Type
series[bool]
Remarks
PineScript code that uses this variable could calculate differently on history and real-time data.
Please note that using this variable/function can cause indicator repainting.
See also
", + "description": "Returns true if current bar is first bar in barset, false otherwise.", + "type": "series[bool]", + "remarks": [ + "PineScript code that uses this variable could calculate differently on history and real-time data.", + "Please note that using this variable/function can cause indicator repainting." + ] + }, + { + "name": "barstate.ishistory", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_barstate.ishistory", + "fragment": "var_barstate.ishistory", + "info": "

barstate.ishistory

Returns true if current bar is a historical bar, false otherwise.
Type
series[bool]
Remarks
PineScript code that uses this variable could calculate differently on history and real-time data.
Please note that using this variable/function can cause indicator repainting.
See also
", + "description": "Returns true if current bar is a historical bar, false otherwise.", + "type": "series[bool]", + "remarks": [ + "PineScript code that uses this variable could calculate differently on history and real-time data.", + "Please note that using this variable/function can cause indicator repainting." + ] + }, + { + "name": "barstate.islast", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_barstate.islast", + "fragment": "var_barstate.islast", + "info": "

barstate.islast

Returns true if current bar is the last bar in barset, false otherwise. This condition is true for all real-time bars in barset.
Type
series[bool]
Remarks
PineScript code that uses this variable could calculate differently on history and real-time data.
Please note that using this variable/function can cause indicator repainting.
See also
", + "description": "Returns true if current bar is the last bar in barset, false otherwise. This condition is true for all real-time bars in barset.", + "type": "series[bool]", + "remarks": [ + "PineScript code that uses this variable could calculate differently on history and real-time data.", + "Please note that using this variable/function can cause indicator repainting." + ] + }, + { + "name": "barstate.islastconfirmedhistory", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_barstate.islastconfirmedhistory", + "fragment": "var_barstate.islastconfirmedhistory", + "info": "

barstate.islastconfirmedhistory

Returns true if script is executing on the dataset's last bar when market is closed, or script is executing on the bar immediately preceding the real-time bar, if market is open. Returns false otherwise.
Type
series[bool]
Remarks
PineScript code that uses this variable could calculate differently on history and real-time data.
Please note that using this variable/function can cause indicator repainting.
See also
", + "description": "Returns true if script is executing on the dataset's last bar when market is closed, or script is executing on the bar immediately preceding the real-time bar, if market is open. Returns false otherwise.", + "type": "series[bool]", + "remarks": [ + "PineScript code that uses this variable could calculate differently on history and real-time data.", + "Please note that using this variable/function can cause indicator repainting." + ] + }, + { + "name": "barstate.isnew", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_barstate.isnew", + "fragment": "var_barstate.isnew", + "info": "

barstate.isnew

Returns true if script is currently calculating on new bar, false otherwise. This variable is true when calculating on historical bars or on first update of a newly generated real-time bar.
Type
series[bool]
Remarks
PineScript code that uses this variable could calculate differently on history and real-time data.
Please note that using this variable/function can cause indicator repainting.
See also
", + "description": "Returns true if script is currently calculating on new bar, false otherwise. This variable is true when calculating on historical bars or on first update of a newly generated real-time bar.", + "type": "series[bool]", + "remarks": [ + "PineScript code that uses this variable could calculate differently on history and real-time data.", + "Please note that using this variable/function can cause indicator repainting." + ] + }, + { + "name": "barstate.isrealtime", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_barstate.isrealtime", + "fragment": "var_barstate.isrealtime", + "info": "

barstate.isrealtime

Returns true if current bar is a real-time bar, false otherwise.
Type
series[bool]
Remarks
PineScript code that uses this variable could calculate differently on history and real-time data.
Please note that using this variable/function can cause indicator repainting.
See also
", + "description": "Returns true if current bar is a real-time bar, false otherwise.", + "type": "series[bool]", + "remarks": [ + "PineScript code that uses this variable could calculate differently on history and real-time data.", + "Please note that using this variable/function can cause indicator repainting." + ] + }, + { + "name": "close", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_close", + "fragment": "var_close", + "info": "

close

Close price of the current bar when it has closed, or last traded price of a yet incomplete, realtime bar.
Type
series[float]
Remarks
Previous values may be accessed with square brackets operator [], e.g. close[1], close[2].
See also
", + "description": "Close price of the current bar when it has closed, or last traded price of a yet incomplete, realtime bar.", + "type": "series[float]", + "remarks": [ + "Previous values may be accessed with square brackets operator [], e.g. close[1], close[2]." + ] + }, + { + "name": "dayofmonth", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_dayofmonth", + "fragment": "var_dayofmonth", + "info": "

dayofmonth

Date of current bar time in exchange timezone.
Type
series[integer]
Remarks
Note that this variable returns the day based on the time of the bar's open. For overnight sessions (e.g. EURUSD, where Monday session starts on Sunday, 17:00) this value can be lower by 1 than the day of the trading day.
See also
", + "description": "Date of current bar time in exchange timezone.", + "type": "series[integer]", + "remarks": [ + "Note that this variable returns the day based on the time of the bar's open. For overnight sessions (e.g. EURUSD, where Monday session starts on Sunday, 17:00) this value can be lower by 1 than the day of the trading day." + ] + }, + { + "name": "dayofweek", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_dayofweek", + "fragment": "var_dayofweek", + "info": "

dayofweek

Day of week for current bar time in exchange timezone.
Type
series[integer]
Remarks
Note that this variable returns the day based on the time of the bar's open. For overnight sessions (e.g. EURUSD, where Monday session starts on Sunday, 17:00) this value can be lower by 1 than the day of the trading day.
See also
", + "description": "Day of week for current bar time in exchange timezone.", + "type": "series[integer]", + "remarks": [ + "Note that this variable returns the day based on the time of the bar's open. For overnight sessions (e.g. EURUSD, where Monday session starts on Sunday, 17:00) this value can be lower by 1 than the day of the trading day.", + "You can use dayofweek.sunday, dayofweek.monday, dayofweek.tuesday, dayofweek.wednesday, dayofweek.thursday, dayofweek.friday and dayofweek.saturday variables for comparisons." + ] + }, + { + "name": "high", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_high", + "fragment": "var_high", + "info": "

high

Current high price.
Type
series[float]
Remarks
Previous values may be accessed with square brackets operator [], e.g. high[1], high[2].
See also
", + "description": "Current high price.", + "type": "series[float]", + "remarks": [ + "Previous values may be accessed with square brackets operator [], e.g. high[1], high[2]." + ] + }, + { + "name": "hl2", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_hl2", + "fragment": "var_hl2", + "info": "

hl2

Is a shortcut for (high + low)/2
Type
series[float]
See also
", + "description": "Is a shortcut for (high + low)/2", + "type": "series[float]", + "remarks": "" + }, + { + "name": "hlc3", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_hlc3", + "fragment": "var_hlc3", + "info": "

hlc3

Is a shortcut for (high + low + close)/3
Type
series[float]
See also
", + "description": "Is a shortcut for (high + low + close)/3", + "type": "series[float]", + "remarks": "" + }, + { + "name": "hour", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_hour", + "fragment": "var_hour", + "info": "

hour

Current bar hour in exchange timezone.
Type
series[integer]
See also
", + "description": "Current bar hour in exchange timezone.", + "type": "series[integer]", + "remarks": "" + }, + { + "name": "iii", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_iii", + "fragment": "var_iii", + "info": "

iii

Intraday Intensity Index.
Type
series[float]
Example
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())
", + "description": "Intraday Intensity Index.", + "type": "series[float]", + "remarks": "" + }, + { + "name": "low", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_low", + "fragment": "var_low", + "info": "

low

Current low price.
Type
series[float]
Remarks
Previous values may be accessed with square brackets operator [], e.g. low[1], low[2].
See also
", + "description": "Current low price.", + "type": "series[float]", + "remarks": [ + "Previous values may be accessed with square brackets operator [], e.g. low[1], low[2]." + ] + }, + { + "name": "minute", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_minute", + "fragment": "var_minute", + "info": "

minute

Current bar minute in exchange timezone.
Type
series[integer]
See also
", + "description": "Current bar minute in exchange timezone.", + "type": "series[integer]", + "remarks": "" + }, + { + "name": "month", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_month", + "fragment": "var_month", + "info": "

month

Current bar month in exchange timezone.
Type
series[integer]
Remarks
Note that this variable returns the month based on the time of the bar's open. For overnight sessions (e.g. EURUSD, where Monday session starts on Sunday, 17:00) this value can be lower by 1 than the month of the trading day.
See also
", + "description": "Current bar month in exchange timezone.", + "type": "series[integer]", + "remarks": [ + "Note that this variable returns the month based on the time of the bar's open. For overnight sessions (e.g. EURUSD, where Monday session starts on Sunday, 17:00) this value can be lower by 1 than the month of the trading day." + ] + }, + { + "name": "na", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_na", + "fragment": "var_na", + "info": "

na

Double.NaN value (Not a Number).
Type
na
Example
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//\u00a0CORRECT
Remarks
Use it for return values ONLY. DON'T TRY TO COMPARE WITH IT! If you need to check if some value is NaN, use built-in function na.
See also
", + "description": "Double.NaN value (Not a Number).", + "type": "na", + "remarks": [ + "Use it for return values ONLY. DON'T TRY TO COMPARE WITH IT! If you need to check if some value is NaN, use built-in function na." + ] + }, + { + "name": "nvi", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_nvi", + "fragment": "var_nvi", + "info": "

nvi

Negative Volume Index.
Type
series[float]
Example
//@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())
", + "description": "Negative Volume Index.", + "type": "series[float]", + "remarks": "" + }, + { + "name": "obv", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_obv", + "fragment": "var_obv", + "info": "

obv

On Balance Volume.
Type
series[float]
Example
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())
", + "description": "On Balance Volume.", + "type": "series[float]", + "remarks": "" + }, + { + "name": "ohlc4", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_ohlc4", + "fragment": "var_ohlc4", + "info": "

ohlc4

Is a shortcut for (open + high + low + close)/4
Type
series[float]
See also
", + "description": "Is a shortcut for (open + high + low + close)/4", + "type": "series[float]", + "remarks": "" + }, + { + "name": "open", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_open", + "fragment": "var_open", + "info": "

open

Current open price.
Type
series[float]
Remarks
Previous values may be accessed with square brackets operator [], e.g. open[1], open[2].
See also
", + "description": "Current open price.", + "type": "series[float]", + "remarks": [ + "Previous values may be accessed with square brackets operator [], e.g. open[1], open[2]." + ] + }, + { + "name": "pvi", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_pvi", + "fragment": "var_pvi", + "info": "

pvi

Positive Volume Index.
Type
series[float]
Example
//@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())
", + "description": "Positive Volume Index.", + "type": "series[float]", + "remarks": "" + }, + { + "name": "pvt", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_pvt", + "fragment": "var_pvt", + "info": "

pvt

Price-Volume Trend.
Type
series[float]
Example
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())
", + "description": "Price-Volume Trend.", + "type": "series[float]", + "remarks": "" + }, + { + "name": "second", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_second", + "fragment": "var_second", + "info": "

second

Current bar second in exchange timezone.
Type
series[integer]
See also
", + "description": "Current bar second in exchange timezone.", + "type": "series[integer]", + "remarks": "" + }, + { + "name": "session.ismarket", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_session.ismarket", + "fragment": "var_session.ismarket", + "info": "

session.ismarket

Returns true if the current bar is a part of the regular trading hours (i.e. market hours), false otherwise
Type
series[bool]
See also
", + "description": "Returns true if the current bar is a part of the regular trading hours (i.e. market hours), false otherwise", + "type": "series[bool]", + "remarks": "" + }, + { + "name": "session.ispostmarket", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_session.ispostmarket", + "fragment": "var_session.ispostmarket", + "info": "

session.ispostmarket

Returns true if the current bar is a part of the post-market, false otherwise. On non-intraday charts always returns false.
Type
series[bool]
See also
", + "description": "Returns true if the current bar is a part of the post-market, false otherwise. On non-intraday charts always returns false.", + "type": "series[bool]", + "remarks": "" + }, + { + "name": "session.ispremarket", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_session.ispremarket", + "fragment": "var_session.ispremarket", + "info": "

session.ispremarket

Returns true if the current bar is a part of the pre-market, false otherwise. On non-intraday charts always returns false.
Type
series[bool]
See also
", + "description": "Returns true if the current bar is a part of the pre-market, false otherwise. On non-intraday charts always returns false.", + "type": "series[bool]", + "remarks": "" + }, + { + "name": "strategy.closedtrades", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_strategy.closedtrades", + "fragment": "var_strategy.closedtrades", + "info": "

strategy.closedtrades

Number of trades, which were closed for the whole trading interval.
Type
series[integer]
See also
", + "description": "Number of trades, which were closed for the whole trading interval.", + "type": "series[integer]", + "remarks": "" + }, + { + "name": "strategy.equity", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_strategy.equity", + "fragment": "var_strategy.equity", + "info": "", + "description": "Current equity (strategy.initial_capital + strategy.netprofit + strategy.openprofit).", + "type": "series[float]", + "remarks": "" + }, + { + "name": "strategy.eventrades", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_strategy.eventrades", + "fragment": "var_strategy.eventrades", + "info": "

strategy.eventrades

Number of breakeven trades for the whole trading interval.
Type
series[integer]
See also
", + "description": "Number of breakeven trades for the whole trading interval.", + "type": "series[integer]", + "remarks": "" + }, + { + "name": "strategy.grossloss", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_strategy.grossloss", + "fragment": "var_strategy.grossloss", + "info": "

strategy.grossloss

Total currency value of all completed losing trades.
Type
series[float]
See also
", + "description": "Total currency value of all completed losing trades.", + "type": "series[float]", + "remarks": "" + }, + { + "name": "strategy.grossprofit", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_strategy.grossprofit", + "fragment": "var_strategy.grossprofit", + "info": "

strategy.grossprofit

Total currency value of all completed winning trades.
Type
series[float]
See also
", + "description": "Total currency value of all completed winning trades.", + "type": "series[float]", + "remarks": "" + }, + { + "name": "strategy.initial_capital", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_strategy.initial_capital", + "fragment": "var_strategy.initial_capital", + "info": "

strategy.initial_capital

The amount of initial capital set in the strategy properties.
Type
series[float]
See also
", + "description": "The amount of initial capital set in the strategy properties.", + "type": "series[float]", + "remarks": "" + }, + { + "name": "strategy.losstrades", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_strategy.losstrades", + "fragment": "var_strategy.losstrades", + "info": "

strategy.losstrades

Number of unprofitable trades for the whole trading interval.
Type
series[integer]
See also
", + "description": "Number of unprofitable trades for the whole trading interval.", + "type": "series[integer]", + "remarks": "" + }, + { + "name": "strategy.max_contracts_held_all", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_strategy.max_contracts_held_all", + "fragment": "var_strategy.max_contracts_held_all", + "info": "

strategy.max_contracts_held_all

Maximum number of contracts/shares/lots/units in one trade for the whole trading interval.
Type
series[float]
See also
", + "description": "Maximum number of contracts/shares/lots/units in one trade for the whole trading interval.", + "type": "series[float]", + "remarks": "" + }, + { + "name": "strategy.max_contracts_held_long", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_strategy.max_contracts_held_long", + "fragment": "var_strategy.max_contracts_held_long", + "info": "

strategy.max_contracts_held_long

Maximum number of contracts/shares/lots/units in one long trade for the whole trading interval.
Type
series[float]
See also
", + "description": "Maximum number of contracts/shares/lots/units in one long trade for the whole trading interval.", + "type": "series[float]", + "remarks": "" + }, + { + "name": "strategy.max_contracts_held_short", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_strategy.max_contracts_held_short", + "fragment": "var_strategy.max_contracts_held_short", + "info": "

strategy.max_contracts_held_short

Maximum number of contracts/shares/lots/units in one short trade for the whole trading interval.
Type
series[float]
See also
", + "description": "Maximum number of contracts/shares/lots/units in one short trade for the whole trading interval.", + "type": "series[float]", + "remarks": "" + }, + { + "name": "strategy.max_drawdown", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_strategy.max_drawdown", + "fragment": "var_strategy.max_drawdown", + "info": "

strategy.max_drawdown

Maximum equity drawdown value for the whole trading interval.
Type
series[float]
See also
", + "description": "Maximum equity drawdown value for the whole trading interval.", + "type": "series[float]", + "remarks": "" + }, + { + "name": "strategy.netprofit", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_strategy.netprofit", + "fragment": "var_strategy.netprofit", + "info": "

strategy.netprofit

Total currency value of all completed trades.
Type
series[float]
See also
", + "description": "Total currency value of all completed trades.", + "type": "series[float]", + "remarks": "" + }, + { + "name": "strategy.openprofit", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_strategy.openprofit", + "fragment": "var_strategy.openprofit", + "info": "

strategy.openprofit

Current unrealized profit or loss for the open position.
Type
series[float]
See also
", + "description": "Current unrealized profit or loss for the open position.", + "type": "series[float]", + "remarks": "" + }, + { + "name": "strategy.opentrades", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_strategy.opentrades", + "fragment": "var_strategy.opentrades", + "info": "

strategy.opentrades

Number of market position entries, which were not closed and remain opened. If there is no open market position, 0 is returned.
Type
series[integer]
See also
", + "description": "Number of market position entries, which were not closed and remain opened. If there is no open market position, 0 is returned.", + "type": "series[integer]", + "remarks": "" + }, + { + "name": "strategy.position_avg_price", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_strategy.position_avg_price", + "fragment": "var_strategy.position_avg_price", + "info": "

strategy.position_avg_price

Average entry price of current market position. If the market position is flat, 'NaN' is returned.
Type
series[float]
See also
", + "description": "Average entry price of current market position. If the market position is flat, 'NaN' is returned.", + "type": "series[float]", + "remarks": "" + }, + { + "name": "strategy.position_entry_name", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_strategy.position_entry_name", + "fragment": "var_strategy.position_entry_name", + "info": "

strategy.position_entry_name

Name of the order that initially opened current market position.
Type
series[string]
See also
", + "description": "Name of the order that initially opened current market position.", + "type": "series[string]", + "remarks": "" + }, + { + "name": "strategy.position_size", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_strategy.position_size", + "fragment": "var_strategy.position_size", + "info": "

strategy.position_size

Direction and size of the current market position. If the value is > 0, the market position is long. If the value is < 0, the market position is short. The absolute value is the number of contracts/shares/lots/units in trade (position size).
Type
series[float]
See also
", + "description": "Direction and size of the current market position. If the value is > 0, the market position is long. If the value is < 0, the market position is short. The absolute value is the number of contracts/shares/lots/units in trade (position size).", + "type": "series[float]", + "remarks": "" + }, + { + "name": "strategy.wintrades", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_strategy.wintrades", + "fragment": "var_strategy.wintrades", + "info": "

strategy.wintrades

Number of profitable trades for the whole trading interval.
Type
series[integer]
See also
", + "description": "Number of profitable trades for the whole trading interval.", + "type": "series[integer]", + "remarks": "" + }, + { + "name": "syminfo.basecurrency", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_syminfo.basecurrency", + "fragment": "var_syminfo.basecurrency", + "info": "

syminfo.basecurrency

Base currency for the symbol. For the symbol 'BTCUSD' returns 'BTC'.
Type
string
See also
", + "description": "Base currency for the symbol. For the symbol 'BTCUSD' returns 'BTC'.", + "type": "string", + "remarks": "" + }, + { + "name": "syminfo.currency", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_syminfo.currency", + "fragment": "var_syminfo.currency", + "info": "

syminfo.currency

Currency for the current symbol. Returns currency code: 'USD', 'EUR', etc.
Type
string
See also
", + "description": "Currency for the current symbol. Returns currency code: 'USD', 'EUR', etc.", + "type": "string", + "remarks": "" + }, + { + "name": "syminfo.description", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_syminfo.description", + "fragment": "var_syminfo.description", + "info": "

syminfo.description

Description for the current symbol.
Type
string
See also
", + "description": "Description for the current symbol.", + "type": "string", + "remarks": "" + }, + { + "name": "syminfo.mintick", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_syminfo.mintick", + "fragment": "var_syminfo.mintick", + "info": "

syminfo.mintick

Min tick value for the current symbol.
Type
float
See also
", + "description": "Min tick value for the current symbol.", + "type": "float", + "remarks": "" + }, + { + "name": "syminfo.pointvalue", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_syminfo.pointvalue", + "fragment": "var_syminfo.pointvalue", + "info": "

syminfo.pointvalue

Point value for the current symbol.
Type
float
See also
", + "description": "Point value for the current symbol.", + "type": "float", + "remarks": "" + }, + { + "name": "syminfo.prefix", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_syminfo.prefix", + "fragment": "var_syminfo.prefix", + "info": "

syminfo.prefix

Prefix of current symbol name (i.e. for 'CME_EOD:TICKER' prefix is 'CME_EOD').
Type
string
Example
If\u00a0current\u00a0chart\u00a0symbol\u00a0is\u00a0'BATS:MSFT'\u00a0then\u00a0syminfo.prefix\u00a0is\u00a0'BATS'.
See also
", + "description": "Prefix of current symbol name (i.e. for 'CME_EOD:TICKER' prefix is 'CME_EOD').", + "type": "string", + "remarks": "" + }, + { + "name": "syminfo.root", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_syminfo.root", + "fragment": "var_syminfo.root", + "info": "

syminfo.root

Root for derivatives like futures contract. For other symbols returns the same value as syminfo.ticker.
Type
string
Example
For\u00a0example\u00a0if\u00a0current\u00a0chart\u00a0ticker\u00a0is\u00a0'CLM2014',\u00a0would\u00a0return\u00a0'CL'.
See also
", + "description": "Root for derivatives like futures contract. For other symbols returns the same value as syminfo.ticker.", + "type": "string", + "remarks": "" + }, + { + "name": "syminfo.session", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_syminfo.session", + "fragment": "var_syminfo.session", + "info": "

syminfo.session

Session type of the chart main series. Possible values are session.regular, session.extended.
Type
string
See also
", + "description": "Session type of the chart main series. Possible values are session.regular, session.extended.", + "type": "string", + "remarks": "" + }, + { + "name": "syminfo.ticker", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_syminfo.ticker", + "fragment": "var_syminfo.ticker", + "info": "

syminfo.ticker

Symbol name without exchange prefix, e.g. 'MSFT'.
Type
string
See also
", + "description": "Symbol name without exchange prefix, e.g. 'MSFT'.", + "type": "string", + "remarks": "" + }, + { + "name": "syminfo.tickerid", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_syminfo.tickerid", + "fragment": "var_syminfo.tickerid", + "info": "

syminfo.tickerid

Symbol name with exchange prefix, e.g. 'BATS:MSFT', 'NASDAQ:MSFT'.
Type
string
See also
", + "description": "Symbol name with exchange prefix, e.g. 'BATS:MSFT', 'NASDAQ:MSFT'.", + "type": "string", + "remarks": "" + }, + { + "name": "syminfo.timezone", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_syminfo.timezone", + "fragment": "var_syminfo.timezone", + "info": "

syminfo.timezone

Timezone of the exchange of the chart main series. Possible values see in timestamp.
Type
string
See also
", + "description": "Timezone of the exchange of the chart main series. Possible values see in timestamp.", + "type": "string", + "remarks": "" + }, + { + "name": "syminfo.type", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_syminfo.type", + "fragment": "var_syminfo.type", + "info": "

syminfo.type

Type of the current symbol. Possible values are stock, futures, index, forex, crypto, fund, dr.
Type
string
See also
", + "description": "Type of the current symbol. Possible values are stock, futures, index, forex, crypto, fund, dr.", + "type": "string", + "remarks": "" + }, + { + "name": "time", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_time", + "fragment": "var_time", + "info": "

time

Current bar time in UNIX format. It is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.
Type
series[integer]
Remarks
Note that this variable returns the timestamp based on the time of the bar's open. Because of that, for overnight sessions (e.g. EURUSD, where Monday session starts on Sunday, 17:00) this variable can return time before the specified date of the trading day. For example, on EURUSD, 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.
See also
", + "description": "Current bar time in UNIX format. It is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.", + "type": "series[integer]", + "remarks": [ + "Note that this variable returns the timestamp based on the time of the bar's open. Because of that, for overnight sessions (e.g. EURUSD, where Monday session starts on Sunday, 17:00) this variable can return time before the specified date of the trading day. For example, on EURUSD, 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_close

Current bar close time in UNIX format. It is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970. On price-based charts this variable value is na.
Type
series[integer]
See also
", + "description": "Current bar close time in UNIX format. It is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970. On price-based charts this variable value is na.", + "type": "series[integer]", + "remarks": "" + }, + { + "name": "time_tradingday", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_time_tradingday", + "fragment": "var_time_tradingday", + "info": "

time_tradingday

The beginning time of the trading day the current bar belongs to, in UNIX format (the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970).
Type
series[integer]
Remarks
The variable is useful for overnight sessions, where the current day's session can start on the previous calendar day (e.g., on EURUSD the Monday session will start on Sunday, 17:00). Unlike 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).
See also
", + "description": "The beginning time of the trading day the current bar belongs to, in UNIX format (the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970).", + "type": "series[integer]", + "remarks": [ + "The variable is useful for overnight sessions, where the current day's session can start on the previous calendar day (e.g., on EURUSD the Monday session will start on Sunday, 17:00). Unlike 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

Returns true if current resolution is a daily resolution, false otherwise.
Type
bool
See also
", + "description": "Returns true if current resolution is a daily resolution, false otherwise.", + "type": "bool", + "remarks": "" + }, + { + "name": "timeframe.isdwm", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_timeframe.isdwm", + "fragment": "var_timeframe.isdwm", + "info": "

timeframe.isdwm

Returns true if current resolution is a daily or weekly or monthly resolution, false otherwise.
Type
bool
See also
", + "description": "Returns true if current resolution is a daily or weekly or monthly resolution, false otherwise.", + "type": "bool", + "remarks": "" + }, + { + "name": "timeframe.isintraday", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_timeframe.isintraday", + "fragment": "var_timeframe.isintraday", + "info": "

timeframe.isintraday

Returns true if current resolution is an intraday (minutes or seconds) resolution, false otherwise.
Type
bool
See also
", + "description": "Returns true if current resolution is an intraday (minutes or seconds) resolution, false otherwise.", + "type": "bool", + "remarks": "" + }, + { + "name": "timeframe.isminutes", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_timeframe.isminutes", + "fragment": "var_timeframe.isminutes", + "info": "

timeframe.isminutes

Returns true if current resolution is a minutes resolution, false otherwise.
Type
bool
See also
", + "description": "Returns true if current resolution is a minutes resolution, false otherwise.", + "type": "bool", + "remarks": "" + }, + { + "name": "timeframe.ismonthly", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_timeframe.ismonthly", + "fragment": "var_timeframe.ismonthly", + "info": "

timeframe.ismonthly

Returns true if current resolution is a monthly resolution, false otherwise.
Type
bool
See also
", + "description": "Returns true if current resolution is a monthly resolution, false otherwise.", + "type": "bool", + "remarks": "" + }, + { + "name": "timeframe.isseconds", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_timeframe.isseconds", + "fragment": "var_timeframe.isseconds", + "info": "

timeframe.isseconds

Returns true if current resolution is a seconds resolution, false otherwise.
Type
bool
See also
", + "description": "Returns true if current resolution is a seconds resolution, false otherwise.", + "type": "bool", + "remarks": "" + }, + { + "name": "timeframe.isweekly", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_timeframe.isweekly", + "fragment": "var_timeframe.isweekly", + "info": "

timeframe.isweekly

Returns true if current resolution is a weekly resolution, false otherwise.
Type
bool
See also
", + "description": "Returns true if current resolution is a weekly resolution, false otherwise.", + "type": "bool", + "remarks": "" + }, + { + "name": "timeframe.multiplier", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_timeframe.multiplier", + "fragment": "var_timeframe.multiplier", + "info": "

timeframe.multiplier

Multiplier of resolution, e.g. '60' - 60, 'D' - 1, '5D' - 5, '12M' - 12.
Type
integer
See also
", + "description": "Multiplier of resolution, e.g. '60' - 60, 'D' - 1, '5D' - 5, '12M' - 12.", + "type": "integer", + "remarks": "" + }, + { + "name": "timeframe.period", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_timeframe.period", + "fragment": "var_timeframe.period", + "info": "

timeframe.period

Resolution, e.g. '60' - 60 minutes, 'D' - daily, 'W' - weekly, 'M' - monthly, '5D' - 5 days, '12M' - one year, '3M' - one quarter.
Type
string
See also
", + "description": "Resolution, e.g. '60' - 60 minutes, 'D' - daily, 'W' - weekly, 'M' - monthly, '5D' - 5 days, '12M' - one year, '3M' - one quarter.", + "type": "string", + "remarks": "" + }, + { + "name": "timenow", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_timenow", + "fragment": "var_timenow", + "info": "

timenow

Current time in UNIX format. It is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.
Type
series[integer]
Remarks
Please note that using this variable/function can cause indicator repainting.
See also
", + "description": "Current time in UNIX format. It is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.", + "type": "series[integer]", + "remarks": [ + "Please note that using this variable/function can cause indicator repainting." + ] + }, + { + "name": "tr", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_tr", + "fragment": "var_tr", + "info": "

tr

True range. Same as tr(false). It is max(high - low, abs(high - close[1]), abs(low - close[1]))
Type
series[float]
See also
", + "description": "True range. Same as tr(false). It is max(high - low, abs(high - close[1]), abs(low - close[1]))", + "type": "series[float]", + "remarks": "" + }, + { + "name": "volume", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_volume", + "fragment": "var_volume", + "info": "

volume

Current bar volume.
Type
series[float]
Remarks
Previous values may be accessed with square brackets operator [], e.g. volume[1], volume[2].
See also
", + "description": "Current bar volume.", + "type": "series[float]", + "remarks": [ + "Previous values may be accessed with square brackets operator [], e.g. volume[1], volume[2]." + ] + }, + { + "name": "vwap", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_vwap", + "fragment": "var_vwap", + "info": "

vwap

Volume-weighted average price. It uses hlc3 as a source series.
Type
series[float]
See also
", + "description": "Volume-weighted average price. It uses hlc3 as a source series.", + "type": "series[float]", + "remarks": "" + }, + { + "name": "wad", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_wad", + "fragment": "var_wad", + "info": "

wad

Williams Accumulation/Distribution.
Type
series[float]
Example
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())
", + "description": "Williams Accumulation/Distribution.", + "type": "series[float]", + "remarks": "" + }, + { + "name": "weekofyear", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_weekofyear", + "fragment": "var_weekofyear", + "info": "

weekofyear

Week number of current bar time in exchange timezone.
Type
series[integer]
Remarks
Note that this variable returns the week based on the time of the bar's open. For overnight sessions (e.g. EURUSD, where Monday session starts on Sunday, 17:00) this value can be lower by 1 than the week of the trading day.
See also
", + "description": "Week number of current bar time in exchange timezone.", + "type": "series[integer]", + "remarks": [ + "Note that this variable returns the week based on the time of the bar's open. For overnight sessions (e.g. EURUSD, where Monday session starts on Sunday, 17:00) this value can be lower by 1 than the week of the trading day." + ] + }, + { + "name": "wvad", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_wvad", + "fragment": "var_wvad", + "info": "

wvad

Williams Variable Accumulation/Distribution.
Type
series[float]
Example
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())
", + "description": "Williams Variable Accumulation/Distribution.", + "type": "series[float]", + "remarks": "" + }, + { + "name": "year", + "url": "https://www.tradingview.com/pine-script-reference/v4/#var_year", + "fragment": "var_year", + "info": "

year

Current bar year in exchange timezone.
Type
series[integer]
Remarks
Note that this variable returns the year based on the time of the bar's open. For overnight sessions (e.g. EURUSD, where Monday session starts on Sunday, 17:00) this value can be lower by 1 than the year of the trading day.
See also
", + "description": "Current bar year in exchange timezone.", + "type": "series[integer]", + "remarks": [ + "Note that this variable returns the year based on the time of the bar's open. For overnight sessions (e.g. EURUSD, where Monday session starts on Sunday, 17:00) this value can be lower by 1 than the year of the trading day." + ] + } +] \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/definitions/v5/annotations.json b/pine-script-intellij-plugin/bin/main/definitions/v5/annotations.json new file mode 100644 index 0000000..f6c3598 --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/definitions/v5/annotations.json @@ -0,0 +1,42 @@ +[ + { + "name": "@description", + "url": "https://www.tradingview.com/pine-script-reference/v5/#an_@description" + }, + { + "name": "@enum", + "url": "https://www.tradingview.com/pine-script-reference/v5/#an_@enum" + }, + { + "name": "@field", + "url": "https://www.tradingview.com/pine-script-reference/v5/#an_@field" + }, + { + "name": "@function", + "url": "https://www.tradingview.com/pine-script-reference/v5/#an_@function" + }, + { + "name": "@param", + "url": "https://www.tradingview.com/pine-script-reference/v5/#an_@param" + }, + { + "name": "@returns", + "url": "https://www.tradingview.com/pine-script-reference/v5/#an_@returns" + }, + { + "name": "@strategy_alert_message", + "url": "https://www.tradingview.com/pine-script-reference/v5/#an_@strategy_alert_message" + }, + { + "name": "@type", + "url": "https://www.tradingview.com/pine-script-reference/v5/#an_@type" + }, + { + "name": "@variable", + "url": "https://www.tradingview.com/pine-script-reference/v5/#an_@variable" + }, + { + "name": "@version=", + "url": "https://www.tradingview.com/pine-script-reference/v5/#an_@version=" + } +] \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/definitions/v5/constants.json b/pine-script-intellij-plugin/bin/main/definitions/v5/constants.json new file mode 100644 index 0000000..7c30067 --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/definitions/v5/constants.json @@ -0,0 +1,1797 @@ +[ + { + "name": "adjustment.dividends", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_adjustment.dividends", + "fragment": "const_adjustment.dividends", + "info": "

adjustment.dividends

Constant for dividends adjustment type (dividends adjustment is applied).
Type
const string
See also
", + "description": "Constant for dividends adjustment type (dividends adjustment is applied).", + "type": "const string", + "remarks": "" + }, + { + "name": "adjustment.none", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_adjustment.none", + "fragment": "const_adjustment.none", + "info": "

adjustment.none

Constant for none adjustment type (no adjustment is applied).
Type
const string
See also
", + "description": "Constant for none adjustment type (no adjustment is applied).", + "type": "const string", + "remarks": "" + }, + { + "name": "adjustment.splits", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_adjustment.splits", + "fragment": "const_adjustment.splits", + "info": "

adjustment.splits

Constant for splits adjustment type (splits adjustment is applied).
Type
const string
See also
", + "description": "Constant for splits adjustment type (splits adjustment is applied).", + "type": "const string", + "remarks": "" + }, + { + "name": "alert.freq_all", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_alert.freq_all", + "fragment": "const_alert.freq_all", + "info": "

alert.freq_all

A named constant for use with the freq parameter of the alert() function.
All function calls trigger the alert.
Type
const string
See also
", + "description": "A named constant for use with the 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

A named constant for use with the freq parameter of the alert() function.
The first function call during the bar triggers the alert.
Type
const string
See also
", + "description": "A named constant for use with the 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

A named constant for use with the freq parameter of the alert() function.
The function call triggers the alert only when it occurs during the last script iteration of the real-time bar, when it closes.
Type
const string
See also
", + "description": "A named constant for use with the 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

A constant to specify the value of the backadjustment parameter in ticker.new and ticker.modify functions.
Type
const backadjustment
See also
", + "description": "A constant to specify the value of the 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

A constant to specify the value of the backadjustment parameter in ticker.new and ticker.modify functions.
Type
const backadjustment
See also
", + "description": "A constant to specify the value of the 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

A constant to specify the value of the backadjustment parameter in ticker.new and ticker.modify functions.
Type
const backadjustment
See also
", + "description": "A constant to specify the value of the 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

Merge strategy for requested data. Data is merged continuously without gaps, all the gaps are filled with the previous nearest existing value.
Type
const barmerge_gaps
See also
", + "description": "Merge strategy for requested data. Data is merged continuously without gaps, all the gaps are filled with the previous nearest existing value.", + "type": "const barmerge_gaps", + "remarks": "" + }, + { + "name": "barmerge.gaps_on", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_barmerge.gaps_on", + "fragment": "const_barmerge.gaps_on", + "info": "

barmerge.gaps_on

Merge strategy for requested data. Data is merged with possible gaps (na values).
Type
const barmerge_gaps
See also
", + "description": "Merge strategy for requested data. Data is merged with possible gaps (na values).", + "type": "const barmerge_gaps", + "remarks": "" + }, + { + "name": "barmerge.lookahead_off", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_barmerge.lookahead_off", + "fragment": "const_barmerge.lookahead_off", + "info": "

barmerge.lookahead_off

Merge strategy for the requested data position. Requested barset is merged with current barset in the order of sorting bars by their close time. This merge strategy disables effect of getting data from \"future\" on calculation on history.
Type
const barmerge_lookahead
See also
", + "description": "Merge strategy for the requested data position. Requested barset is merged with current barset in the order of sorting bars by their close time. This merge strategy disables effect of getting data from \"future\" on calculation on history.", + "type": "const barmerge_lookahead", + "remarks": "" + }, + { + "name": "barmerge.lookahead_on", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_barmerge.lookahead_on", + "fragment": "const_barmerge.lookahead_on", + "info": "

barmerge.lookahead_on

Merge strategy for the requested data position. Requested barset is merged with current barset in the order of sorting bars by their opening time. This merge strategy can lead to undesirable effect of getting data from \"future\" on calculation on history. This is unacceptable in backtesting strategies, but can be useful in indicators.
Type
const barmerge_lookahead
See also
", + "description": "Merge strategy for the requested data position. Requested barset is merged with current barset in the order of sorting bars by their opening time. This merge strategy can lead to undesirable effect of getting data from \"future\" on calculation on history. This is unacceptable in backtesting strategies, but can be useful in indicators.", + "type": "const barmerge_lookahead", + "remarks": "" + }, + { + "name": "color.aqua", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_color.aqua", + "fragment": "const_color.aqua", + "info": "", + "description": "Is a named constant for #00BCD4 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.black", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_color.black", + "fragment": "const_color.black", + "info": "", + "description": "Is a named constant for #363A45 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.blue", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_color.blue", + "fragment": "const_color.blue", + "info": "", + "description": "Is a named constant for #2962ff color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.fuchsia", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_color.fuchsia", + "fragment": "const_color.fuchsia", + "info": "", + "description": "Is a named constant for #E040FB color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.gray", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_color.gray", + "fragment": "const_color.gray", + "info": "", + "description": "Is a named constant for #787B86 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.green", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_color.green", + "fragment": "const_color.green", + "info": "", + "description": "Is a named constant for #4CAF50 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.lime", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_color.lime", + "fragment": "const_color.lime", + "info": "", + "description": "Is a named constant for #00E676 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.maroon", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_color.maroon", + "fragment": "const_color.maroon", + "info": "", + "description": "Is a named constant for #880E4F color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.navy", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_color.navy", + "fragment": "const_color.navy", + "info": "", + "description": "Is a named constant for #311B92 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.olive", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_color.olive", + "fragment": "const_color.olive", + "info": "", + "description": "Is a named constant for #808000 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.orange", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_color.orange", + "fragment": "const_color.orange", + "info": "", + "description": "Is a named constant for #FF9800 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.purple", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_color.purple", + "fragment": "const_color.purple", + "info": "", + "description": "Is a named constant for #9C27B0 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.red", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_color.red", + "fragment": "const_color.red", + "info": "", + "description": "Is a named constant for #FF5252 color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.silver", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_color.silver", + "fragment": "const_color.silver", + "info": "", + "description": "Is a named constant for #B2B5BE color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.teal", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_color.teal", + "fragment": "const_color.teal", + "info": "", + "description": "Is a named constant for #00897B color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.white", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_color.white", + "fragment": "const_color.white", + "info": "", + "description": "Is a named constant for #FFFFFF color.", + "type": "const color", + "remarks": "" + }, + { + "name": "color.yellow", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_color.yellow", + "fragment": "const_color.yellow", + "info": "", + "description": "Is a named constant for #FFEB3B color.", + "type": "const color", + "remarks": "" + }, + { + "name": "currency.AUD", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_currency.AUD", + "fragment": "const_currency.AUD", + "info": "

currency.AUD

Australian dollar.
Type
const string
See also
", + "description": "Australian dollar.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.BTC", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_currency.BTC", + "fragment": "const_currency.BTC", + "info": "

currency.BTC

Bitcoin.
Type
const string
See also
", + "description": "Bitcoin.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.CAD", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_currency.CAD", + "fragment": "const_currency.CAD", + "info": "

currency.CAD

Canadian dollar.
Type
const string
See also
", + "description": "Canadian dollar.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.CHF", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_currency.CHF", + "fragment": "const_currency.CHF", + "info": "

currency.CHF

Swiss franc.
Type
const string
See also
", + "description": "Swiss franc.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.ETH", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_currency.ETH", + "fragment": "const_currency.ETH", + "info": "

currency.ETH

Ethereum.
Type
const string
See also
", + "description": "Ethereum.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.EUR", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_currency.EUR", + "fragment": "const_currency.EUR", + "info": "

currency.EUR

Euro.
Type
const string
See also
", + "description": "Euro.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.GBP", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_currency.GBP", + "fragment": "const_currency.GBP", + "info": "

currency.GBP

Pound sterling.
Type
const string
See also
", + "description": "Pound sterling.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.HKD", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_currency.HKD", + "fragment": "const_currency.HKD", + "info": "

currency.HKD

Hong Kong dollar.
Type
const string
See also
", + "description": "Hong Kong dollar.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.INR", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_currency.INR", + "fragment": "const_currency.INR", + "info": "

currency.INR

Indian rupee.
Type
const string
See also
", + "description": "Indian rupee.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.JPY", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_currency.JPY", + "fragment": "const_currency.JPY", + "info": "

currency.JPY

Japanese yen.
Type
const string
See also
", + "description": "Japanese yen.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.KRW", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_currency.KRW", + "fragment": "const_currency.KRW", + "info": "

currency.KRW

South Korean won.
Type
const string
See also
", + "description": "South Korean won.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.MYR", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_currency.MYR", + "fragment": "const_currency.MYR", + "info": "

currency.MYR

Malaysian ringgit.
Type
const string
See also
", + "description": "Malaysian ringgit.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.NOK", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_currency.NOK", + "fragment": "const_currency.NOK", + "info": "

currency.NOK

Norwegian krone.
Type
const string
See also
", + "description": "Norwegian krone.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.NONE", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_currency.NONE", + "fragment": "const_currency.NONE", + "info": "

currency.NONE

Unspecified currency.
Type
const string
See also
", + "description": "Unspecified currency.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.NZD", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_currency.NZD", + "fragment": "const_currency.NZD", + "info": "

currency.NZD

New Zealand dollar.
Type
const string
See also
", + "description": "New Zealand dollar.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.RUB", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_currency.RUB", + "fragment": "const_currency.RUB", + "info": "

currency.RUB

Russian ruble.
Type
const string
See also
", + "description": "Russian ruble.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.SEK", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_currency.SEK", + "fragment": "const_currency.SEK", + "info": "

currency.SEK

Swedish krona.
Type
const string
See also
", + "description": "Swedish krona.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.SGD", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_currency.SGD", + "fragment": "const_currency.SGD", + "info": "

currency.SGD

Singapore dollar.
Type
const string
See also
", + "description": "Singapore dollar.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.TRY", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_currency.TRY", + "fragment": "const_currency.TRY", + "info": "

currency.TRY

Turkish lira.
Type
const string
See also
", + "description": "Turkish lira.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.USD", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_currency.USD", + "fragment": "const_currency.USD", + "info": "

currency.USD

United States dollar.
Type
const string
See also
", + "description": "United States dollar.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.USDT", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_currency.USDT", + "fragment": "const_currency.USDT", + "info": "

currency.USDT

Tether.
Type
const string
See also
", + "description": "Tether.", + "type": "const string", + "remarks": "" + }, + { + "name": "currency.ZAR", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_currency.ZAR", + "fragment": "const_currency.ZAR", + "info": "

currency.ZAR

South African rand.
Type
const string
See also
", + "description": "South African rand.", + "type": "const string", + "remarks": "" + }, + { + "name": "dayofweek.friday", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_dayofweek.friday", + "fragment": "const_dayofweek.friday", + "info": "

dayofweek.friday

Is a named constant for return value of dayofweek function and value of dayofweek variable.
Type
const int
See also
", + "description": "Is a named constant for return value of dayofweek function and value of dayofweek variable.", + "type": "const int", + "remarks": "" + }, + { + "name": "dayofweek.monday", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_dayofweek.monday", + "fragment": "const_dayofweek.monday", + "info": "

dayofweek.monday

Is a named constant for return value of dayofweek function and value of dayofweek variable.
Type
const int
See also
", + "description": "Is a named constant for return value of dayofweek function and value of dayofweek variable.", + "type": "const int", + "remarks": "" + }, + { + "name": "dayofweek.saturday", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_dayofweek.saturday", + "fragment": "const_dayofweek.saturday", + "info": "

dayofweek.saturday

Is a named constant for return value of dayofweek function and value of dayofweek variable.
Type
const int
See also
", + "description": "Is a named constant for return value of dayofweek function and value of dayofweek variable.", + "type": "const int", + "remarks": "" + }, + { + "name": "dayofweek.sunday", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_dayofweek.sunday", + "fragment": "const_dayofweek.sunday", + "info": "

dayofweek.sunday

Is a named constant for return value of dayofweek function and value of dayofweek variable.
Type
const int
See also
", + "description": "Is a named constant for return value of dayofweek function and value of dayofweek variable.", + "type": "const int", + "remarks": "" + }, + { + "name": "dayofweek.thursday", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_dayofweek.thursday", + "fragment": "const_dayofweek.thursday", + "info": "

dayofweek.thursday

Is a named constant for return value of dayofweek function and value of dayofweek variable.
Type
const int
See also
", + "description": "Is a named constant for return value of dayofweek function and value of dayofweek variable.", + "type": "const int", + "remarks": "" + }, + { + "name": "dayofweek.tuesday", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_dayofweek.tuesday", + "fragment": "const_dayofweek.tuesday", + "info": "

dayofweek.tuesday

Is a named constant for return value of dayofweek function and value of dayofweek variable.
Type
const int
See also
", + "description": "Is a named constant for return value of dayofweek function and value of dayofweek variable.", + "type": "const int", + "remarks": "" + }, + { + "name": "dayofweek.wednesday", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_dayofweek.wednesday", + "fragment": "const_dayofweek.wednesday", + "info": "

dayofweek.wednesday

Is a named constant for return value of dayofweek function and value of dayofweek variable.
Type
const int
See also
", + "description": "Is a named constant for return value of dayofweek function and value of dayofweek variable.", + "type": "const int", + "remarks": "" + }, + { + "name": "display.all", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_display.all", + "fragment": "const_display.all", + "info": "

display.all

A named constant for use with the display parameter of plot*() and input*() functions. Displays plotted or input values in all possible locations.
Type
const plot_simple_display
See also
", + "description": "A named constant for use with the 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.data_window

A named constant for use with the 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
See also
", + "description": "A named constant for use with the 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

A named constant for use with the 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
See also
", + "description": "A named constant for use with the 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.pane

A named constant for use with the display parameter of plot*() functions. Displays plotted values in the chart pane used by the script.
Type
const plot_display
See also
", + "description": "A named constant for use with the 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.price_scale

A named constant for use with the 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
See also
", + "description": "A named constant for use with the 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

A named constant for use with the 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
See also
", + "description": "A named constant for use with the 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

A named constant for the request.dividends function. Is used to request the dividends return on a stock before deductions.
Type
const string
See also
", + "description": "A named constant for the request.dividends function. Is used to request the dividends return on a stock before deductions.", + "type": "const string", + "remarks": "" + }, + { + "name": "dividends.net", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_dividends.net", + "fragment": "const_dividends.net", + "info": "

dividends.net

A named constant for the request.dividends function. Is used to request the dividends return on a stock after deductions.
Type
const string
See also
", + "description": "A named constant for the request.dividends function. Is used to request the dividends return on a stock after deductions.", + "type": "const string", + "remarks": "" + }, + { + "name": "earnings.actual", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_earnings.actual", + "fragment": "const_earnings.actual", + "info": "

earnings.actual

A named constant for the request.earnings function. Is used to request the earnings value as it was reported.
Type
const string
See also
", + "description": "A named constant for the request.earnings function. Is used to request the earnings value as it was reported.", + "type": "const string", + "remarks": "" + }, + { + "name": "earnings.estimate", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_earnings.estimate", + "fragment": "const_earnings.estimate", + "info": "

earnings.estimate

A named constant for the request.earnings function. Is used to request the estimated earnings value.
Type
const string
See also
", + "description": "A named constant for the request.earnings function. Is used to request the estimated earnings value.", + "type": "const string", + "remarks": "" + }, + { + "name": "earnings.standardized", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_earnings.standardized", + "fragment": "const_earnings.standardized", + "info": "

earnings.standardized

A named constant for the request.earnings function. Is used to request the standardized earnings value.
Type
const string
See also
", + "description": "A named constant for the request.earnings function. Is used to request the standardized earnings value.", + "type": "const string", + "remarks": "" + }, + { + "name": "extend.both", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_extend.both", + "fragment": "const_extend.both", + "info": "

extend.both

A named constant for line.new and line.set_extend functions.
Type
const string
See also
", + "description": "A named constant for line.new and line.set_extend functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "extend.left", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_extend.left", + "fragment": "const_extend.left", + "info": "

extend.left

A named constant for line.new and line.set_extend functions.
Type
const string
See also
", + "description": "A named constant for line.new and line.set_extend functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "extend.none", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_extend.none", + "fragment": "const_extend.none", + "info": "

extend.none

A named constant for line.new and line.set_extend functions.
Type
const string
See also
", + "description": "A named constant for line.new and line.set_extend functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "extend.right", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_extend.right", + "fragment": "const_extend.right", + "info": "

extend.right

A named constant for line.new and line.set_extend functions.
Type
const string
See also
", + "description": "A named constant for line.new and line.set_extend functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "false", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_false", + "fragment": "const_false", + "info": "

false

Literal representing a bool value, and result of a comparison operation.
Remarks
See the User Manual for comparison operators and logical operators.
See also
", + "description": "Literal representing a bool value, and result of a comparison operation.", + "type": "", + "remarks": [ + "See the User Manual for comparison operators and logical operators." + ] + }, + { + "name": "font.family_default", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_font.family_default", + "fragment": "const_font.family_default", + "info": "", + "description": "Default text font for box.new, box.set_text_font_family, label.new, label.set_text_font_family, table.cell and table.cell_set_text_font_family functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "font.family_monospace", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_font.family_monospace", + "fragment": "const_font.family_monospace", + "info": "", + "description": "Monospace text font for box.new, box.set_text_font_family, label.new, label.set_text_font_family, table.cell and table.cell_set_text_font_family functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "format.inherit", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_format.inherit", + "fragment": "const_format.inherit", + "info": "

format.inherit

Is a named constant for selecting the formatting of the script output values from the parent series in the indicator function.
Type
const string
See also
", + "description": "Is a named constant for selecting the formatting of the script output values from the parent series in the indicator function.", + "type": "const string", + "remarks": "" + }, + { + "name": "format.mintick", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_format.mintick", + "fragment": "const_format.mintick", + "info": "

format.mintick

Is a named constant to use with the str.tostring function. Passing a number to str.tostring with this argument rounds the number to the nearest value that can be divided by syminfo.mintick, without the remainder, with ties rounding up, and returns the string version of said value with trailing zeros.
Type
const string
See also
", + "description": "Is a named constant to use with the str.tostring function. Passing a number to str.tostring with this argument rounds the number to the nearest value that can be divided by syminfo.mintick, without the remainder, with ties rounding up, and returns the string version of said value with trailing zeros.", + "type": "const string", + "remarks": "" + }, + { + "name": "format.percent", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_format.percent", + "fragment": "const_format.percent", + "info": "

format.percent

Is a named constant for selecting the formatting of the script output values as a percentage in the indicator function. It adds a percent sign after values.
Type
const string
Remarks
The default precision is 2, regardless of the precision of the chart itself. This can be changed with the 'precision' argument of the indicator function.
See also
", + "description": "Is a named constant for selecting the formatting of the script output values as a percentage in the indicator function. It adds a percent sign after values.", + "type": "const string", + "remarks": [ + "The default precision is 2, regardless of the precision of the chart itself. This can be changed with the 'precision' argument of the indicator function." + ] + }, + { + "name": "format.price", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_format.price", + "fragment": "const_format.price", + "info": "

format.price

Is a named constant for selecting the formatting of the script output values as prices in the indicator function.
Type
const string
Remarks
If format is format.price, default precision value is set. You can use the precision argument of indicator function to change the precision value.
See also
", + "description": "Is a named constant for selecting the formatting of the script output values as prices in the indicator function.", + "type": "const string", + "remarks": [ + "If format is format.price, default precision value is set. You can use the precision argument of indicator function to change the precision value." + ] + }, + { + "name": "format.volume", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_format.volume", + "fragment": "const_format.volume", + "info": "

format.volume

Is a named constant for selecting the formatting of the script output values as volume in the indicator function, e.g. '5183' will be formatted as '5.183K'.
The decimal precision rules defined by this variable take precedence over other precision settings. When an indicator, strategy, or plot*() call uses this format option, the function's precision parameter will not affect the result.
Type
const string
See also
", + "description": "Is a named constant for selecting the formatting of the script output values as volume in the indicator function, e.g. '5183' will be formatted as '5.183K'.", + "type": "const string", + "remarks": "" + }, + { + "name": "hline.style_dashed", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_hline.style_dashed", + "fragment": "const_hline.style_dashed", + "info": "

hline.style_dashed

Is a named constant for dashed linestyle of hline function.
Type
const hline_style
See also
", + "description": "Is a named constant for dashed linestyle of hline function.", + "type": "const hline_style", + "remarks": "" + }, + { + "name": "hline.style_dotted", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_hline.style_dotted", + "fragment": "const_hline.style_dotted", + "info": "

hline.style_dotted

Is a named constant for dotted linestyle of hline function.
Type
const hline_style
See also
", + "description": "Is a named constant for dotted linestyle of hline function.", + "type": "const hline_style", + "remarks": "" + }, + { + "name": "hline.style_solid", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_hline.style_solid", + "fragment": "const_hline.style_solid", + "info": "

hline.style_solid

Is a named constant for solid linestyle of hline function.
Type
const hline_style
See also
", + "description": "Is a named constant for solid linestyle of hline function.", + "type": "const hline_style", + "remarks": "" + }, + { + "name": "label.style_arrowdown", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_label.style_arrowdown", + "fragment": "const_label.style_arrowdown", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_arrowup", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_label.style_arrowup", + "fragment": "const_label.style_arrowup", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_circle", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_label.style_circle", + "fragment": "const_label.style_circle", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_cross", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_label.style_cross", + "fragment": "const_label.style_cross", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_diamond", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_label.style_diamond", + "fragment": "const_label.style_diamond", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_flag", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_label.style_flag", + "fragment": "const_label.style_flag", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_label_center", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_label.style_label_center", + "fragment": "const_label.style_label_center", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_label_down", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_label.style_label_down", + "fragment": "const_label.style_label_down", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_label_left", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_label.style_label_left", + "fragment": "const_label.style_label_left", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_label_lower_left", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_label.style_label_lower_left", + "fragment": "const_label.style_label_lower_left", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_label_lower_right", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_label.style_label_lower_right", + "fragment": "const_label.style_label_lower_right", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_label_right", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_label.style_label_right", + "fragment": "const_label.style_label_right", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_label_up", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_label.style_label_up", + "fragment": "const_label.style_label_up", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_label_upper_left", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_label.style_label_upper_left", + "fragment": "const_label.style_label_upper_left", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_label_upper_right", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_label.style_label_upper_right", + "fragment": "const_label.style_label_upper_right", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_none", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_label.style_none", + "fragment": "const_label.style_none", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_square", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_label.style_square", + "fragment": "const_label.style_square", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_text_outline", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_label.style_text_outline", + "fragment": "const_label.style_text_outline", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_triangledown", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_label.style_triangledown", + "fragment": "const_label.style_triangledown", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_triangleup", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_label.style_triangleup", + "fragment": "const_label.style_triangleup", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "label.style_xcross", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_label.style_xcross", + "fragment": "const_label.style_xcross", + "info": "", + "description": "Label style for label.new and label.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "line.style_arrow_both", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_line.style_arrow_both", + "fragment": "const_line.style_arrow_both", + "info": "

line.style_arrow_both

Line style for line.new and line.set_style functions. Solid line with arrows on both points.
Type
const string
See also
", + "description": "Line style for line.new and line.set_style functions. Solid line with arrows on both points.", + "type": "const string", + "remarks": "" + }, + { + "name": "line.style_arrow_left", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_line.style_arrow_left", + "fragment": "const_line.style_arrow_left", + "info": "

line.style_arrow_left

Line style for line.new and line.set_style functions. Solid line with arrow on the first point.
Type
const string
See also
", + "description": "Line style for line.new and line.set_style functions. Solid line with arrow on the first point.", + "type": "const string", + "remarks": "" + }, + { + "name": "line.style_arrow_right", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_line.style_arrow_right", + "fragment": "const_line.style_arrow_right", + "info": "

line.style_arrow_right

Line style for line.new and line.set_style functions. Solid line with arrow on the second point.
Type
const string
See also
", + "description": "Line style for line.new and line.set_style functions. Solid line with arrow on the second point.", + "type": "const string", + "remarks": "" + }, + { + "name": "line.style_dashed", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_line.style_dashed", + "fragment": "const_line.style_dashed", + "info": "", + "description": "Line style for line.new and line.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "line.style_dotted", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_line.style_dotted", + "fragment": "const_line.style_dotted", + "info": "", + "description": "Line style for line.new and line.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "line.style_solid", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_line.style_solid", + "fragment": "const_line.style_solid", + "info": "", + "description": "Line style for line.new and line.set_style functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "location.abovebar", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_location.abovebar", + "fragment": "const_location.abovebar", + "info": "

location.abovebar

Location value for plotshape, plotchar functions. Shape is plotted above main series bars.
Type
const string
See also
", + "description": "Location value for plotshape, plotchar functions. Shape is plotted above main series bars.", + "type": "const string", + "remarks": "" + }, + { + "name": "location.absolute", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_location.absolute", + "fragment": "const_location.absolute", + "info": "

location.absolute

Location value for plotshape, plotchar functions. Shape is plotted on chart using indicator value as a price coordinate.
Type
const string
See also
", + "description": "Location value for plotshape, plotchar functions. Shape is plotted on chart using indicator value as a price coordinate.", + "type": "const string", + "remarks": "" + }, + { + "name": "location.belowbar", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_location.belowbar", + "fragment": "const_location.belowbar", + "info": "

location.belowbar

Location value for plotshape, plotchar functions. Shape is plotted below main series bars.
Type
const string
See also
", + "description": "Location value for plotshape, plotchar functions. Shape is plotted below main series bars.", + "type": "const string", + "remarks": "" + }, + { + "name": "location.bottom", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_location.bottom", + "fragment": "const_location.bottom", + "info": "

location.bottom

Location value for plotshape, plotchar functions. Shape is plotted near the bottom chart border.
Type
const string
See also
", + "description": "Location value for plotshape, plotchar functions. Shape is plotted near the bottom chart border.", + "type": "const string", + "remarks": "" + }, + { + "name": "location.top", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_location.top", + "fragment": "const_location.top", + "info": "

location.top

Location value for plotshape, plotchar functions. Shape is plotted near the top chart border.
Type
const string
See also
", + "description": "Location value for plotshape, plotchar functions. Shape is plotted near the top chart border.", + "type": "const string", + "remarks": "" + }, + { + "name": "math.e", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_math.e", + "fragment": "const_math.e", + "info": "

math.e

Is a named constant for Euler's number. It is equal to 2.7182818284590452.
Type
const float
See also
", + "description": "Is a named constant for Euler's number. It is equal to 2.7182818284590452.", + "type": "const float", + "remarks": "" + }, + { + "name": "math.phi", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_math.phi", + "fragment": "const_math.phi", + "info": "

math.phi

Is a named constant for the golden ratio. It is equal to 1.6180339887498948.
Type
const float
See also
", + "description": "Is a named constant for the golden ratio. It is equal to 1.6180339887498948.", + "type": "const float", + "remarks": "" + }, + { + "name": "math.pi", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_math.pi", + "fragment": "const_math.pi", + "info": "

math.pi

Is a named constant for Archimedes' constant. It is equal to 3.1415926535897932.
Type
const float
See also
", + "description": "Is a named constant for Archimedes' constant. It is equal to 3.1415926535897932.", + "type": "const float", + "remarks": "" + }, + { + "name": "math.rphi", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_math.rphi", + "fragment": "const_math.rphi", + "info": "

math.rphi

Is a named constant for the golden ratio conjugate. It is equal to 0.6180339887498948.
Type
const float
See also
", + "description": "Is a named constant for the golden ratio conjugate. It is equal to 0.6180339887498948.", + "type": "const float", + "remarks": "" + }, + { + "name": "order.ascending", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_order.ascending", + "fragment": "const_order.ascending", + "info": "

order.ascending

Determines the sort order of the array from the smallest to the largest value.
Type
const sort_order
See also
", + "description": "Determines the sort order of the array from the smallest to the largest value.", + "type": "const sort_order", + "remarks": "" + }, + { + "name": "order.descending", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_order.descending", + "fragment": "const_order.descending", + "info": "

order.descending

Determines the sort order of the array from the largest to the smallest value.
Type
const sort_order
See also
", + "description": "Determines the sort order of the array from the largest to the smallest value.", + "type": "const sort_order", + "remarks": "" + }, + { + "name": "plot.style_area", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_plot.style_area", + "fragment": "const_plot.style_area", + "info": "

plot.style_area

A named constant for the 'Area' style, to be used as an argument for the style parameter in the plot function.
Type
const plot_style
See also
", + "description": "A named constant for the 'Area' style, to be used as an argument for the 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

A named constant for the 'Area With Breaks' style, to be used as an argument for the style parameter in the plot function. Similar to plot.style_area, except the gaps in the data are not filled.
Type
const plot_style
See also
", + "description": "A named constant for the 'Area With Breaks' style, to be used as an argument for the 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

A named constant for the 'Circles' style, to be used as an argument for the style parameter in the plot function.
Type
const plot_style
See also
", + "description": "A named constant for the 'Circles' style, to be used as an argument for the 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

A named constant for the 'Columns' style, to be used as an argument for the style parameter in the plot function.
Type
const plot_style
See also
", + "description": "A named constant for the 'Columns' style, to be used as an argument for the 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

A named constant for the 'Cross' style, to be used as an argument for the style parameter in the plot function.
Type
const plot_style
See also
", + "description": "A named constant for the 'Cross' style, to be used as an argument for the 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

A named constant for the 'Histogram' style, to be used as an argument for the style parameter in the plot function.
Type
const plot_style
See also
", + "description": "A named constant for the 'Histogram' style, to be used as an argument for the 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

A named constant for the 'Line' style, to be used as an argument for the style parameter in the plot function.
Type
const plot_style
See also
", + "description": "A named constant for the 'Line' style, to be used as an argument for the 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

A named constant for the 'Line With Breaks' style, to be used as an argument for the style parameter in the plot function. Similar to plot.style_line, except the gaps in the data are not filled.
Type
const plot_style
See also
", + "description": "A named constant for the 'Line With Breaks' style, to be used as an argument for the 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

A named constant for the 'Step Line' style, to be used as an argument for the style parameter in the plot function.
Type
const plot_style
See also
", + "description": "A named constant for the 'Step Line' style, to be used as an argument for the 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

A named constant for the 'Step Line With Diamonds' style, to be used as an argument for the 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
See also
", + "description": "A named constant for the 'Step Line With Diamonds' style, to be used as an argument for the 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

A named constant for the 'Step line with Breaks' style, to be used as an argument for the style parameter in the plot function.
Type
const plot_style
See also
", + "description": "A named constant for the 'Step line with Breaks' style, to be used as an argument for the 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

Table position is used in table.new, table.cell functions.
Binds the table to the bottom edge in the center.
Type
const string
See also
", + "description": "Table position is used in table.new, table.cell functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "position.bottom_left", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_position.bottom_left", + "fragment": "const_position.bottom_left", + "info": "

position.bottom_left

Table position is used in table.new, table.cell functions.
Binds the table to the bottom left of the screen.
Type
const string
See also
", + "description": "Table position is used in table.new, table.cell functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "position.bottom_right", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_position.bottom_right", + "fragment": "const_position.bottom_right", + "info": "", + "description": "Table position is used in table.new, table.cell functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "position.middle_center", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_position.middle_center", + "fragment": "const_position.middle_center", + "info": "

position.middle_center

Table position is used in table.new, table.cell functions.
Binds the table to the center of the screen.
Type
const string
See also
", + "description": "Table position is used in table.new, table.cell functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "position.middle_left", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_position.middle_left", + "fragment": "const_position.middle_left", + "info": "

position.middle_left

Table position is used in table.new, table.cell functions.
Binds the table to the left side of the screen.
Type
const string
See also
", + "description": "Table position is used in table.new, table.cell functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "position.middle_right", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_position.middle_right", + "fragment": "const_position.middle_right", + "info": "

position.middle_right

Table position is used in table.new, table.cell functions.
Binds the table to the right side of the screen.
Type
const string
See also
", + "description": "Table position is used in table.new, table.cell functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "position.top_center", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_position.top_center", + "fragment": "const_position.top_center", + "info": "", + "description": "Table position is used in table.new, table.cell functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "position.top_left", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_position.top_left", + "fragment": "const_position.top_left", + "info": "", + "description": "Table position is used in table.new, table.cell functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "position.top_right", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_position.top_right", + "fragment": "const_position.top_right", + "info": "", + "description": "Table position is used in table.new, table.cell functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "scale.left", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_scale.left", + "fragment": "const_scale.left", + "info": "

scale.left

Scale value for indicator function. Indicator is added to the left price scale.
Type
const scale_type
See also
", + "description": "Scale value for indicator function. Indicator is added to the left price scale.", + "type": "const scale_type", + "remarks": "" + }, + { + "name": "scale.none", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_scale.none", + "fragment": "const_scale.none", + "info": "

scale.none

Scale value for indicator function. Indicator is added in 'No Scale' mode. Can be used only with 'overlay=true'.
Type
const scale_type
See also
", + "description": "Scale value for indicator function. Indicator is added in 'No Scale' mode. Can be used only with 'overlay=true'.", + "type": "const scale_type", + "remarks": "" + }, + { + "name": "scale.right", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_scale.right", + "fragment": "const_scale.right", + "info": "

scale.right

Scale value for indicator function. Indicator is added to the right price scale.
Type
const scale_type
See also
", + "description": "Scale value for indicator function. Indicator is added to the right price scale.", + "type": "const scale_type", + "remarks": "" + }, + { + "name": "session.extended", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_session.extended", + "fragment": "const_session.extended", + "info": "

session.extended

Constant for extended session type (with extended hours data).
Type
const string
See also
", + "description": "Constant for extended session type (with extended hours data).", + "type": "const string", + "remarks": "" + }, + { + "name": "session.regular", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_session.regular", + "fragment": "const_session.regular", + "info": "

session.regular

Constant for regular session type (no extended hours data).
Type
const string
See also
", + "description": "Constant for regular session type (no extended hours data).", + "type": "const string", + "remarks": "" + }, + { + "name": "settlement_as_close.inherit", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_settlement_as_close.inherit", + "fragment": "const_settlement_as_close.inherit", + "info": "

settlement_as_close.inherit

A constant to specify the value of the settlement_as_close parameter in ticker.new and ticker.modify functions.
Type
const settlement
See also
", + "description": "A constant to specify the value of the 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

A constant to specify the value of the settlement_as_close parameter in ticker.new and ticker.modify functions.
Type
const settlement
See also
", + "description": "A constant to specify the value of the 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

A constant to specify the value of the settlement_as_close parameter in ticker.new and ticker.modify functions.
Type
const settlement
See also
", + "description": "A constant to specify the value of the 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": "

shape.arrowdown

Shape style for plotshape function.
Type
const string
See also
", + "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": "

shape.arrowup

Shape style for plotshape function.
Type
const string
See also
", + "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": "

shape.circle

Shape style for plotshape function.
Type
const string
See also
", + "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": "

shape.cross

Shape style for plotshape function.
Type
const string
See also
", + "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": "

shape.diamond

Shape style for plotshape function.
Type
const string
See also
", + "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": "

shape.flag

Shape style for plotshape function.
Type
const string
See also
", + "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": "

shape.labeldown

Shape style for plotshape function.
Type
const string
See also
", + "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": "

shape.labelup

Shape style for plotshape function.
Type
const string
See also
", + "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": "

shape.square

Shape style for plotshape function.
Type
const string
See also
", + "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": "

shape.triangledown

Shape style for plotshape function.
Type
const string
See also
", + "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": "

shape.triangleup

Shape style for plotshape function.
Type
const string
See also
", + "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": "

shape.xcross

Shape style for plotshape function.
Type
const string
See also
", + "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.auto

Size value for plotshape, plotchar functions. The size of the shape automatically adapts to the size of the bars.
Type
const string
See also
", + "description": "Size value for plotshape, plotchar functions. The size of the shape automatically adapts to the size of the bars.", + "type": "const string", + "remarks": "" + }, + { + "name": "size.huge", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_size.huge", + "fragment": "const_size.huge", + "info": "

size.huge

Size value for plotshape, plotchar functions. The size of the shape constantly huge.
Type
const string
See also
", + "description": "Size value for plotshape, plotchar functions. The size of the shape constantly huge.", + "type": "const string", + "remarks": "" + }, + { + "name": "size.large", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_size.large", + "fragment": "const_size.large", + "info": "

size.large

Size value for plotshape, plotchar functions. The size of the shape constantly large.
Type
const string
See also
", + "description": "Size value for plotshape, plotchar functions. The size of the shape constantly large.", + "type": "const string", + "remarks": "" + }, + { + "name": "size.normal", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_size.normal", + "fragment": "const_size.normal", + "info": "

size.normal

Size value for plotshape, plotchar functions. The size of the shape constantly normal.
Type
const string
See also
", + "description": "Size value for plotshape, plotchar functions. The size of the shape constantly normal.", + "type": "const string", + "remarks": "" + }, + { + "name": "size.small", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_size.small", + "fragment": "const_size.small", + "info": "

size.small

Size value for plotshape, plotchar functions. The size of the shape constantly small.
Type
const string
See also
", + "description": "Size value for plotshape, plotchar functions. The size of the shape constantly small.", + "type": "const string", + "remarks": "" + }, + { + "name": "size.tiny", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_size.tiny", + "fragment": "const_size.tiny", + "info": "

size.tiny

Size value for plotshape, plotchar functions. The size of the shape constantly tiny.
Type
const string
See also
", + "description": "Size value for plotshape, plotchar functions. The size of the shape constantly tiny.", + "type": "const string", + "remarks": "" + }, + { + "name": "splits.denominator", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_splits.denominator", + "fragment": "const_splits.denominator", + "info": "

splits.denominator

A named constant for the request.splits function. Is used to request the denominator (the number below the line in a fraction) of a splits.
Type
const string
See also
", + "description": "A named constant for the request.splits function. Is used to request the denominator (the number below the line in a fraction) of a splits.", + "type": "const string", + "remarks": "" + }, + { + "name": "splits.numerator", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_splits.numerator", + "fragment": "const_splits.numerator", + "info": "

splits.numerator

A named constant for the request.splits function. Is used to request the numerator (the number above the line in a fraction) of a splits.
Type
const string
See also
", + "description": "A named constant for the request.splits function. Is used to request the numerator (the number above the line in a fraction) of a splits.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.cash", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_strategy.cash", + "fragment": "const_strategy.cash", + "info": "

strategy.cash

This is one of the arguments that can be supplied to the 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
Example
//@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\")
See also
", + "description": "This is one of the arguments that can be supplied to the 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

Commission type for an order. Money displayed in the account currency per contract.
Type
const string
See also
", + "description": "Commission type for an order. Money displayed in the account currency per contract.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.commission.cash_per_order", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_strategy.commission.cash_per_order", + "fragment": "const_strategy.commission.cash_per_order", + "info": "

strategy.commission.cash_per_order

Commission type for an order. Money displayed in the account currency per order.
Type
const string
See also
", + "description": "Commission type for an order. Money displayed in the account currency per order.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.commission.percent", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_strategy.commission.percent", + "fragment": "const_strategy.commission.percent", + "info": "

strategy.commission.percent

Commission type for an order. A percentage of the cash volume of order.
Type
const string
See also
", + "description": "Commission type for an order. A percentage of the cash volume of order.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.direction.all", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_strategy.direction.all", + "fragment": "const_strategy.direction.all", + "info": "

strategy.direction.all

It allows strategy to open both long and short positions.
Type
const string
See also
", + "description": "It allows strategy to open both long and short positions.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.direction.long", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_strategy.direction.long", + "fragment": "const_strategy.direction.long", + "info": "

strategy.direction.long

It allows strategy to open only long positions.
Type
const string
See also
", + "description": "It allows strategy to open only long positions.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.direction.short", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_strategy.direction.short", + "fragment": "const_strategy.direction.short", + "info": "

strategy.direction.short

It allows strategy to open only short positions.
Type
const string
See also
", + "description": "It allows strategy to open only short positions.", + "type": "const string", + "remarks": "" + }, + { + "name": "strategy.fixed", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_strategy.fixed", + "fragment": "const_strategy.fixed", + "info": "

strategy.fixed

This is one of the arguments that can be supplied to the 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
Example
//@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\")
See also
", + "description": "This is one of the arguments that can be supplied to the 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

A named constant for use with the direction parameter of the strategy.entry and strategy.order commands. It specifies that the command creates a buy order.
Type
const strategy_direction
See also
", + "description": "A named constant for use with the 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

A named constant for use with the 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.
See also
", + "description": "A named constant for use with the 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

A named constant for use with the 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
See also
", + "description": "A named constant for use with the 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

A named constant for use with the 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.
See also
", + "description": "A named constant for use with the 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

This is one of the arguments that can be supplied to the 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
Example
//@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\")
See also
", + "description": "This is one of the arguments that can be supplied to the 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

A named constant for use with the direction parameter of the strategy.entry and strategy.order commands. It specifies that the command creates a sell order.
Type
const strategy_direction
See also
", + "description": "A named constant for use with the 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": "", + "description": "Vertical text alignment for box.new, box.set_text_valign, table.cell and table.cell_set_text_valign functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "text.align_center", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_text.align_center", + "fragment": "const_text.align_center", + "info": "", + "description": "Text alignment for box.new, box.set_text_halign, box.set_text_valign, label.new and label.set_textalign functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "text.align_left", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_text.align_left", + "fragment": "const_text.align_left", + "info": "

text.align_left

Horizontal text alignment for box.new, box.set_text_halign, label.new and label.set_textalign functions.
Type
const string
See also
", + "description": "Horizontal text alignment for box.new, box.set_text_halign, label.new and label.set_textalign functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "text.align_right", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_text.align_right", + "fragment": "const_text.align_right", + "info": "

text.align_right

Horizontal text alignment for box.new, box.set_text_halign, label.new and label.set_textalign functions.
Type
const string
See also
", + "description": "Horizontal text alignment for box.new, box.set_text_halign, label.new and label.set_textalign functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "text.align_top", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_text.align_top", + "fragment": "const_text.align_top", + "info": "", + "description": "Vertical text alignment for box.new, box.set_text_valign, table.cell and table.cell_set_text_valign functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "text.wrap_auto", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_text.wrap_auto", + "fragment": "const_text.wrap_auto", + "info": "

text.wrap_auto

Automatic wrapping mode for box.new and box.set_text_wrap functions.
Type
const string
See also
", + "description": "Automatic wrapping mode for box.new and box.set_text_wrap functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "text.wrap_none", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_text.wrap_none", + "fragment": "const_text.wrap_none", + "info": "

text.wrap_none

Disabled wrapping mode for box.new and box.set_text_wrap functions.
Type
const string
See also
", + "description": "Disabled wrapping mode for box.new and box.set_text_wrap functions.", + "type": "const string", + "remarks": "" + }, + { + "name": "true", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_true", + "fragment": "const_true", + "info": "

true

Literal representing one of the values a bool variable can hold, or an expression can evaluate to when it uses comparison or logical operators.
Remarks
See the User Manual for comparison operators and logical operators.
See also
", + "description": "Literal representing one of the values a bool variable can hold, or an expression can evaluate to when it uses comparison or logical operators.", + "type": "", + "remarks": [ + "See the User Manual for comparison operators and logical operators." + ] + }, + { + "name": "xloc.bar_index", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_xloc.bar_index", + "fragment": "const_xloc.bar_index", + "info": "

xloc.bar_index

A constant that specifies how functions that create and modify Pine drawings interpret x-coordinates. If xloc = xloc.bar_index, the drawing object treats each x-coordinate as a bar_index value.
Type
const string
See also
", + "description": "A constant that specifies how functions that create and modify Pine drawings interpret x-coordinates. If 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

A constant that specifies how functions that create and modify Pine drawings interpret x-coordinates. If xloc = xloc.bar_time, the drawing object treats each x-coordinate as a UNIX timestamp, expressed in milliseconds.
Type
const string
See also
", + "description": "A constant that specifies how functions that create and modify Pine drawings interpret x-coordinates. If 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

A named constant that specifies the algorithm of interpretation of y-value in function label.new.
Type
const string
See also
", + "description": "A named constant that specifies the algorithm of interpretation of y-value in function label.new.", + "type": "const string", + "remarks": "" + }, + { + "name": "yloc.belowbar", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_yloc.belowbar", + "fragment": "const_yloc.belowbar", + "info": "

yloc.belowbar

A named constant that specifies the algorithm of interpretation of y-value in function label.new.
Type
const string
See also
", + "description": "A named constant that specifies the algorithm of interpretation of y-value in function label.new.", + "type": "const string", + "remarks": "" + }, + { + "name": "yloc.price", + "url": "https://www.tradingview.com/pine-script-reference/v5/#const_yloc.price", + "fragment": "const_yloc.price", + "info": "

yloc.price

A named constant that specifies the algorithm of interpretation of y-value in function label.new.
Type
const string
See also
", + "description": "A named constant that specifies the algorithm of interpretation of y-value in function label.new.", + "type": "const string", + "remarks": "" + } +] \ No newline at end of file diff --git a/pine-script-intellij-plugin/bin/main/definitions/v5/functions.json b/pine-script-intellij-plugin/bin/main/definitions/v5/functions.json new file mode 100644 index 0000000..d00681f --- /dev/null +++ b/pine-script-intellij-plugin/bin/main/definitions/v5/functions.json @@ -0,0 +1,10044 @@ +[ + { + "name": "alert()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_alert", + "fragment": "fun_alert", + "info": "

alert()

Creates an alert event when called during the real-time bar, which will trigger a script alert based on \"alert function events\" if one was previously created for the indicator or strategy through the \"Create Alert\" dialog box.
Syntax
alert(message, freq) \u2192 void
Arguments
message (series string) Message sent when the alert triggers. Required argument.
freq (input string) The triggering frequency. Possible values are: alert.freq_all (all function calls trigger the alert), alert.freq_once_per_bar (the first function call during the bar triggers the alert), alert.freq_once_per_bar_close (the function call triggers the alert only when it occurs during the last script iteration of the real-time bar, when it closes). The default is alert.freq_once_per_bar.
Example
//@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)
Remarks
The Help Center explains how to create such alerts.
Contrary to alertcondition, alert calls do NOT count as an additional plot.
Function calls can be located in both global and local scopes.
Function calls do not display anything on the chart.
The 'freq' argument only affects the triggering frequency of the function call where it is used.
See also
", + "description": "Creates an alert event when called during the real-time bar, which will trigger a script alert based on \"alert function events\" if one was previously created for the indicator or strategy through the \"Create Alert\" dialog box.", + "arguments": [ + { + "argument": "message", + "type": "series string" + }, + { + "argument": "freq", + "type": "input string" + } + ], + "syntax": "alert(message, freq) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "alertcondition()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_alertcondition", + "fragment": "fun_alertcondition", + "info": "

alertcondition()

Creates alert condition, that is available in Create Alert dialog. Please note, that alertcondition does NOT create an alert, it just gives you more options in Create Alert dialog. Also, alertcondition effect is invisible on chart.
Syntax
alertcondition(condition, title, message) \u2192 void
Arguments
condition (series bool) Series of boolean values that is used for alert. True values mean alert fire, false - no alert. Required argument.
title (const string) Title of the alert condition. Optional argument.
message (const string) Message to display when alert fires. Optional argument.
Example
//@version=5
indicator(\"alertcondition\",\u00a0overlay=true)
alertcondition(close\u00a0>=\u00a0open,\u00a0title='Alert\u00a0on\u00a0Green\u00a0Bar',\u00a0message='Green\u00a0Bar!')
Remarks
Please note that an alertcondition call generates an additional plot. All such calls are taken into account when we calculate the number of the output series per script.
See also
", + "description": "Creates alert condition, that is available in Create Alert dialog. Please note, that alertcondition does NOT create an alert, it just gives you more options in Create Alert dialog. Also, alertcondition effect is invisible on chart.", + "arguments": [ + { + "argument": "condition", + "type": "series bool" + }, + { + "argument": "title", + "type": "const string" + }, + { + "argument": "message", + "type": "const string" + } + ], + "syntax": "alertcondition(condition, title, message) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "array.abs()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.abs", + "fragment": "fun_array.abs", + "info": "

array.abs()

2 overloads
Returns an array containing the absolute value of each element in the original array.
Syntax & Overloads
array.abs(id) \u2192 array<float>
array.abs(id) \u2192 array<int>
Arguments
id (array<int/float>) An array object.
See also
", + "description": "Returns an array containing the absolute value of each element in the original array.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.abs(id) \u2192 array", + "returnType": "array", + "returns": "" + }, + { + "name": "array.avg()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.avg", + "fragment": "fun_array.avg", + "info": "

array.avg()

2 overloads
The function returns the mean of an array's elements.
Syntax & Overloads
array.avg(id) \u2192 series float
array.avg(id) \u2192 series int
Arguments
id (array<int/float>) An array object.
Example
//@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))
Returns
Mean of array's elements.
See also
", + "description": "The function returns the mean of an array's elements.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.avg(id) \u2192 series float", + "returnType": "series float", + "returns": "Mean of array's elements." + }, + { + "name": "array.binary_search()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.binary_search", + "fragment": "fun_array.binary_search", + "info": "

array.binary_search()

The function returns the index of the value, or -1 if the value is not found. The array to search must be sorted in ascending order.
Syntax
array.binary_search(id, val) \u2192 series int
Arguments
id (array<int/float>) An array object.
val (series int/float) The value to search for in the array.
Example
//@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)
Remarks
A binary search works on arrays pre-sorted in ascending order. It begins by comparing an element in the middle of the array with the target value. If the element matches the target value, its position in the array is returned. If the element's value is greater than the target value, the search continues in the lower half of the array. If the element's value is less than the target value, the search continues in the upper half of the array. By doing this recursively, the algorithm progressively eliminates smaller and smaller portions of the array in which the target value cannot lie.
See also
", + "description": "The function returns the index of the value, or -1 if the value is not found. The array to search must be sorted in ascending order.", + "arguments": [ + { + "argument": "id", + "type": "array" + }, + { + "argument": "val", + "type": "series int/float" + } + ], + "syntax": "array.binary_search(id, val) \u2192 series int", + "returnType": "series int", + "returns": "" + }, + { + "name": "array.binary_search_leftmost()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.binary_search_leftmost", + "fragment": "fun_array.binary_search_leftmost", + "info": "

array.binary_search_leftmost()

The function returns the index of the value if it is found. When the value is not found, the function returns the index of the next smallest element to the left of where the value would lie if it was in the array. The array to search must be sorted in ascending order.
Syntax
array.binary_search_leftmost(id, val) \u2192 series int
Arguments
id (array<int/float>) An array object.
val (series int/float) The value to search for in the array.
Example
//@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)
Example
//@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\u00a01
Remarks
A binary search works on arrays pre-sorted in ascending order. It begins by comparing an element in the middle of the array with the target value. If the element matches the target value, its position in the array is returned. If the element's value is greater than the target value, the search continues in the lower half of the array. If the element's value is less than the target value, the search continues in the upper half of the array. By doing this recursively, the algorithm progressively eliminates smaller and smaller portions of the array in which the target value cannot lie.
See also
", + "description": "The function returns the index of the value if it is found. When the value is not found, the function returns the index of the next smallest element to the left of where the value would lie if it was in the array. The array to search must be sorted in ascending order.", + "arguments": [ + { + "argument": "id", + "type": "array" + }, + { + "argument": "val", + "type": "series int/float" + } + ], + "syntax": "array.binary_search_leftmost(id, val) \u2192 series int", + "returnType": "series int", + "returns": "" + }, + { + "name": "array.binary_search_rightmost()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.binary_search_rightmost", + "fragment": "fun_array.binary_search_rightmost", + "info": "

array.binary_search_rightmost()

The function returns the index of the value if it is found. When the value is not found, the function returns the index of the element to the right of where the value would lie if it was in the array. The array must be sorted in ascending order.
Syntax
array.binary_search_rightmost(id, val) \u2192 series int
Arguments
id (array<int/float>) An array object.
val (series int/float) The value to search for in the array.
Example
//@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)
Example
//@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\u00a03
Remarks
A binary search works on sorted arrays in ascending order. It begins by comparing an element in the middle of the array with the target value. If the element matches the target value, its position in the array is returned. If the element's value is greater than the target value, the search continues in the lower half of the array. If the element's value is less than the target value, the search continues in the upper half of the array. By doing this recursively, the algorithm progressively eliminates smaller and smaller portions of the array in which the target value cannot lie.
See also
", + "description": "The function returns the index of the value if it is found. When the value is not found, the function returns the index of the element to the right of where the value would lie if it was in the array. The array must be sorted in ascending order.", + "arguments": [ + { + "argument": "id", + "type": "array" + }, + { + "argument": "val", + "type": "series int/float" + } + ], + "syntax": "array.binary_search_rightmost(id, val) \u2192 series int", + "returnType": "series int", + "returns": "" + }, + { + "name": "array.clear()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.clear", + "fragment": "fun_array.clear", + "info": "

array.clear()

The function removes all elements from an array.
Syntax
array.clear(id) \u2192 void
Arguments
id (any array type) An array object.
Example
//@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))
See also
", + "description": "The function removes all elements from an array.", + "arguments": [ + { + "argument": "id", + "type": "any array type" + } + ], + "syntax": "array.clear(id) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "array.concat()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.concat", + "fragment": "fun_array.concat", + "info": "

array.concat()

The function is used to merge two arrays. It pushes all elements from the second array to the first array, and returns the first array.
Syntax
array.concat(id1, id2) \u2192 array<type>
Arguments
id1 (any array type) The first array object.
id2 (any array type) The second array object.
Example
//@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))
Returns
The first array with merged elements from the second array.
See also
", + "description": "The function is used to merge two arrays. It pushes all elements from the second array to the first array, and returns the first array.", + "arguments": [ + { + "argument": "id1", + "type": "any array type" + }, + { + "argument": "id2", + "type": "any array type" + } + ], + "syntax": "array.concat(id1, id2) \u2192 array", + "returnType": "array", + "returns": "The first array with merged elements from the second array." + }, + { + "name": "array.copy()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.copy", + "fragment": "fun_array.copy", + "info": "

array.copy()

The function creates a copy of an existing array.
Syntax
array.copy(id) \u2192 array<type>
Arguments
id (any array type) An array object.
Example
//@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)
Returns
A copy of an array.
See also
", + "description": "The function creates a copy of an existing array.", + "arguments": [ + { + "argument": "id", + "type": "any array type" + } + ], + "syntax": "array.copy(id) \u2192 array", + "returnType": "array", + "returns": "A copy of an array." + }, + { + "name": "array.covariance()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.covariance", + "fragment": "fun_array.covariance", + "info": "

array.covariance()

The function returns the covariance of two arrays.
Syntax
array.covariance(id1, id2, biased) \u2192 series float
Arguments
id1 (array<int/float>) An array object.
id2 (array<int/float>) An array object.
biased (series bool) Determines which estimate should be used. Optional. The default is true.
Example
//@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))
Returns
The covariance of two arrays.
Remarks
If biased is true, function will calculate using a biased estimate of the entire population, if false - unbiased estimate of a sample.
See also
", + "description": "The function returns the covariance of two arrays.", + "arguments": [ + { + "argument": "id1", + "type": "array" + }, + { + "argument": "id2", + "type": "array" + }, + { + "argument": "biased", + "type": "series bool" + } + ], + "syntax": "array.covariance(id1, id2, biased) \u2192 series float", + "returnType": "series float", + "returns": "The covariance of two arrays." + }, + { + "name": "array.every()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.every", + "fragment": "fun_array.every", + "info": "

array.every()

Returns true if all elements of the id array are true, false otherwise.
Syntax
array.every(id) \u2192 series bool
Arguments
id (array<bool>) An array object.
Remarks
This function also works with arrays of int and float types, in which case zero values are considered false, and all others true.
See also
", + "description": "Returns true if all elements of the id array are true, false otherwise.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.every(id) \u2192 series bool", + "returnType": "series bool", + "returns": "" + }, + { + "name": "array.fill()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.fill", + "fragment": "fun_array.fill", + "info": "

array.fill()

The function sets elements of an array to a single value. If no index is specified, all elements are set. If only a start index (default 0) is supplied, the elements starting at that index are set. If both index parameters are used, the elements from the starting index up to but not including the end index (default na) are set.
Syntax
array.fill(id, value, index_from, index_to) \u2192 void
Arguments
id (any array type) An array object.
value (series <type of the array's elements>) Value to fill the array with.
index_from (series int) Start index, default is 0.
index_to (series int) End index, default is na. Must be one greater than the index of the last element to set.
Example
//@version=5
indicator(\"array.fill\u00a0example\")
a\u00a0=\u00a0array.new_float(10)
array.fill(a,\u00a0close)
plot(array.sum(a))
See also
", + "description": "The function sets elements of an array to a single value. If no index is specified, all elements are set. If only a start index (default 0) is supplied, the elements starting at that index are set. If both index parameters are used, the elements from the starting index up to but not including the end index (default na) are set.", + "arguments": [ + { + "argument": "id", + "type": "any array type" + }, + { + "argument": "value", + "type": "series " + }, + { + "argument": "index_from", + "type": "series int" + }, + { + "argument": "index_to", + "type": "series int" + } + ], + "syntax": "array.fill(id, value, index_from, index_to) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "array.first()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.first", + "fragment": "fun_array.first", + "info": "

array.first()

Returns the array's first element. Throws a runtime error if the array is empty.
Syntax
array.first(id) \u2192 series <type>
Arguments
id (any array type) An array object.
Example
//@version=5
indicator(\"array.first\u00a0example\")
arr\u00a0=\u00a0array.new_int(3,\u00a010)
plot(array.first(arr))
See also
", + "description": "Returns the array's first element. Throws a runtime error if the array is empty.", + "arguments": [ + { + "argument": "id", + "type": "any array type" + } + ], + "syntax": "array.first(id) \u2192 series ", + "returnType": "series ", + "returns": "" + }, + { + "name": "array.from()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.from", + "fragment": "fun_array.from", + "info": "

array.from()

12 overloads
The function takes a variable number of arguments with one of the types: int, float, bool, string, label, line, color, box, table, linefill, and returns an array of the corresponding type.
Syntax & Overloads
array.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>
Arguments
arg0, arg1, ... (series enum) Array arguments.
Example
//@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)
Returns
The array element's value.
Remarks
This function can accept up to 4,000 'int', 'float', 'bool', or 'color' arguments. For all other types, including user-defined types, the limit is 999.
", + "description": "The function takes a variable number of arguments with one of the types: int, float, bool, string, label, line, color, box, table, linefill, and returns an array of the corresponding type.", + "arguments": [ + { + "argument": "arg0, arg1, ...", + "type": "series enum" + } + ], + "syntax": "array.from(arg0, arg1, ...) \u2192 array", + "returnType": "array", + "returns": "The array element's value." + }, + { + "name": "array.get()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.get", + "fragment": "fun_array.get", + "info": "

array.get()

The function returns the value of the element at the specified index.
Syntax
array.get(id, index) \u2192 series <type>
Arguments
id (any array type) An array object.
index (series int) The index of the element whose value is to be returned.
Example
//@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))
Returns
The array element's value.
See also
", + "description": "The function returns the value of the element at the specified index.", + "arguments": [ + { + "argument": "id", + "type": "any array type" + }, + { + "argument": "index", + "type": "series int" + } + ], + "syntax": "array.get(id, index) \u2192 series ", + "returnType": "series ", + "returns": "The array element's value." + }, + { + "name": "array.includes()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.includes", + "fragment": "fun_array.includes", + "info": "

array.includes()

The function returns true if the value was found in an array, false otherwise.
Syntax
array.includes(id, value) \u2192 series bool
Arguments
id (any array type) An array object.
value (series <type of the array's elements>) The value to search in the array.
Example
//@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)
Returns
True if the value was found in the array, false otherwise.
See also
", + "description": "The function returns true if the value was found in an array, false otherwise.", + "arguments": [ + { + "argument": "id", + "type": "any array type" + }, + { + "argument": "value", + "type": "series " + } + ], + "syntax": "array.includes(id, value) \u2192 series bool", + "returnType": "series bool", + "returns": "True if the value was found in the array, false otherwise." + }, + { + "name": "array.indexof()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.indexof", + "fragment": "fun_array.indexof", + "info": "

array.indexof()

The function returns the index of the first occurrence of the value, or -1 if the value is not found.
Syntax
array.indexof(id, value) \u2192 series int
Arguments
id (any array type) An array object.
value (series <type of the array's elements>) The value to search in the array.
Example
//@version=5
indicator(\"array.indexof\u00a0example\")
a\u00a0=\u00a0array.new_float(5,high)
index\u00a0=\u00a0array.indexof(a,\u00a0high)
plot(index)
Returns
The index of an element.
See also
", + "description": "The function returns the index of the first occurrence of the value, or -1 if the value is not found.", + "arguments": [ + { + "argument": "id", + "type": "any array type" + }, + { + "argument": "value", + "type": "series " + } + ], + "syntax": "array.indexof(id, value) \u2192 series int", + "returnType": "series int", + "returns": "The index of an element." + }, + { + "name": "array.insert()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.insert", + "fragment": "fun_array.insert", + "info": "

array.insert()

The function changes the contents of an array by adding new elements in place.
Syntax
array.insert(id, index, value) \u2192 void
Arguments
id (any array type) An array object.
index (series int) The index at which to insert the value.
value (series <type of the array's elements>) The value to add to the array.
Example
//@version=5
indicator(\"array.insert\u00a0example\")
a\u00a0=\u00a0array.new_float(5,\u00a0close)
array.insert(a,\u00a00,\u00a0open)
plot(array.get(a,\u00a05))
See also
", + "description": "The function changes the contents of an array by adding new elements in place.", + "arguments": [ + { + "argument": "id", + "type": "any array type" + }, + { + "argument": "index", + "type": "series int" + }, + { + "argument": "value", + "type": "series " + } + ], + "syntax": "array.insert(id, index, value) \u2192 void", + "returnType": "void", + "returns": "" + }, + { + "name": "array.join()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.join", + "fragment": "fun_array.join", + "info": "

array.join()

The function creates and returns a new string by concatenating all the elements of an array, separated by the specified separator string.
Syntax
array.join(id, separator) \u2192 series string
Arguments
id (array<int/float/string>) An array object.
separator (series string) The string used to separate each array element.
Example
//@version=5
indicator(\"array.join\u00a0example\")
a\u00a0=\u00a0array.new_float(5,\u00a05)
label.new(bar_index,\u00a0close,\u00a0array.join(a,\u00a0\",\"))
See also
", + "description": "The function creates and returns a new string by concatenating all the elements of an array, separated by the specified separator string.", + "arguments": [ + { + "argument": "id", + "type": "array" + }, + { + "argument": "separator", + "type": "series string" + } + ], + "syntax": "array.join(id, separator) \u2192 series string", + "returnType": "series string", + "returns": "" + }, + { + "name": "array.last()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.last", + "fragment": "fun_array.last", + "info": "

array.last()

Returns the array's last element. Throws a runtime error if the array is empty.
Syntax
array.last(id) \u2192 series <type>
Arguments
id (any array type) An array object.
Example
//@version=5
indicator(\"array.last\u00a0example\")
arr\u00a0=\u00a0array.new_int(3,\u00a010)
plot(array.last(arr))
See also
", + "description": "Returns the array's last element. Throws a runtime error if the array is empty.", + "arguments": [ + { + "argument": "id", + "type": "any array type" + } + ], + "syntax": "array.last(id) \u2192 series ", + "returnType": "series ", + "returns": "" + }, + { + "name": "array.lastindexof()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.lastindexof", + "fragment": "fun_array.lastindexof", + "info": "

array.lastindexof()

The function returns the index of the last occurrence of the value, or -1 if the value is not found.
Syntax
array.lastindexof(id, value) \u2192 series int
Arguments
id (any array type) An array object.
value (series <type of the array's elements>) The value to search in the array.
Example
//@version=5
indicator(\"array.lastindexof\u00a0example\")
a\u00a0=\u00a0array.new_float(5,high)
index\u00a0=\u00a0array.lastindexof(a,\u00a0high)
plot(index)
Returns
The index of an element.
See also
", + "description": "The function returns the index of the last occurrence of the value, or -1 if the value is not found.", + "arguments": [ + { + "argument": "id", + "type": "any array type" + }, + { + "argument": "value", + "type": "series " + } + ], + "syntax": "array.lastindexof(id, value) \u2192 series int", + "returnType": "series int", + "returns": "The index of an element." + }, + { + "name": "array.max()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.max", + "fragment": "fun_array.max", + "info": "

array.max()

4 overloads
The function returns the greatest value, or the nth greatest value in a given array.
Syntax & Overloads
array.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
Arguments
id (array<int/float>) An array object.
Example
//@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)
Returns
The greatest or the nth greatest value in the array.
See also
", + "description": "The function returns the greatest value, or the nth greatest value in a given array.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.max(id) \u2192 series float", + "returnType": "series float", + "returns": "The greatest or the nth greatest value in the array." + }, + { + "name": "array.median()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.median", + "fragment": "fun_array.median", + "info": "

array.median()

2 overloads
The function returns the median of an array's elements.
Syntax & Overloads
array.median(id) \u2192 series float
array.median(id) \u2192 series int
Arguments
id (array<int/float>) An array object.
Example
//@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))
Returns
The median of the array's elements.
See also
", + "description": "The function returns the median of an array's elements.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.median(id) \u2192 series float", + "returnType": "series float", + "returns": "The median of the array's elements." + }, + { + "name": "array.min()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.min", + "fragment": "fun_array.min", + "info": "

array.min()

4 overloads
The function returns the smallest value, or the nth smallest value in a given array.
Syntax & Overloads
array.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
Arguments
id (array<int/float>) An array object.
Example
//@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)
Returns
The smallest or the nth smallest value in the array.
See also
", + "description": "The function returns the smallest value, or the nth smallest value in a given array.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.min(id) \u2192 series float", + "returnType": "series float", + "returns": "The smallest or the nth smallest value in the array." + }, + { + "name": "array.mode()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.mode", + "fragment": "fun_array.mode", + "info": "

array.mode()

2 overloads
The function returns the mode of an array's elements. If there are several values with the same frequency, it returns the smallest value.
Syntax & Overloads
array.mode(id) \u2192 series float
array.mode(id) \u2192 series int
Arguments
id (array<int/float>) An array object.
Example
//@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))
Returns
The most frequently occurring value from the id array. If none exists, returns the smallest value instead.
See also
", + "description": "The function returns the mode of an array's elements. If there are several values with the same frequency, it returns the smallest value.", + "arguments": [ + { + "argument": "id", + "type": "array" + } + ], + "syntax": "array.mode(id) \u2192 series float", + "returnType": "series float", + "returns": "The most frequently occurring value from theidarray. If none exists, returns the smallest value instead." + }, + { + "name": "array.new_bool()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.new_bool", + "fragment": "fun_array.new_bool", + "info": "

array.new_bool()

The function creates a new array object of bool type elements.
Syntax
array.new_bool(size, initial_value) \u2192 array<bool>
Arguments
size (series int) Initial size of an array. Optional. The default is 0.
initial_value (series bool) Initial value of all array elements. Optional. The default is 'na'.
Example
//@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)
Returns
The ID of an array object which may be used in other array.*() functions.
Remarks
An array index starts from 0.
See also
", + "description": "The function creates a new array object of bool type elements.", + "arguments": [ + { + "argument": "size", + "type": "series int" + }, + { + "argument": "initial_value", + "type": "series bool" + } + ], + "syntax": "array.new_bool(size, initial_value) \u2192 array", + "returnType": "array", + "returns": "The ID of an array object which may be used in other array.*() functions." + }, + { + "name": "array.new_box()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.new_box", + "fragment": "fun_array.new_box", + "info": "

array.new_box()

The function creates a new array object of box type elements.
Syntax
array.new_box(size, initial_value) \u2192 array<box>
Arguments
size (series int) Initial size of an array. Optional. The default is 0.
initial_value (series box) Initial value of all array elements. Optional. The default is 'na'.
Example
//@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)
Returns
The ID of an array object which may be used in other array.*() functions.
Remarks
An array index starts from 0.
See also
", + "description": "The function creates a new array object of box type elements.", + "arguments": [ + { + "argument": "size", + "type": "series int" + }, + { + "argument": "initial_value", + "type": "series box" + } + ], + "syntax": "array.new_box(size, initial_value) \u2192 array", + "returnType": "array", + "returns": "The ID of an array object which may be used in other array.*() functions." + }, + { + "name": "array.new_color()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.new_color", + "fragment": "fun_array.new_color", + "info": "

array.new_color()

The function creates a new array object of color type elements.
Syntax
array.new_color(size, initial_value) \u2192 array<color>
Arguments
size (series int) Initial size of an array. Optional. The default is 0.
initial_value (series color) Initial value of all array elements. Optional. The default is 'na'.
Example
//@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))
Returns
The ID of an array object which may be used in other array.*() functions.
Remarks
An array index starts from 0.
See also
", + "description": "The function creates a new array object of color type elements.", + "arguments": [ + { + "argument": "size", + "type": "series int" + }, + { + "argument": "initial_value", + "type": "series color" + } + ], + "syntax": "array.new_color(size, initial_value) \u2192 array", + "returnType": "array", + "returns": "The ID of an array object which may be used in other array.*() functions." + }, + { + "name": "array.new_float()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.new_float", + "fragment": "fun_array.new_float", + "info": "

array.new_float()

The function creates a new array object of float type elements.
Syntax
array.new_float(size, initial_value) \u2192 array<float>
Arguments
size (series int) Initial size of an array. Optional. The default is 0.
initial_value (series int/float) Initial value of all array elements. Optional. The default is 'na'.
Example
//@version=5
indicator(\"array.new_float\u00a0example\")
length\u00a0=\u00a05
a\u00a0=\u00a0array.new_float(length,\u00a0close)
plot(array.sum(a)\u00a0/\u00a0length)
Returns
The ID of an array object which may be used in other array.*() functions.
Remarks
An array index starts from 0.
See also
", + "description": "The function creates a new array object of float type elements.", + "arguments": [ + { + "argument": "size", + "type": "series int" + }, + { + "argument": "initial_value", + "type": "series int/float" + } + ], + "syntax": "array.new_float(size, initial_value) \u2192 array", + "returnType": "array", + "returns": "The ID of an array object which may be used in other array.*() functions." + }, + { + "name": "array.new_int()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.new_int", + "fragment": "fun_array.new_int", + "info": "

array.new_int()

The function creates a new array object of int type elements.
Syntax
array.new_int(size, initial_value) \u2192 array<int>
Arguments
size (series int) Initial size of an array. Optional. The default is 0.
initial_value (series int) Initial value of all array elements. Optional. The default is 'na'.
Example
//@version=5
indicator(\"array.new_int\u00a0example\")
length\u00a0=\u00a05
a\u00a0=\u00a0array.new_int(length,\u00a0int(close))
plot(array.sum(a)\u00a0/\u00a0length)
Returns
The ID of an array object which may be used in other array.*() functions.
Remarks
An array index starts from 0.
See also
", + "description": "The function creates a new array object of int type elements.", + "arguments": [ + { + "argument": "size", + "type": "series int" + }, + { + "argument": "initial_value", + "type": "series int" + } + ], + "syntax": "array.new_int(size, initial_value) \u2192 array", + "returnType": "array", + "returns": "The ID of an array object which may be used in other array.*() functions." + }, + { + "name": "array.new_label()", + "url": "https://www.tradingview.com/pine-script-reference/v5/#fun_array.new_label", + "fragment": "fun_array.new_label", + "info": "

array.new_label()

The function creates a new array object of label type elements.
Syntax
array.new_label(size, initial_value) \u2192 array<label>
Arguments
size (series int) Initial size of an array. Optional. The default is 0.
initial_value (series label) Initial value of all array elements. Optional. The default is 'na'.
Example
//@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())
Returns
The ID of an array object which may be used in other array.*() functions.
Remarks
An array index starts from 0.
See also
", + "description": "The function creates a new array object of label type elements.", + "arguments": [ + { + "argument": "size", + "type": "series int" + }, + { + "argument": "initial_value", + "type": "series label" + } + ], + "syntax": "array.new_label(size, initial_value) \u2192 array