From 454ea1cf7be150397f33c0b95ea59b75f4287e06 Mon Sep 17 00:00:00 2001 From: everget Date: Tue, 23 Jul 2019 01:17:39 +0300 Subject: [PATCH 1/9] Move functions to snippets --- {functions => snippets/functions}/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {functions => snippets/functions}/.gitkeep (100%) diff --git a/functions/.gitkeep b/snippets/functions/.gitkeep similarity index 100% rename from functions/.gitkeep rename to snippets/functions/.gitkeep From df55609473784921f7da95bb327c0d8107da79c6 Mon Sep 17 00:00:00 2001 From: everget Date: Tue, 23 Jul 2019 01:18:07 +0300 Subject: [PATCH 2/9] Move tricks to snippets --- {tricks => snippets/tricks}/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {tricks => snippets/tricks}/.gitkeep (100%) diff --git a/tricks/.gitkeep b/snippets/tricks/.gitkeep similarity index 100% rename from tricks/.gitkeep rename to snippets/tricks/.gitkeep From 0669f85364689431f122a70929394ed6175b2db4 Mon Sep 17 00:00:00 2001 From: everget Date: Tue, 23 Jul 2019 01:18:44 +0300 Subject: [PATCH 3/9] Create images folder --- pine.png => images/pine.png | Bin pinelong.png => images/pinelong.png | Bin 2 files changed, 0 insertions(+), 0 deletions(-) rename pine.png => images/pine.png (100%) rename pinelong.png => images/pinelong.png (100%) diff --git a/pine.png b/images/pine.png similarity index 100% rename from pine.png rename to images/pine.png diff --git a/pinelong.png b/images/pinelong.png similarity index 100% rename from pinelong.png rename to images/pinelong.png From 5b603f0ab3db24db3c209a48a0f29c61f4f490b4 Mon Sep 17 00:00:00 2001 From: everget Date: Tue, 23 Jul 2019 01:19:28 +0300 Subject: [PATCH 4/9] Move strategy templates to strategies folder --- {boilerplates => strategies/templates}/basic_strategy.pine | 0 {boilerplates => strategies/templates}/crypto_strategy.pine | 0 {boilerplates => strategies/templates}/forex_strategy.pine | 0 {boilerplates => strategies/templates}/stock_strategy.pine | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename {boilerplates => strategies/templates}/basic_strategy.pine (100%) rename {boilerplates => strategies/templates}/crypto_strategy.pine (100%) rename {boilerplates => strategies/templates}/forex_strategy.pine (100%) rename {boilerplates => strategies/templates}/stock_strategy.pine (100%) diff --git a/boilerplates/basic_strategy.pine b/strategies/templates/basic_strategy.pine similarity index 100% rename from boilerplates/basic_strategy.pine rename to strategies/templates/basic_strategy.pine diff --git a/boilerplates/crypto_strategy.pine b/strategies/templates/crypto_strategy.pine similarity index 100% rename from boilerplates/crypto_strategy.pine rename to strategies/templates/crypto_strategy.pine diff --git a/boilerplates/forex_strategy.pine b/strategies/templates/forex_strategy.pine similarity index 100% rename from boilerplates/forex_strategy.pine rename to strategies/templates/forex_strategy.pine diff --git a/boilerplates/stock_strategy.pine b/strategies/templates/stock_strategy.pine similarity index 100% rename from boilerplates/stock_strategy.pine rename to strategies/templates/stock_strategy.pine From 7089503d04834d994719b5999876feb067ea93da Mon Sep 17 00:00:00 2001 From: everget Date: Tue, 23 Jul 2019 01:20:03 +0300 Subject: [PATCH 5/9] Create indicators templates folder --- indicators/templates/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 indicators/templates/.gitkeep diff --git a/indicators/templates/.gitkeep b/indicators/templates/.gitkeep new file mode 100644 index 0000000..e69de29 From 30ca318ecf3331d8024fb4a3ef03415bb1959e1c Mon Sep 17 00:00:00 2001 From: everget Date: Tue, 23 Jul 2019 01:20:52 +0300 Subject: [PATCH 6/9] Fix typos and add links to table of contents --- guides/code_style/README.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/guides/code_style/README.md b/guides/code_style/README.md index c7ac6bb..c2c82d8 100644 --- a/guides/code_style/README.md +++ b/guides/code_style/README.md @@ -1,5 +1,5 @@ -![logo](../../pinelong.png "Pine") +![logo](../../images/pinelong.png "Pine") # Pine Script Coding Conventions @@ -8,10 +8,14 @@ The goal of these Coding Conventions is to present a set of best practices and style guidelines for Pine Script. By making Pine scripts easier to read, these guidelines make open source code more readable, while also providing safeguards that minimize the risk of errors for developers. ### Translations + 1. [TODO](#) ### Table of Contents -1. [TODO](#) + +1. [Script Structure](#script-structure) +1. [Naming Conventions](#naming-conventions) +1. [Line Wrapping](#line-wrapping) ## Script Structure @@ -38,28 +42,32 @@ Here is an example of a complete script: ``` code ``` + +**[Back to top](#table-of-contents)** + ## Naming Conventions ### Variable and Function Names -CamelCase is recommmended. Example: `emaLength`, `obLevel`, `showSignal2`, `aLongVariableName`. +CamelCase is recommended. Example: `emaLength`, `obLevel`, `showSignal2`, `aLongVariableName`. ### Function Parameter Names -Function parameters should be prefixed with the underscore in order to diffentiate them from global and local scope variables. Example: +Function parameters should be prefixed with the underscore in order to differentiate them from global and local scope variables. Example: ``` -daysInMonth( _year, _month) => +daysInMonth(_year, _month) => ``` ### Local Scope Variable Names > Do we need something here, to prevent inadvertent confusion with global scope vars? +**[Back to top](#table-of-contents)** + ## Line Wrapping When lines need to be continued on the next, use two spaces to indent the continuation line. - **[Back to top](#table-of-contents)** # TODO From 77097cb4a311d8a3d0e364c4f2723ed70bf37b7b Mon Sep 17 00:00:00 2001 From: everget Date: Tue, 23 Jul 2019 01:44:49 +0300 Subject: [PATCH 7/9] Change snippet template --- snippets/template.md | 46 +++++++++++++++----------------------------- 1 file changed, 15 insertions(+), 31 deletions(-) diff --git a/snippets/template.md b/snippets/template.md index 72fb517..140efd3 100644 --- a/snippets/template.md +++ b/snippets/template.md @@ -2,82 +2,66 @@ #### Description: -Description of the template snippet name snippet. +Place description of your snippet here. ##### References: -* [link1](http:\\alinktonowhere.come "descriptionoflinktonowhere.") - + * [Link](http:\\alinktonowhere.come "description_of_link") #### Code:
- pine version = 4: + @version=4: ``` -//----------------- -// example snippet code: -// pine version=4 f_phi() => - float _phi = 0,5 + sqrt(1,25) + float _phi = 0.5 + sqrt(1.25) _phi -//----------------- ```
- pine version = 2: + @version=2: ```javascript -//----------------- -// example snippet code: -// pine version=2 f_phi() => - _phi = 0,5 + sqrt(1,25) + _phi = 0.5 + sqrt(1.25) _phi -//----------------- -``` +```
#### Example: - -Description of the example,
-use the phi function and multiply by 2,
-this is more text.... +Place description of the example here.
- Example Code: + ```javascript //@version=4 -study("Function - PHI") +study("Function - Golden Ratio") -//----------------- -// example snippet code: f_phi() => - float _phi = 0,5 + sqrt(1,25) + float _phi = 0.5 + sqrt(1.25) _phi -//----------------- example = f_phi() * 2 -plot(series=example, title='example', color=color.red) +plot(series=example, title="Example", color=color.red) ```
##### Code Author(s): - * ##### [Author](http:\\linkifavaiable "@tooltip.") + * [Author](http:\\linkifavaiable "@nickname")

-
-[Disclaimer](/./DISCLAIMER.md "Disclaimer.")
-[License](/./LICENSE "License.") +[Disclaimer](/./DISCLAIMER.md "Disclaimer")
+[License](/./LICENSE "License") From e6a174247bf63c961eca4300663a98a920308546 Mon Sep 17 00:00:00 2001 From: Alex Orekhov Date: Tue, 23 Jul 2019 13:57:15 +0300 Subject: [PATCH 8/9] Delete .gitkeep --- snippets/functions/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 snippets/functions/.gitkeep diff --git a/snippets/functions/.gitkeep b/snippets/functions/.gitkeep deleted file mode 100644 index e69de29..0000000 From f9fd50f4c00548debf8de71083dde107c4c7ee7b Mon Sep 17 00:00:00 2001 From: Alex Orekhov Date: Tue, 23 Jul 2019 13:57:24 +0300 Subject: [PATCH 9/9] Delete .gitkeep --- snippets/tricks/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 snippets/tricks/.gitkeep diff --git a/snippets/tricks/.gitkeep b/snippets/tricks/.gitkeep deleted file mode 100644 index e69de29..0000000