Bitcoin Forum
April 19, 2024, 04:36:47 PM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Candles in Tradingview  (Read 130 times)
Wiss (OP)
Jr. Member
*
Offline Offline

Activity: 68
Merit: 1


View Profile
June 27, 2018, 05:12:05 PM
 #1

Hello,

I am trying to calculate based on ticks data of bittrex candles. I would like to have the same candles like in trading view:

What is the correct calculation?

I get all buys and sells during a minute.

a.) do I have to consider all price update?
b.) or just Sell or Buys and build on that my candles?

If b.) which should I take in order to have the same pattern like in tradingview - Sell or Buy?

thx
1713544607
Hero Member
*
Offline Offline

Posts: 1713544607

View Profile Personal Message (Offline)

Ignore
1713544607
Reply with quote  #2

1713544607
Report to moderator
1713544607
Hero Member
*
Offline Offline

Posts: 1713544607

View Profile Personal Message (Offline)

Ignore
1713544607
Reply with quote  #2

1713544607
Report to moderator
1713544607
Hero Member
*
Offline Offline

Posts: 1713544607

View Profile Personal Message (Offline)

Ignore
1713544607
Reply with quote  #2

1713544607
Report to moderator
In order to get the maximum amount of activity points possible, you just need to post once per day on average. Skipping days is OK as long as you maintain the average.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713544607
Hero Member
*
Offline Offline

Posts: 1713544607

View Profile Personal Message (Offline)

Ignore
1713544607
Reply with quote  #2

1713544607
Report to moderator
1713544607
Hero Member
*
Offline Offline

Posts: 1713544607

View Profile Personal Message (Offline)

Ignore
1713544607
Reply with quote  #2

1713544607
Report to moderator
1713544607
Hero Member
*
Offline Offline

Posts: 1713544607

View Profile Personal Message (Offline)

Ignore
1713544607
Reply with quote  #2

1713544607
Report to moderator
coinalyze
Member
**
Offline Offline

Activity: 73
Merit: 11


View Profile WWW
June 28, 2018, 08:45:20 AM
 #2

take first buy/sell trade price, this is candle open price
take last buy/sell trade price, this is candle close price
take maximum of trades prices, this is candle high price
take minimum  of trades prices, this is candle low price


Hope that is what you need.
Wiss (OP)
Jr. Member
*
Offline Offline

Activity: 68
Merit: 1


View Profile
June 28, 2018, 08:47:31 AM
 #3

really?

What I understoood is that it is a BID Candle or a ASK Candle (so I have to consider that trade type) or?

What I read is that the candle is a BID candle so I have to consider just the SELLS or?
coinalyze
Member
**
Offline Offline

Activity: 73
Merit: 11


View Profile WWW
June 28, 2018, 08:54:29 AM
 #4

what candlesticks exactly you want to build, can you show on tradingview?
Wiss (OP)
Jr. Member
*
Offline Offline

Activity: 68
Merit: 1


View Profile
June 28, 2018, 09:03:54 AM
 #5

any candle on tradingview --> if you open for example ETH/BTC on the exchange bittrex the last candle on 09:00 (exchange time) is the following:

Open: 0.07137
High:  0.0714
Low:   0.7096
Close: 0.7096

how is this calclulated?

I get the data stream from bittrex and see all the filled sells and buys but I don't know which data I have to consider in order to have the correct candles like in tradingview.
coinalyze
Member
**
Offline Offline

Activity: 73
Merit: 11


View Profile WWW
June 28, 2018, 09:14:39 AM
 #6

You need a stream of trades, like this one https://www.bitstamp.net/s/examples/live_trades.html , see here documentation https://www.bitstamp.net/websocket/ . Record all trades during 1 minute and calculate open, high, low and close prices as i described above
Wiss (OP)
Jr. Member
*
Offline Offline

Activity: 68
Merit: 1


View Profile
June 28, 2018, 09:17:21 AM
 #7

ok thx I have the stream and all data but I can not build exact the same candle like in trading view - I have problems of close and open

take first buy/sell trade price, this is candle open price
take last buy/sell trade price, this is candle close price
take maximum of trades prices, this is candle high price
take minimum  of trades prices, this is candle low price

So you mean that I dont have to consider if it is a sell or buy right? I will consider all datas....
coinalyze
Member
**
Offline Offline

Activity: 73
Merit: 11


View Profile WWW
June 28, 2018, 09:23:51 AM
 #8

yes, trade type(buy or sell) doesn't matter, take all trades
Wiss (OP)
Jr. Member
*
Offline Offline

Activity: 68
Merit: 1


View Profile
June 28, 2018, 06:01:37 PM
 #9

ok thx i checked my implementation once more and I implemented it exactly like you mentioned but there is still a problem - i get the following data:

28-06 19:54:41 FINE    Added Streamdata: Time : 19:54:40.00487 Price: 0.07151 Name: BTC-ETH Nounce:26450 Ordertype: BUY Filltype: null
28-06 19:54:41 FINE    Added Streamdata: Time : 19:54:40.00487 Price: 0.07150999 Name: BTC-ETH Nounce:26450 Ordertype: BUY Filltype: null
28-06 19:54:41 FINE    Added Streamdata: Time : 19:54:40.00487 Price: 0.07150999 Name: BTC-ETH Nounce:26450 Ordertype: BUY Filltype: null
28-06 19:54:41 FINE    Added Streamdata: Time : 19:54:40.00487 Price: 0.07131646 Name: BTC-ETH Nounce:26450 Ordertype: BUY Filltype: null


in this special case the milliseconds are exactly the same - tradingview ignores the last 3 updates and shows an price at 0.07151 in my view the price should be 0.07131646 (and this causes my problem at the open and close)

any ideas on this?
Zadicar
Legendary
*
Offline Offline

Activity: 1316
Merit: 1018


View Profile
June 28, 2018, 06:10:48 PM
 #10

any candle on tradingview --> if you open for example ETH/BTC on the exchange bittrex the last candle on 09:00 (exchange time) is the following:

Open: 0.07137
High:  0.0714
Low:   0.7096
Close: 0.7096

how is this calclulated?

I get the data stream from bittrex and see all the filled sells and buys but I don't know which data I have to consider in order to have the correct candles like in tradingview.
No calculation since those are numbers where the price did hit up a on particular timeframe. If you do see a candle each do have labels or indicators on where price do open and it do close and its recent high and lowest low. Letsa say a 1 minute candle, beyond those moving price its being record up until it opens a new candle on next minute and so on.


So you mean that I dont have to consider if it is a sell or buy right? I will consider all datas....
It doesnt matter or not really necessary at all which these datas are sufficient or generally would help out of your buy or sell orders.
tambok
Sr. Member
****
Offline Offline

Activity: 812
Merit: 260


View Profile
June 28, 2018, 07:08:06 PM
 #11

Maybe it may 70% accurate but just don't rely to it especially if you are unsure, there are still ways for you to read the market so don't just stick with one method it is okay too to be involved with group of people that knows trading so you can share ideas with each other.
coinalyze
Member
**
Offline Offline

Activity: 73
Merit: 11


View Profile WWW
June 28, 2018, 07:21:13 PM
 #12

ok thx i checked my implementation once more and I implemented it exactly like you mentioned but there is still a problem - i get the following data:

28-06 19:54:41 FINE    Added Streamdata: Time : 19:54:40.00487 Price: 0.07151 Name: BTC-ETH Nounce:26450 Ordertype: BUY Filltype: null
28-06 19:54:41 FINE    Added Streamdata: Time : 19:54:40.00487 Price: 0.07150999 Name: BTC-ETH Nounce:26450 Ordertype: BUY Filltype: null
28-06 19:54:41 FINE    Added Streamdata: Time : 19:54:40.00487 Price: 0.07150999 Name: BTC-ETH Nounce:26450 Ordertype: BUY Filltype: null
28-06 19:54:41 FINE    Added Streamdata: Time : 19:54:40.00487 Price: 0.07131646 Name: BTC-ETH Nounce:26450 Ordertype: BUY Filltype: null


in this special case the milliseconds are exactly the same - tradingview ignores the last 3 updates and shows an price at 0.07151 in my view the price should be 0.07131646 (and this causes my problem at the open and close)

any ideas on this?

Can you show a few more trades , the trades before first one? "28-06 19:54:41 FINE    Added Streamdata: Time : 19:54:40.00487 Price: 0.07151 Name: BTC-ETH Nounce:26450 Ordertype: BUY Filltype: null"
Wiss (OP)
Jr. Member
*
Offline Offline

Activity: 68
Merit: 1


View Profile
June 28, 2018, 08:52:56 PM
 #13

Here an other example (ETH/BTC on bittrex exchange time +2h):

28-06 22:47:03 FINE    Added Streamdata: Time : 22:47:02.00000267 Price: 0.07155973 Name: BTC-ETH Nounce:35404 Ordertype: BUY Filltype: null
28-06 22:47:05 FINE    Added Streamdata: Time : 22:47:05.00000080 Price: 0.07155974 Name: BTC-ETH Nounce:35406 Ordertype: BUY Filltype: null
28-06 22:47:10 FINE    Added Streamdata: Time : 22:47:10.00000110 Price: 0.07155976 Name: BTC-ETH Nounce:35411 Ordertype: BUY Filltype: null
28-06 22:47:11 FINE    Added Streamdata: Time : 22:47:11.00000110 Price: 0.07155976 Name: BTC-ETH Nounce:35412 Ordertype: BUY Filltype: null
28-06 22:47:19 FINE    Added Streamdata: Time : 22:47:18.00000830 Price: 0.07155973 Name: BTC-ETH Nounce:35419 Ordertype: SELL Filltype: null
28-06 22:47:19 FINE    Added Streamdata: Time : 22:47:18.00000830 Price: 0.07155974 Name: BTC-ETH Nounce:35419 Ordertype: SELL Filltype: null
28-06 22:47:22 FINE    Added Streamdata: Time : 22:47:21.00000783 Price: 0.07155976 Name: BTC-ETH Nounce:35421 Ordertype: BUY Filltype: null
28-06 22:47:22 FINE    Added Streamdata: Time : 22:47:21.00000703 Price: 0.07141003 Name: BTC-ETH Nounce:35421 Ordertype: BUY Filltype: null

this is to complete stream of the 1 min candle of 22:47:000 - 22:47.999

Tradingview shows a candle with the following value:
Open -->0.07155973 (correct)
High --> 0.07155976 (correct)
Low --> 0.07141003 (correct)
Close -->0.07155976 (NOT CORRECT)
because there was one additional tick with an price of 0.07141003 so the close must be 0.07141003

the strange thing is that tradingview considers the 0.07141003 as low but not as close!

ivankoh
Full Member
***
Offline Offline

Activity: 1428
Merit: 120


Sugars.zone | DatingFi - Earn for Posting


View Profile
June 28, 2018, 10:12:34 PM
 #14

really?

What I understoood is that it is a BID Candle or a ASK Candle (so I have to consider that trade type) or?

What I read is that the candle is a BID candle so I have to consider just the SELLS or?
Using a technical analysis of candlestick charts on a trading platform is one of the basic knowledge traders need to master in order to invest in this market. I think that if using good tradingview then trader can fully determine the point buy and sell reasonably optimize profits thereby.

rain_road
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
June 28, 2018, 10:54:36 PM
 #15

When looking at the candle in the tradingview software I can predict the market is going up or down to prepare. That is because I know technical analysis. However, I can only predict in a short time.
coinalyze
Member
**
Offline Offline

Activity: 73
Merit: 11


View Profile WWW
June 29, 2018, 12:17:04 PM
 #16

Here an other example (ETH/BTC on bittrex exchange time +2h):

28-06 22:47:03 FINE    Added Streamdata: Time : 22:47:02.00000267 Price: 0.07155973 Name: BTC-ETH Nounce:35404 Ordertype: BUY Filltype: null
28-06 22:47:05 FINE    Added Streamdata: Time : 22:47:05.00000080 Price: 0.07155974 Name: BTC-ETH Nounce:35406 Ordertype: BUY Filltype: null
28-06 22:47:10 FINE    Added Streamdata: Time : 22:47:10.00000110 Price: 0.07155976 Name: BTC-ETH Nounce:35411 Ordertype: BUY Filltype: null
28-06 22:47:11 FINE    Added Streamdata: Time : 22:47:11.00000110 Price: 0.07155976 Name: BTC-ETH Nounce:35412 Ordertype: BUY Filltype: null
28-06 22:47:19 FINE    Added Streamdata: Time : 22:47:18.00000830 Price: 0.07155973 Name: BTC-ETH Nounce:35419 Ordertype: SELL Filltype: null
28-06 22:47:19 FINE    Added Streamdata: Time : 22:47:18.00000830 Price: 0.07155974 Name: BTC-ETH Nounce:35419 Ordertype: SELL Filltype: null
28-06 22:47:22 FINE    Added Streamdata: Time : 22:47:21.00000783 Price: 0.07155976 Name: BTC-ETH Nounce:35421 Ordertype: BUY Filltype: null
28-06 22:47:22 FINE    Added Streamdata: Time : 22:47:21.00000703 Price: 0.07141003 Name: BTC-ETH Nounce:35421 Ordertype: BUY Filltype: null

this is to complete stream of the 1 min candle of 22:47:000 - 22:47.999

Tradingview shows a candle with the following value:
Open -->0.07155973 (correct)
High --> 0.07155976 (correct)
Low --> 0.07141003 (correct)
Close -->0.07155976 (NOT CORRECT)
because there was one additional tick with an price of 0.07141003 so the close must be 0.07141003

the strange thing is that tradingview considers the 0.07141003 as low but not as close!



You should order the trades by time. Look at last two trades. Sometimes trades does not comes in order...
Wiss (OP)
Jr. Member
*
Offline Offline

Activity: 68
Merit: 1


View Profile
July 01, 2018, 03:51:55 PM
 #17

yes thank I have seen that now too!

another question:

In order to sort these data -> I have to consider the timestamp for the order --> but I get a couple of data in the same millisecond:

28:15 FINE    Added : BTC-ETH Time : 17:28:15.437 Price: 0.07071695 Nounce:17117
01-07 17:28:15 FINE    Added : BTC-ETH Time : 17:28:15.437 Price: 0.07071695 Nounce:17117
01-07 17:28:15 FINE    Added : BTC-ETH Time : 17:28:15.437 Price: 0.07071695 Nounce:17117
01-07 17:28:15 FINE    Added : BTC-ETH Time : 17:28:15.437 Price: 0.07071695 Nounce:17117
01-07 17:28:15 FINE    Added : BTC-ETH Time : 17:28:15.437 Price: 0.07071695 Nounce:17117
01-07 17:28:15 FINE    Added : BTC-ETH Time : 17:28:15.437 Price: 0.07071695 Nounce:17117
01-07 17:28:15 FINE    Added : BTC-ETH Time : 17:28:15.437 Price: 0.07071695 Nounce:17117
01-07 17:28:15 FINE    Added : BTC-ETH Time : 17:28:15.437 Price: 0.07071695 Nounce:17117
01-07 17:28:15 FINE    Added : BTC-ETH Time : 17:28:15.437 Price: 0.07071695 Nounce:17117
01-07 17:28:15 FINE    Added : BTC-ETH Time : 17:28:15.437 Price: 0.07071695 Nounce:17117
01-07 17:28:15 FINE    Added : BTC-ETH Time : 17:28:15.437 Price: 0.07071695 Nounce:17117
01-07 17:28:15 FINE    Added : BTC-ETH Time : 17:28:15.420 Price: 0.07071699 Nounce:17117
01-07 17:28:15 FINE    Added : BTC-ETH Time : 17:28:15.420 Price: 0.0707174 Nounce:17117


which data set should I take when this happens?
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!