Bitcoin Forum
November 03, 2024, 07:42:54 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 ... 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 [105] 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 »
  Print  
Author Topic: Yet another analyst :)  (Read 269568 times)
molecular
Donator
Legendary
*
Offline Offline

Activity: 2772
Merit: 1019



View Profile
May 07, 2013, 09:42:06 PM
Last edit: May 07, 2013, 09:57:50 PM by molecular
 #2081

question for one and all.

based upon history of btc vs $USD (@gox) ... what is the largest swing in the following periods:

1 minute
5 minutes
15 minutes
30 minutes
60 minutes
120 minutes
180 minutes

anyone?



You can gather this info yourself by looking at the historical charts. Don't be lazy. Tongue

I think you're underestimating the problem.

EDIT: a naive sql query on the trades table runs way too long. I could do it another way though, would take roughly 2 hours. So if the info is important enough for you, Viceroy, you can try to bribe me Wink

PGP key molecular F9B70769 fingerprint 9CDD C0D3 20F8 279F 6BE0  3F39 FC49 2362 F9B7 0769
notme
Legendary
*
Offline Offline

Activity: 1904
Merit: 1002


View Profile
May 07, 2013, 10:18:05 PM
 #2082

question for one and all.

based upon history of btc vs $USD (@gox) ... what is the largest swing in the following periods:

1 minute
5 minutes
15 minutes
30 minutes
60 minutes
120 minutes
180 minutes

anyone?



You can gather this info yourself by looking at the historical charts. Don't be lazy. Tongue

I think you're underestimating the problem.

EDIT: a naive sql query on the trades table runs way too long. I could do it another way though, would take roughly 2 hours. So if the info is important enough for you, Viceroy, you can try to bribe me Wink


Just use the CSV and Ruby or Perl to parse the data.

https://www.bitcoin.org/bitcoin.pdf
While no idea is perfect, some ideas are useful.
molecular
Donator
Legendary
*
Offline Offline

Activity: 2772
Merit: 1019



View Profile
May 08, 2013, 05:51:26 PM
 #2083

question for one and all.

based upon history of btc vs $USD (@gox) ... what is the largest swing in the following periods:

1 minute
5 minutes
15 minutes
30 minutes
60 minutes
120 minutes
180 minutes

anyone?



You can gather this info yourself by looking at the historical charts. Don't be lazy. Tongue

I think you're underestimating the problem.

EDIT: a naive sql query on the trades table runs way too long. I could do it another way though, would take roughly 2 hours. So if the info is important enough for you, Viceroy, you can try to bribe me Wink


Just use the CSV and Ruby or Perl to parse the data.

Accessing and working with the data is not the problem: Unless he meant "timeframes" instead of "periods" you need to consider every possible pair of trades with times of execution no further than 60 seconds apart (could also be 2 seconds). You can't just use min/max (or even average or last price) values of some "minute bins" and look for the highest delta between 2 consecutive ones. The way I'd implement it would be to have a sliding window cointaining all trades from time t to time t-60s tracking min/max of the trades and then move it through the data (by moving t to the next trade and adding it to the list of the trades in the frame, then checking wether the oldest trade in the frame has time < t-60s and remove it if that's the case. keep trades in the frame in a list ordered by price so "max" can be adjusted in case the removed trade is the one with the highest price). Difference between "max" and "min" is the your swings size. Record the IDs of the 2 trades responsible for the largest swing and the solution is found.

If that sounds too complicated to you, please share your simpler solution.

PGP key molecular F9B70769 fingerprint 9CDD C0D3 20F8 279F 6BE0  3F39 FC49 2362 F9B7 0769
ThickAsThieves
Hero Member
*****
Offline Offline

Activity: 518
Merit: 500



View Profile
May 08, 2013, 05:55:59 PM
 #2084

question for one and all.

based upon history of btc vs $USD (@gox) ... what is the largest swing in the following periods:

1 minute
5 minutes
15 minutes
30 minutes
60 minutes
120 minutes
180 minutes

anyone?



You can gather this info yourself by looking at the historical charts. Don't be lazy. Tongue

I think you're underestimating the problem.

EDIT: a naive sql query on the trades table runs way too long. I could do it another way though, would take roughly 2 hours. So if the info is important enough for you, Viceroy, you can try to bribe me Wink


Just use the CSV and Ruby or Perl to parse the data.

Accessing and working with the data is not the problem: Unless he meant "timeframes" instead of "periods" you need to consider every possible pair of trades with times of execution no further than 60 seconds apart (could also be 2 seconds). You can't just use min/max (or even average or last price) values of some "minute bins" and look for the highest delta between 2 consecutive ones. The way I'd implement it would be to have a sliding window cointaining all trades from time t to time t-60s tracking min/max of the trades and then move it through the data (by moving t to the next trade and adding it to the list of the trades in the frame, then checking wether the oldest trade in the frame has time < t-60s and remove it if that's the case. keep trades in the frame in a list ordered by price so "max" can be adjusted in case the removed trade is the one with the highest price).

If that sounds too complicated to you, please share your simpler solution.


I have a easier solution: Don't waste your time trying to parse useless info.   Cool
molecular
Donator
Legendary
*
Offline Offline

Activity: 2772
Merit: 1019



View Profile
May 08, 2013, 05:57:17 PM
 #2085

I have a easier solution: Don't waste your time trying to parse useless info.   Cool

That's why I said: I don't want to do it for myself, so I will do it for money or not do it at all Wink

PGP key molecular F9B70769 fingerprint 9CDD C0D3 20F8 279F 6BE0  3F39 FC49 2362 F9B7 0769
BrightAnarchist
Donator
Legendary
*
Offline Offline

Activity: 853
Merit: 1000



View Profile
May 09, 2013, 12:29:13 PM
 #2086

Just hit 90% bulls on the spx futures - insane!

Last time we hit this number we fell 20% in the following weeks/months

Positive seasonals are over as of today. This market could strech more of course, but it's hitting historically overbought levels on multiple time frames

Thinking all the banks and hedge funds are just blowing up this bubble on momentum plays with newly minted fed money. What a sham. It will end very badly, the big question is when
myself
Legendary
*
Offline Offline

Activity: 938
Merit: 1000


chaos is fun...…damental :)


View Profile
May 09, 2013, 02:07:27 PM
 #2087

Just hit 90% bulls on the spx futures - insane!
major changes in market happen whit everybody and their mom are on one side of the market    2/3 weeks more up and then turn around  ?

Los desesperados publican que lo inventó el rey que rabió, porque todo son en el rabias y mas rabias, disgustos y mas disgustos, pezares y mas pezares; si el que compra algunas partidas vé que baxan, rabia de haver comprado; si suben, rabia de que no compró mas; si compra, suben, vende, gana y buelan aun á mas alto precio del que ha vendido; rabia de que vendió por menor precio: si no compra ni vende y ván subiendo, rabia de que haviendo tenido impulsos de comprar, no llegó á lograr los impulsos; si van baxando, rabia de que, haviendo tenido amagos de vender, no se resolvió á gozar los amagos; si le dan algun consejo y acierta, rabia de que no se lo dieron antes; si yerra, rabia de que se lo dieron; con que todo son inquietudes, todo arrepentimientos, tododelirios, luchando siempre lo insufrible con lo feliz, lo indomito con lo tranquilo y lo rabioso con lo deleytable.
waveaddict
Hero Member
*****
Offline Offline

Activity: 532
Merit: 500



View Profile
May 09, 2013, 04:30:34 PM
 #2088

Just hit 90% bulls on the spx futures - insane!

Last time we hit this number we fell 20% in the following weeks/months

Positive seasonals are over as of today. This market could strech more of course, but it's hitting historically overbought levels on multiple time frames

Thinking all the banks and hedge funds are just blowing up this bubble on momentum plays with newly minted fed money. What a sham. It will end very badly, the big question is when

Yep. Another fun fact is that the cash:equity ratio held by mutual and hedge funds is nearing or at record low levels (similar to the 2000 & 2007 top). All those who believe we're in a continuation of a major bull market on par with the 90s are forgetting or dismissing the fact that cash levels were at extreme highs during this time period.

Basically, unless "this time is different" (and it rarely is), a lot of people are about to lose a lot on money once this supposedly unstoppable stock market rally turns.

Viceroy
Hero Member
*****
Offline Offline

Activity: 924
Merit: 501


View Profile
May 09, 2013, 05:17:02 PM
 #2089

I have a easier solution: Don't waste your time trying to parse useless info.   Cool

That's why I said: I don't want to do it for myself, so I will do it for money or not do it at all Wink



I meant timeframe = period.  I used the term period to mean a repeating distance between two timeframes.  I'm basically trying to figure out the slope so I can determine how "dangerous" it is to hold onto bitcoin over a period of time.

merchant foo sells food and wants bitcoins as payment to increase his customers but foo doesn't believe in bitcoins and so he wants his bitcoins converted to fiat immediately.  So how long can it be bitcoin before it becomes dangerous?

I looked at april's crash and I think it dropped from 250 to 105 at mt gox vs USD in about 6 hours, but I do not have the tools to determine the actual slope.  I can't imagine the crash is all that useful as a guide anyway. I'd think I want to throw out that data-point as an outlier.  I'm kind of trying to determine a "most likely decline in one hour vs USD" scenario so I can figure out how to mitigate that risk.

But I am not a mathematician, only a lowly coder.  I am not a day trader and do not understand your terminology.
notme
Legendary
*
Offline Offline

Activity: 1904
Merit: 1002


View Profile
May 09, 2013, 08:51:25 PM
 #2090

question for one and all.

based upon history of btc vs $USD (@gox) ... what is the largest swing in the following periods:

1 minute
5 minutes
15 minutes
30 minutes
60 minutes
120 minutes
180 minutes

anyone?



You can gather this info yourself by looking at the historical charts. Don't be lazy. Tongue

I think you're underestimating the problem.

EDIT: a naive sql query on the trades table runs way too long. I could do it another way though, would take roughly 2 hours. So if the info is important enough for you, Viceroy, you can try to bribe me Wink


Just use the CSV and Ruby or Perl to parse the data.

Accessing and working with the data is not the problem: Unless he meant "timeframes" instead of "periods" you need to consider every possible pair of trades with times of execution no further than 60 seconds apart (could also be 2 seconds). You can't just use min/max (or even average or last price) values of some "minute bins" and look for the highest delta between 2 consecutive ones. The way I'd implement it would be to have a sliding window cointaining all trades from time t to time t-60s tracking min/max of the trades and then move it through the data (by moving t to the next trade and adding it to the list of the trades in the frame, then checking wether the oldest trade in the frame has time < t-60s and remove it if that's the case. keep trades in the frame in a list ordered by price so "max" can be adjusted in case the removed trade is the one with the highest price). Difference between "max" and "min" is the your swings size. Record the IDs of the 2 trades responsible for the largest swing and the solution is found.

If that sounds too complicated to you, please share your simpler solution.



For each time period N in seconds do:
create 2 priority queues, one min, one max, with the following modifications:
  modify push to keep track of the last timestamp
  modify peek to pop off and throw away that are more N seconds old until it finds a trade within the timeframe or empties itself

set max_spread = 0
then, for each trade:
  push the trade to both queues
  spread = peek(max_queue) - peek(min_queue)
  max_spread = spread if spread > max_spread


Not sure if it is simpler, but at least to me it is easier to prove to myself it works as well as easy to recognize that for any number of seconds N you can calculate the max spread in worst case O(n^2*lg(n)) time, where n is the number of trades.


  

https://www.bitcoin.org/bitcoin.pdf
While no idea is perfect, some ideas are useful.
molecular
Donator
Legendary
*
Offline Offline

Activity: 2772
Merit: 1019



View Profile
May 09, 2013, 09:49:48 PM
 #2091

For each time period N in seconds do:
create 2 priority queues, one min, one max, with the following modifications:
  modify push to keep track of the last timestamp
  modify peek to pop off and throw away that are more N seconds old until it finds a trade within the timeframe or empties itself

set max_spread = 0
then, for each trade:
  push the trade to both queues
  spread = peek(max_queue) - peek(min_queue)
  max_spread = spread if spread > max_spread


Not sure if it is simpler, but at least to me it is easier to prove to myself it works as well as easy to recognize that for any number of seconds N you can calculate the max spread in worst case O(n^2*lg(n)) time, where n is the number of trades.

I don't quite understand... does your modified peek() find the max price? Is that queue sorted by price or time or is it a stack (since you're using push/pop/peek terminology it sounds like a stack to me)? In any case, it seems you'd have to search through the whole set of trades in the queue... either to find the max price or to find trades that have become too old for the time period.

Is that why you get the n^2? n^2 is a lot, there's ~ 4 million trades. Maybe it could be n*m where n is number of trades and m average number of trades in time period? I think by using adequate data structures (queue sorted by trade time + another one sorted by price?) one could get it down to n*lg(m). Not sure where your lg(n) is coming from, leads me to believe your queue is indeed sorted by price.

PGP key molecular F9B70769 fingerprint 9CDD C0D3 20F8 279F 6BE0  3F39 FC49 2362 F9B7 0769
notme
Legendary
*
Offline Offline

Activity: 1904
Merit: 1002


View Profile
May 09, 2013, 10:03:48 PM
 #2092

For each time period N in seconds do:
create 2 priority queues, one min, one max, with the following modifications:
  modify push to keep track of the last timestamp
  modify peek to pop off and throw away that are more N seconds old until it finds a trade within the timeframe or empties itself

set max_spread = 0
then, for each trade:
  push the trade to both queues
  spread = peek(max_queue) - peek(min_queue)
  max_spread = spread if spread > max_spread


Not sure if it is simpler, but at least to me it is easier to prove to myself it works as well as easy to recognize that for any number of seconds N you can calculate the max spread in worst case O(n^2*lg(n)) time, where n is the number of trades.

I don't quite understand... does your modified peek() find the max price? Is that queue sorted by price or time or is it a stack (since you're using push/pop/peek terminology it sounds like a stack to me)? In any case, it seems you'd have to search through the whole set of trades in the queue... either to find the max price or to find trades that have become too old for the time period.

Is that why you get the n^2? n^2 is a lot, there's ~ 4 million trades. Maybe it could be n*m where n is number of trades and m average number of trades in time period? I think by using adequate data structures (queue sorted by trade time + another one sorted by price?) one could get it down to n*lg(m). Not sure where your lg(n) is coming from, leads me to believe your queue is indeed sorted by price.


Queue is sorted on price.  Time is just an attribute of the trades the queue holds.  Pop and peek are acceptable terminology for a priority queue according to the wikipedia page, but it seems I should at least use insert for push.

It won't be anywhere near n^2 * lg (n)... that's just a lazy upper bound.  Insert will be lg(m) and modified peek will somewhere between O(1) in the best case and O(m*lg(m)) in the worst case (pop/dequeue is a lg(m) operation (in the worst case) in most queue implementations, which is where the lg came from).  Here m is the number of trades currently in the queue.  Whenever the market trends, you will have to throw a lot of old trades out of one of the queues, but in the other queue they will just get buried until the price revisits that level (so if it doesn't we never have to examine them again).

https://www.bitcoin.org/bitcoin.pdf
While no idea is perfect, some ideas are useful.
notme
Legendary
*
Offline Offline

Activity: 1904
Merit: 1002


View Profile
May 09, 2013, 10:52:25 PM
Last edit: May 10, 2013, 02:05:53 AM by notme
 #2093

https://gist.github.com/yrral86/5551203

This code calculates maximum price variation within the time specified.
Assumes trades.csv is in the following format
timestamp1,price
timestamp2,price
etc.

additional fields will not cause problems, but if the timestamp and price are not in those positions, you can adjust the indices on the line with Trade.new
the seconds variable will set the maximum time span to examine

(it turns out the library I chose uses the terminology push, pop and next)

https://www.bitcoin.org/bitcoin.pdf
While no idea is perfect, some ideas are useful.
Frozenlock
Sr. Member
****
Offline Offline

Activity: 434
Merit: 250



View Profile
May 10, 2013, 01:12:03 AM
 #2094

On track [preferred]


On track


One of daily candidates


Another, more brutal candidate



Lucif, any updates on your analysis?
molecular
Donator
Legendary
*
Offline Offline

Activity: 2772
Merit: 1019



View Profile
May 10, 2013, 06:41:06 AM
Last edit: May 10, 2013, 05:33:13 PM by molecular
 #2095

https://gist.github.com/yrral86/5551203

This code calculates maximum price variation within the time specified.
Assumes trades.csv is in the following format
timestamp1,price
timestamp2,price
etc.

additional fields will not cause problems, but if the timestamp and price are not in those positions, you can adjust the indices on the line with Trade.new
the seconds variable will set the maximum time span to examine

(it turns out the library I chose uses the terminology push, pop and next)

cool stuff, bro!

just ran the thing on 4 million trades (only have data up to 2013-04-18 unfortunately... probs with bitcoincharts api):

Code:
Maximum spread within 60 seconds: $63.7778 t0=2013-04-10T18:59:50+00:00 t1=2013-04-10T19:00:45+00:00
Maximum spread within 3600 seconds: $93.0 t0=2013-04-10T18:34:50+00:00 t1=2013-04-10T19:24:22+00:00

It took quite some time and about 1.3 GB of ram:

Code:
real    13m10.698s (for 60 second period)
real    57m24.590s (for 3600 second period)

thanks for the code, notme and thanks to all others for enduring our offtopic stuff here.

EDIT: added data for 3600s period

PGP key molecular F9B70769 fingerprint 9CDD C0D3 20F8 279F 6BE0  3F39 FC49 2362 F9B7 0769
notme
Legendary
*
Offline Offline

Activity: 1904
Merit: 1002


View Profile
May 10, 2013, 07:42:08 AM
 #2096

https://gist.github.com/yrral86/5551203

This code calculates maximum price variation within the time specified.
Assumes trades.csv is in the following format
timestamp1,price
timestamp2,price
etc.

additional fields will not cause problems, but if the timestamp and price are not in those positions, you can adjust the indices on the line with Trade.new
the seconds variable will set the maximum time span to examine

(it turns out the library I chose uses the terminology push, pop and next)

cool stuff, bro!

just ran the thing on 4 million trades (only have data up to 2013-04-18 unfortunately... probs with bitcoincharts api):

Code:
Maximum spread within 60 seconds: $63.7778 t0=2013-04-10T18:59:50+00:00 t1=2013-04-10T19:00:45+00:00

It took quite some time and about 1.3 GB of ram:

Code:
real    13m10.698s
user    12m27.654s
sys     0m40.017s

thanks for the code, notme and thanks to all others for enduring our offtopic stuff here.


Cool... I didn't have the data to run it on.  That's a pretty big range for 55 seconds Tongue

https://www.bitcoin.org/bitcoin.pdf
While no idea is perfect, some ideas are useful.
firstcrypto
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
May 10, 2013, 12:00:28 PM
 #2097

did the large triangle just break upwards?
Rampion
Legendary
*
Offline Offline

Activity: 1148
Merit: 1018


View Profile
May 10, 2013, 12:01:10 PM
 #2098

did the large triangle just break upwards?

OMG, BUY BUY BUY!!

(sorry, I couldn't help myself)

lebing
Legendary
*
Offline Offline

Activity: 1288
Merit: 1000

Enabling the maximal migration


View Profile
May 10, 2013, 12:58:46 PM
 #2099


Lucif, any updates on your analysis?

Here's an update...


Taken from a cam I secretly posted in Lucif's room. I took the liberty of editing the film to capture the moment as the triangle broke upwards:




Bro, do you even blockchain?
-E Voorhees
ThickAsThieves
Hero Member
*****
Offline Offline

Activity: 518
Merit: 500



View Profile
May 10, 2013, 01:13:55 PM
 #2100

Taken from a cam I secretly posted in Lucif's room. I took the liberty of editing the film to capture the moment as the triangle broke upwards:


LOL
Pages: « 1 ... 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 [105] 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 »
  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!