Skip to content

Commit 21e79aa

Browse files
committed
Tweak variable names, update documentation
1 parent a206ed1 commit 21e79aa

File tree

3 files changed

+67
-6
lines changed

3 files changed

+67
-6
lines changed

docs/content/release_notes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Release Notes
22

3+
## 5.26.0
4+
**New Features**
5+
6+
* Added `previousPriceChange` and `previousPriceChangePercent` attributes to `Quote` object.
7+
38
## 5.25.1
49
**Bug Fixes**
510

docs/content/sdk/lib-marketstate.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,10 @@
554554
* [.previousPrice](#QuotepreviousPrice)
555555
* [.time](#Quotetime)
556556
* [.timeUtc](#QuotetimeUtc)
557+
* [.priceChange](#QuotepriceChange)
558+
* [.priceChangePercent](#QuotepriceChangePercent)
559+
* [.previousPriceChange](#QuotepreviousPriceChange)
560+
* [.previousPriceChangePercent](#QuotepreviousPriceChangePercent)
557561

558562

559563
* * *
@@ -959,6 +963,58 @@
959963
| timeUtc | <code>Date</code> \| <code>null</code> | <p>A timezone-aware version of [time](#quotetime). This property will only have a value when both (a) the exchange timezone is known; and (b) the client computer's timezone is known.</p> |
960964

961965

966+
* * *
967+
968+
### quote.priceChange :id=quotepricechange
969+
**Kind**: instance property of [<code>Quote</code>](#Quote)
970+
**Access**: public
971+
**Read only**: true
972+
**Properties**
973+
974+
| Type |
975+
| --- |
976+
| <code>Number</code> \| <code>null</code> |
977+
978+
979+
* * *
980+
981+
### quote.priceChangePercent :id=quotepricechangepercent
982+
**Kind**: instance property of [<code>Quote</code>](#Quote)
983+
**Access**: public
984+
**Read only**: true
985+
**Properties**
986+
987+
| Type |
988+
| --- |
989+
| <code>Number</code> \| <code>null</code> |
990+
991+
992+
* * *
993+
994+
### quote.previousPriceChange :id=quotepreviouspricechange
995+
**Kind**: instance property of [<code>Quote</code>](#Quote)
996+
**Access**: public
997+
**Read only**: true
998+
**Properties**
999+
1000+
| Type |
1001+
| --- |
1002+
| <code>Number</code> \| <code>null</code> |
1003+
1004+
1005+
* * *
1006+
1007+
### quote.previousPriceChangePercent :id=quotepreviouspricechangepercent
1008+
**Kind**: instance property of [<code>Quote</code>](#Quote)
1009+
**Access**: public
1010+
**Read only**: true
1011+
**Properties**
1012+
1013+
| Type |
1014+
| --- |
1015+
| <code>Number</code> \| <code>null</code> |
1016+
1017+
9621018
* * *
9631019

9641020
## Schema :id=schema

lib/marketState/MarketState.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,19 +281,19 @@ module.exports = (() => {
281281
const previousPrice = quote.days[0].lastPrice;
282282
const previousPreviousPrice = quote.days[0].previousPrice;
283283

284-
let priceChange = null;
285-
let priceChangePercent = null;
284+
let previousPriceChange = null;
285+
let previousPriceChangePercent = null;
286286

287287
if (is.number(previousPrice) && is.number(previousPreviousPrice)) {
288-
priceChange = previousPrice - previousPreviousPrice;
288+
previousPriceChange = previousPrice - previousPreviousPrice;
289289

290290
if (previousPreviousPrice !== 0) {
291-
priceChangePercent = priceChange / Math.abs(previousPreviousPrice);
291+
previousPriceChangePercent = previousPriceChange / Math.abs(previousPreviousPrice);
292292
}
293293
}
294294

295-
quote.previousPriceChange = priceChange;
296-
quote.previousPriceChangePercent = priceChangePercent;
295+
quote.previousPriceChange = previousPriceChange;
296+
quote.previousPriceChangePercent = previousPriceChangePercent;
297297
};
298298

299299
const _processMessage = (message, options) => {

0 commit comments

Comments
 (0)