You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@
9
9
10
10
<divalign="center"><fontsize="+1"><strong>Want to learn proper Pine coding style?<br></strong></font> Read our <ahref="http://www.pinecoders.com/coding_conventions">Pine Coding Conventions</a>.</div>
11
11
12
-
<divalign="center"><fontsize="+1"><strong>Looking for Pine-related tools and resources?<br></strong></font> Read our <ahref="http://www.pinecoders.com/resources">Pine Resources</a>.</div>
12
+
<divalign="center"><fontsize="+1"><strong>Looking for Pine-related tools or resources?<br></strong></font> Use our list of <ahref="http://www.pinecoders.com/resources">Pine Resources</a>.</div>
Copy file name to clipboardExpand all lines: faq_and_code/README.md
+12-13Lines changed: 12 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,6 @@ If you need to define up and down candles, then make sure one of those definitio
42
42
```
43
43
upCandle = close >= open
44
44
downCandle = close < open
45
-
46
45
```
47
46
48
47
**[Back to top](#table-of-contents)**
@@ -196,9 +195,9 @@ The PineCoders [Backtesting-Trading Engine](https://www.tradingview.com/script/d
196
195
197
196
### Can my strategy generate orders through TV-supported brokers?
198
197
No. The brokers can only be used for manual trading. Currently, the only way to automate trading using TradingView is to:
199
-
- Create an indicator (a.k.a. *study*) from your strategy,
200
-
- Insert `alertcondition()` calls in your indicator using your buy/sell conditions,
201
-
- Create separate Buy and Sell alerts from TV Web,
198
+
- Create an indicator (a.k.a. *study*) from your strategy.
199
+
- Insert `alertcondition()` calls in your indicator using your buy/sell conditions.
200
+
- Create separate Buy and Sell alerts from TV Web.
202
201
- Link those alerts to a third-party app/bot which will relay orders to exchanges or brokers. See the [Automation](http://pinecoders.com/resources#automation) section of our Resources document.
203
202
204
203
**[Back to top](#table-of-contents)**
@@ -238,12 +237,12 @@ When you need to create multiple alerts you can repeat the method above for ever
238
237
When more than one condition can trigger a single alert, you will most probably need to have visual cues for each condition so that when users bring up a chart on which an alert triggered they can figure out which condition caused the alert to trigger. This is a method that allows users of your script to customize the alert to their needs.
239
238
240
239
When TradingView creates an alert, it saves a snapshot of the environment that will enable the alert to run on the servers. The elements saved with an alert are:
241
-
- Current symbol,
242
-
- Current time frame,
243
-
- State of the script's *Inputs* selections,
244
-
- Current version of the script. Subsequent updates to the script’s code will not affect the alerts created with prior versions.
240
+
- Current symbol
241
+
- Current time frame
242
+
- State of the script's *Inputs* selections
243
+
- Current version of the script. Subsequent updates to the script’s code will not affect the alerts created with prior versions
245
244
246
-
> Note that while alert condition code will compile in strategy scripts, they are only functional in studies.
245
+
> Note that while alert condition code will compile in strategy scripts, alerts are only functional in studies.
247
246
248
247
### I have a custom script that generates alerts. How do I run it on many symbols?
249
248
You need to create a separate alert for each symbol. There is currently no way to create an alert for all the symbols in a watchlist or for the Screener.
@@ -254,8 +253,8 @@ If one of the generic indicators supplied with the Screener suits your needs and
254
253
The string may vary conditionally, but it must be of type *const string*, which implies it **must be known at compile time**.
255
254
256
255
This requirement entails that neither the condition used to build the string nor values used to calculate the string itself can depend on:
257
-
- Variables that are only known with the current chart or interval information such as `syminfo.ticker` or `timeframe.period`;
258
-
- Calculations with results that can only be determined at runtime, e.g.,: `close > open`, `rsi(14)`, etc.;
256
+
- Variables that are only known with the current chart or interval information such as `syminfo.ticker` or `timeframe.period`.
257
+
- Calculations with results that can only be determined at runtime, e.g.,: `close > open`, `rsi(14)`, etc.
259
258
- Calculations with results known at compile time, but of a type that cannot be cast to *const string*, such as `tostring()`.
260
259
261
260
The first step when you are in doubt as to what can be used as an argument to a built-in function such as [`alertcondition()`](https://www.tradingview.com/pine-script-reference/v4/#fun_alertcondition) is to look up the Reference Manual:
@@ -269,8 +268,8 @@ The next step is to consult the automatic type casting rules diagram in the User
269
268

270
269
271
270
The diagram shows you where the *const string* type is situated in the casting rules, which allows you to determine:
272
-
- The types that will be allowed because they are above *const string*, meaning they can be cast to a *const string*;
273
-
- The types that will **not** be allowed because they are below *const string*, meaning they **cannot** be cast to a *const string*;
271
+
- The types that will be allowed because they are above *const string*, meaning they can be cast to a *const string*.
272
+
- The types that will **not** be allowed because they are below *const string*, meaning they **cannot** be cast to a *const string*.
274
273
275
274
This code shows examples that work and don't work:
Don't use the term *annotation*, as it most probably will be phased out. We use *function* for everything that was called an annotation, except for `study()` and `strategy()`, for which we use the term *declaration statement*.
5
7
6
-
## Realtime
8
+
###Realtime
7
9
Use *realtime* rather than *real time* or *real-time*.
8
10
9
-
## Script
11
+
###Script
10
12
*Script* is useful when referring to both *indicators* and *strategies*.
11
13
12
-
## Study vs Indicator
14
+
###Study vs Indicator
13
15
Use *indicator* whenever you can, except when referring to the `study()` declaration statement itself.
14
16
15
17
Example:
16
18
> The first line of an indicator should be the `study()` declaration statement.
17
19
18
20
Note than *indicator* is understood to include only *studies*. Pine strategies should be referred to as *strategies*—not *indicators*.
19
21
22
+
## Style
23
+
24
+
### Bulleted or enumerated lists punctuation
25
+
Capitalize the first word of each element.
26
+
27
+
List elements use no ending punctuation when they are not a sentence. This also applies to the last element in the list.<br>
28
+
Use an ending period on all list elements when they are sentences, or when the majority is.
29
+
30
+
### Capitalization of titles
31
+
We follow the TradingView standard of capitalizing only the **first word** of titles.
0 commit comments