I need to extract certain data from external json into mysql. After decoding my json looks like this: Array ( [key1] => 1 [key2] => [key3] => Array (  => Array ( [Id] => x1 [TimeStamp] =>y1 [Quantity] => z1 [Price] => q1 [Total] => w1 [FillType] =>e1 [OrderType] =>r1 )  => Array ( [Id] =>x2 [TimeStamp] => y2 [Quantity] => z2 [Price] => q2 [Total] => w1 [FillType] => e1 [OrderType] => r2 )  => Array .....and so on. I need to upload to my mysql three keys/values for each transaction, that is 'ID', 'TimeStamp', and 'Total'. I want to update that database every 5 minutes so that only data with newer 'TimeStamp' are added. Then I need to check the combined value of 'total' for the last 15 minutes, last (30-15) minutes, and value of 'total' for last 120 minutes divided by 8.
Hello, I send you some more info about what I need.
I want to make sure we understand eachother.
I download data from external server. It comes as json.
After after get_file_contents and json_decode true i receive nested arrays, which after print_r looks this way:
Array ( [success] => 1 [message] => [result] => Array (  => Array ( [Id] => 111745476 [TimeStamp] => 2017-12-05T19:50:58.19 [Quantity] => 1.2 [Price] => 0.00857242 [Total] => 0.0102869 [FillType] => PARTIAL_FILL [OrderType] => SELL )  => Array ( [Id] => 111745427 [TimeStamp] => 2017-12-05T19:50:56.113 [Quantity] => 0.10285719 [Price] => 0.0085831 [Total] => 0.00088283 [FillType] => FILL [OrderType] => BUY )  => Array ( [Id] => 111745412 [TimeStamp] => 2017-12-05T19:50:54.787 [Quantity] => 0.41726852 [Price] => 0.00858651 [Total] => 0.00358288 [FillType] => FILL [OrderType] => SELL )  => Array ( [Id] => 111745187 [TimeStamp] => 2017-12-05T19:50:46.83 [Quantity] => 19.13589601 [Price] => 0.00859 [Total] => 0.16437734 [FillType] => FILL [OrderType] => BUY )
and that is just a tiny part. I want to extract values from Id, TimeStamp and Total, where , ,  are transactions on crypto exchange.
Then I want these to be transfered to mysql database every 5 minutes, but only with transactions that are newer (have bigger Id), so the old stay and new are added.
I use Bittrex exchange. You can see API here: https://bittrex.com/home/api
I will be using getmarkethistory with parameters
code looks like this
$uri='https://bittrex.com/api/v1.1/public/getmarkethistory?market=BTC-LTC'; that is Bitcoin-Litecoin market history
$ch = curl_init($uri);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('apisign:'.$sign));
$execResult = curl_exec($ch);
$obj = json_decode($execResult);
I will provide with apikey and apisecret if we come to an agreement.
My mysql database is called Bittrex. In that database there are tables with cryptocoin pairs. That is btc-ltc table, btc-xxx table, btc-yyy table and so on.
Each table has colums named Id, TableStamp and Total, where the ids, timestamps and totals for each transaction encoded in json should go.
I will need help with what type, atributes, and defaults should every column have (as for know Id is int, TimeStamp is timestamp NULL, and Total is decimal)
Next step is to summarize 'Total' values for last 15 minutes (let's call it A), for period between 30 and 15 minutes ago(let's call it B),
and average value for 15minute periods in last 2,5hours (2,5hours ago to 0.5 hours ago) - that's C
The new part I did not write about before is that if B is at least 3 times bigger than C, and A is bigger that B I want php to echo timestamp when 'if' was true and name of the pair of currencies.
For example: 2017-12-05T19:50:44.99 BTC-LTC. I want it stay on www page until restart (or just forever if its easier to do)
Additionally I want that to be sent to my FBmessenger.
I want to track more than 100 pairs of currencies. I don't need you to prepare all of those. I just need one pair, than I will copy/paste the code and
make necessary changes in json url, function name (is it a good idea to make a function called for example BTC-LTC? This way the function name could be echoed in messages?), table names and so on.
And last part: if it's possible I would like four values that is A (15 minutes), B (period between 30 and 15 minutes ago), C (2,5hours ago to 0.5 hours ago), and D(at lease X times bigger)
to be editable like a constant, same one for every function, so somewhere at the top of the php code.
I will run it on localhost.
Please feel free to ask questions.
39 pekerja bebas membida secara purata $132 untuk pekerjaan ini
hi i read the requirement just one thing can you explain the 5 minute scenario which you are saying in the description Relevant Skills and Experience wordpress php Proposed Milestones $155 USD - final