Skip to content

Fixed bulleted lists re writing guidelines #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Aug 4, 2019
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<div align="center"><font size="+1"><strong>Want to learn proper Pine coding style?<br></strong></font> Read our <a href="http://www.pinecoders.com/coding_conventions">Pine Coding Conventions</a>.</div>

<div align="center"><font size="+1"><strong>Looking for Pine-related tools and resources?<br></strong></font> Read our <a href="http://www.pinecoders.com/resources">Pine Resources</a>.</div>
<div align="center"><font size="+1"><strong>Looking for Pine-related tools or resources?<br></strong></font> Use our list of <a href="http://www.pinecoders.com/resources">Pine Resources</a>.</div>

---

Expand Down
25 changes: 12 additions & 13 deletions faq_and_code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ If you need to define up and down candles, then make sure one of those definitio
```
upCandle = close >= open
downCandle = close < open

```

**[Back to top](#table-of-contents)**
Expand Down Expand Up @@ -196,9 +195,9 @@ The PineCoders [Backtesting-Trading Engine](https://www.tradingview.com/script/d

### Can my strategy generate orders through TV-supported brokers?
No. The brokers can only be used for manual trading. Currently, the only way to automate trading using TradingView is to:
- Create an indicator (a.k.a. *study*) from your strategy,
- Insert `alertcondition()` calls in your indicator using your buy/sell conditions,
- Create separate Buy and Sell alerts from TV Web,
- Create an indicator (a.k.a. *study*) from your strategy.
- Insert `alertcondition()` calls in your indicator using your buy/sell conditions.
- Create separate Buy and Sell alerts from TV Web.
- 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.

**[Back to top](#table-of-contents)**
Expand Down Expand Up @@ -238,12 +237,12 @@ When you need to create multiple alerts you can repeat the method above for ever
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.

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:
- Current symbol,
- Current time frame,
- State of the script's *Inputs* selections,
- Current version of the script. Subsequent updates to the script’s code will not affect the alerts created with prior versions.
- Current symbol
- Current time frame
- State of the script's *Inputs* selections
- Current version of the script. Subsequent updates to the script’s code will not affect the alerts created with prior versions

> Note that while alert condition code will compile in strategy scripts, they are only functional in studies.
> Note that while alert condition code will compile in strategy scripts, alerts are only functional in studies.

### I have a custom script that generates alerts. How do I run it on many symbols?
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.
Expand All @@ -254,8 +253,8 @@ If one of the generic indicators supplied with the Screener suits your needs and
The string may vary conditionally, but it must be of type *const string*, which implies it **must be known at compile time**.

This requirement entails that neither the condition used to build the string nor values used to calculate the string itself can depend on:
- Variables that are only known with the current chart or interval information such as `syminfo.ticker` or `timeframe.period`;
- Calculations with results that can only be determined at runtime, e.g.,: `close > open`, `rsi(14)`, etc.;
- Variables that are only known with the current chart or interval information such as `syminfo.ticker` or `timeframe.period`.
- Calculations with results that can only be determined at runtime, e.g.,: `close > open`, `rsi(14)`, etc.
- Calculations with results known at compile time, but of a type that cannot be cast to *const string*, such as `tostring()`.

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:
Expand All @@ -269,8 +268,8 @@ The next step is to consult the automatic type casting rules diagram in the User
![.](TypeCasting_ConstString.png "Type Casting")

The diagram shows you where the *const string* type is situated in the casting rules, which allows you to determine:
- The types that will be allowed because they are above *const string*, meaning they can be cast to a *const string*;
- The types that will **not** be allowed because they are below *const string*, meaning they **cannot** be cast to a *const string*;
- The types that will be allowed because they are above *const string*, meaning they can be cast to a *const string*.
- The types that will **not** be allowed because they are below *const string*, meaning they **cannot** be cast to a *const string*.

This code shows examples that work and don't work:
```
Expand Down
20 changes: 16 additions & 4 deletions writing_guidelines.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
# Writing guidelines for PineCoders Web content

## Annotations
## Terminology

### Annotations
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*.

## Realtime
### Realtime
Use *realtime* rather than *real time* or *real-time*.

## Script
### Script
*Script* is useful when referring to both *indicators* and *strategies*.

## Study vs Indicator
### Study vs Indicator
Use *indicator* whenever you can, except when referring to the `study()` declaration statement itself.

Example:
> The first line of an indicator should be the `study()` declaration statement.

Note than *indicator* is understood to include only *studies*. Pine strategies should be referred to as *strategies*—not *indicators*.

## Style

### Bulleted or enumerated lists punctuation
Capitalize the first word of each element.

List elements use no ending punctuation when they are not a sentence. This also applies to the last element in the list.<br>
Use an ending period on all list elements when they are sentences, or when the majority is.

### Capitalization of titles
We follow the TradingView standard of capitalizing only the **first word** of titles.