create account

TradingView Experiments ROUND #1 : SYNTHETIC OHLC CHART INDICATOR by cryptomental

View this thread on: hive.blogpeakd.comecency.com
· @cryptomental · (edited)
$0.33
TradingView Experiments ROUND #1 : SYNTHETIC OHLC CHART INDICATOR
I asked last week if anyone would be interested in new TradingView indicators. There were quite a few upvotes when we compare my posts but noone commented. Perhaps these were all bots but so what, I want to learn it and will proceed anyway.

![](https://ipfs.pics/ipfs/QmSXk1LzDNG9vfrCptfnQnrZH1mKQzEf4e4yR5WgakPwZz)

I decided that this series will **NOT** be dead serious. It will be just my road through TradingView.

This time I will not try to bore you to sleep...

![](http://www.thecostumer.com/images/Product/medium/22828.jpg)

and I will immediately fast forward to:

# Creating a SYNTHETIC OHLC CHART

I logged in to TradingView and saw that they provide **STEEMBTC** and **SBDBTC** from Poloniex but there is NO STEEMBTC like the one in the internal STEEM marked.

## How do you create one if it is not available???

Well If you attended elementary school, math in this case is simple:

![](https://ipfs.pics/ipfs/QmfC5W2C2TUkkNdCFnTebwxL7Zk7v6ztYTqKVhhAhPyh3d)


## How to create a candlestick chart for that?

A recipe in 3 steps:

1. Take STEEM/BTC and SBD/BTC timeseries from Poloniex
2. Divide OHLC (Open, High, Low, Close) values as described above.
3. Draw the new thing with nice colors.

## Show me the code

```
//@version=2
// Syntetic STEEM/SBD candlestick chart based STEEM/BTC and SBD/STB from Poloniex
// by @cryptomental
// https://steemit.com/@cryptomental

study(title = "SteemSBD indicator", shorttitle = "SteemSBD indicator")


steembtc_o = security("POLONIEX:STEEMBTC", period, open)
sbdbtc_o = security("POLONIEX:SBDBTC", period, open)

steembtc_h = security("POLONIEX:STEEMBTC", period, high)
sbdbtc_h = security("POLONIEX:SBDBTC", period, high)

steembtc_l = security("POLONIEX:STEEMBTC", period, low)
sbdbtc_l = security("POLONIEX:SBDBTC", period, low)

steembtc_c = security("POLONIEX:STEEMBTC", period, close)
sbdbtc_c = security("POLONIEX:SBDBTC", period, close)

steemsbd_o = steembtc_o / sbdbtc_o
steemsbd_h = steembtc_h / sbdbtc_h
steemsbd_l = steembtc_l / sbdbtc_l
steemsbd_c = steembtc_c / sbdbtc_c

palette = steemsbd_c >= steemsbd_o ? lime : red

plotcandle(steemsbd_o, steemsbd_h, steemsbd_l, steemsbd_c, color=palette)

```

## And that's how it looks like


![](https://ipfs.pics/ipfs/QmRwCBh9CUBzVRvJdn8iC7c9fD4aw1ygdmmNcZmLjyHBa3)

Last values should be similar to internal STEEM market but based on Poloniex trades.

## Compared to the internal STEEM market:

![](https://ipfs.pics/ipfs/QmQf4s2nQfTGm41VaSSUmLPC23Gqbv9XXF9TTFJe4J7SJ8)

# What else?

I published the indicator as a public one, you can insert it to your charts now.

I did not consider Volume at all this time, but will probably use this indicator later on as a base for another indicators.

That's it for today... uff I thought the post will take me 30 min and it took 1.5h with all the screeshots ;-)

---
I forgot to mention that I borrowed the Old Fashion Night Gown Adult Costume photo from http://www.thecostumer.com
Lat but not least: *I do not take any responsibility for anyone using it. Use at your own risk.*

**Upvote if you like it!**
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 2 others
properties (23)
authorcryptomental
permlinktradingview-experiments-round-1-synthetic-ohlc-chart-indicator
categorytrading
json_metadata{"tags":["trading","programming","tradingview","money"],"image":["https://ipfs.pics/ipfs/QmSXk1LzDNG9vfrCptfnQnrZH1mKQzEf4e4yR5WgakPwZz","http://www.thecostumer.com/images/Product/medium/22828.jpg","https://ipfs.pics/ipfs/QmfC5W2C2TUkkNdCFnTebwxL7Zk7v6ztYTqKVhhAhPyh3d","https://ipfs.pics/ipfs/QmRwCBh9CUBzVRvJdn8iC7c9fD4aw1ygdmmNcZmLjyHBa3","https://ipfs.pics/ipfs/QmQf4s2nQfTGm41VaSSUmLPC23Gqbv9XXF9TTFJe4J7SJ8"],"links":["http://www.thecostumer.com"]}
created2016-10-11 08:19:33
last_update2016-10-11 08:31:21
depth0
children3
last_payout2016-11-11 09:36:39
cashout_time1969-12-31 23:59:59
total_payout_value0.251 HBD
curator_payout_value0.078 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length3,064
author_reputation6,756,831,217,523
root_title"TradingView Experiments ROUND #1 : SYNTHETIC OHLC CHART INDICATOR"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,502,547
net_rshares2,082,728,007,394
author_curate_reward""
vote details (66)
@cryptomental ·
I forgot to add that with this approach it is possible to create any synthethic OHLC chart, not just STEEMSBD. You can for example create STEEMPOT chart (cool name isn't it ;) to see how STEEM relates to POT (PotCoin) or any other synthetic pair that you need for trading....
👍  
properties (23)
authorcryptomental
permlinkre-cryptomental-tradingview-experiments-round-1-synthetic-ohlc-chart-indicator-20161011t084602264z
categorytrading
json_metadata{"tags":["trading"]}
created2016-10-11 08:46:03
last_update2016-10-11 08:46:03
depth1
children0
last_payout2016-11-11 09:36:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length275
author_reputation6,756,831,217,523
root_title"TradingView Experiments ROUND #1 : SYNTHETIC OHLC CHART INDICATOR"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,502,693
net_rshares55,776,512
author_curate_reward""
vote details (1)
@joewantsfreedom ·
What is the language of the code? 

I'm going away now but thanks to this article I'm gonna look at more of your posts as we might be in the same boat and it's always nice to have a peer doing something similar/same. 

Good luck, mate.
properties (22)
authorjoewantsfreedom
permlinkre-cryptomental-tradingview-experiments-round-1-synthetic-ohlc-chart-indicator-20161011t082803047z
categorytrading
json_metadata{"tags":["trading"]}
created2016-10-11 08:28:03
last_update2016-10-11 08:28:03
depth1
children1
last_payout2016-11-11 09:36:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length235
author_reputation8,280,737,591,335
root_title"TradingView Experiments ROUND #1 : SYNTHETIC OHLC CHART INDICATOR"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,502,591
net_rshares0
@cryptomental · (edited)
Thanks! To answer your question: this is written in Pine Script, a proprietary TradingView.com language for  indicators and strategies.
properties (22)
authorcryptomental
permlinkre-joewantsfreedom-re-cryptomental-tradingview-experiments-round-1-synthetic-ohlc-chart-indicator-20161011t083243109z
categorytrading
json_metadata{"tags":["trading"]}
created2016-10-11 08:32:42
last_update2016-10-11 08:38:48
depth2
children0
last_payout2016-11-11 09:36:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length135
author_reputation6,756,831,217,523
root_title"TradingView Experiments ROUND #1 : SYNTHETIC OHLC CHART INDICATOR"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,502,618
net_rshares0