<p>For each period:</p>

<blockquote>
  <p>The <strong>opening price</strong> is the price of the first trade that occurs within the period.<br>
  The <strong>closing price</strong> is the price of the last trade that occurs within period.</p>
</blockquote>

<p>Note that the last trade in the 1st period is not equal to the first trade in the 2nd period.<br>
Since these trades are different, their prices can and usually are different. </p>

<p>In general the market price near the bid/ask spread can move around without having actual trades occur. The data feed is based on trades that occur within some period. This means there can be gaps between periods. Here is a video that covers the difference between the last price and the market price: <a href="https://youtu.be/0EmI7vwhAiQ" rel="nofollow noreferrer">Maket price vs Last price</a></p>

CC BY-SA 3.0
2017-10-29T01:39:57.777Z
2017-10-29T01:39:57.777Z
deeplizard
<p>I'm pulling tickers from Poloniex using <a href="https://github.com/s4w3d0ff/python-poloniex" rel="nofollow noreferrer">this</a> python API wrapper, with intervals of 1800 seconds.</p>

<p>I get back dictionaries that look like this (here I show two consecutive ones for 'BTC_XRP'):</p>

<pre><code>{'close': '4.402e-5',
'date': 1491163200,
'high': '4.89e-5',
'low': '4.333e-5',
'open': '4.849e-5',
'quoteVolume': '51355222.751243',
'volume': '2370.18161649',
'weightedAverage': '4.615e-5'}

{'close': '4.38e-5',
'date': 1491165000,
'high': '4.6e-5',
'low': '3.888e-5',
'open': '4.492e-5',
'quoteVolume': '92451720.795809',
'volume': '3902.07294323',
'weightedAverage': '4.22e-5'}
</code></pre>

<p>Why is the opening price of the second one not equal to the closing price of the first one? Isn't a period ending when the next one begins?</p>

<exchange-rate><ticker>
confusion about open/close values on 1800 seconds periods
Ziofil
# confusion about open/close values on 1800 seconds periods

(Asked by: username_0 on 2017-10-28)

I'm pulling tickers from Poloniex using [this](https://github.com/s4w3d0ff/python-poloniex) python API wrapper, with intervals of 1800 seconds.

I get back dictionaries that look like this (here I show two consecutive ones for 'BTC\_XRP'):

```
{'close': '4.402e-5',
'date': 1491163200,
'high': '4.89e-5',
'low': '4.333e-5',
'open': '4.849e-5',
'quoteVolume': '51355222.751243',
'volume': '2370.18161649',
'weightedAverage': '4.615e-5'}

{'close': '4.38e-5',
'date': 1491165000,
'high': '4.6e-5',
'low': '3.888e-5',
'open': '4.492e-5',
'quoteVolume': '92451720.795809',
'volume': '3902.07294323',
'weightedAverage': '4.22e-5'}

```

Why is the opening price of the second one not equal to the closing price of the first one? Isn't a period ending when the next one begins?

**Tags:** exchange-rate, ticker


---

## 1 answers

### Answer by username_1 on 2017-10-29. Score: 1 | Accepted answer

For each period:

> The **opening price** is the price of the first trade that occurs within the period.  
> The **closing price** is the price of the last trade that occurs within period.

Note that the last trade in the 1st period is not equal to the first trade in the 2nd period.  
Since these trades are different, their prices can and usually are different.

In general the market price near the bid/ask spread can move around without having actual trades occur. The data feed is based on trades that occur within some period. This means there can be gaps between periods. Here is a video that covers the difference between the last price and the market price: [Maket price vs Last price](https://youtu.be/0EmI7vwhAiQ)


---

