CryptoCator

FREEMIUM
By oz | Updated 2 months ago | Financial
Health Check

N/A

Back to All Tutorials (1)

Finding GoldenCross BTC-USDT 1H Candles

What is a Golden Cross?
A Golden Cross is a basic technical indicator that occurs in the market when a short-term moving average (50-bars) of an asset rises above a long-term moving average (200-bars). When traders see a Golden Cross occur, they view this chart pattern as indicative of a strong bull market.

Finding GoldenCross BTC-USDT 1H Candles

Let’s take our 50bar moving average

Required parameters :

  • Exchange
  • Symbol
  • KlineInterval
  • lookbackPeriods

In this scenario, we will take the 50 bar moving average for the BTC-USDT parity from the BINANCE exchange with 1-hour closes.

Here is our magic code :

API Response will look like this

The 2nd parameter we need is the 200 Bars moving average.

curl=curlinit();curlsetoptarray(curl = curl_init(); curl_setopt_array(curl, [
CURLOPT_URL => “https://cryptocator.p.rapidapi.com/EMA?Exchange=BINANCE&Symbol=BTC-USDT&useHeikinCandles=false&KlineInterval=1h&lookbackPeriods=200&resultType=LastCandles”,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_ENCODING => “”,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => “GET”,
CURLOPT_HTTPHEADER => [
“X-RapidAPI-Host: cryptocator.p.rapidapi.com”,
“X-RapidAPI-Key: YOUR_API_KEY”
],
]);
ema200response=curlexec(ema200_response = curl_exec(curl);
err=curlerror(err = curl_error(curl);

API Response will look like this

{
“status”: “success”,
“Exchange”: “BINANCE”,
“Symbol”: “BTC-USDT”,
“Data”: [
{
“Ema”: 16735.14414379673,
“Date”: “2022-12-19T09:00:00Z”
},
{
“Ema”: 16739.000924623833,
“Date”: “2022-12-19T10:00:00Z”
}
]
}

Let’s try to find upcross