You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 1, 2024. It is now read-only.
new price feed: last trade price (closes#333) (#334)
* 1 - add lastPrice to api.Ticker and to CCXT
* 2 - add last price to tickerAPI of krakenExchange.go
* 3 - log lastTradePrice in exchangeFeed.go
* 4 - add support for "last" price modifier in exchangeFeed and sample config files
* 5 - add note in LIST_OF_HACKS for backward compatibility in defaulting to "mid" price in exchangeFeed
* 6 - move validation check on modifier input to exchange factory method
* 7 - rename GetMidPrice() -> GetFeedPairPrice() in FeedPair
Copy file name to clipboardExpand all lines: examples/configs/trader/sample_buysell.cfg
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -19,11 +19,11 @@ DATA_TYPE_A="exchange"
19
19
# this code can be retrieved from the exchange's website or from the ccxt manual for ccxt-based exchanges.
20
20
# modifier:
21
21
# this is a modifier that can be included only for feed type "exchange".
22
-
# a modifier allows you to fetch the "mid" price, "ask" price, or "bid" price for now.
23
-
# if left unspecified then this is defaulted to "mid" for backwards compatibility (until v2.0 is released)
22
+
# a modifier allows you to fetch the "mid" price, "ask" price, "bid" price, or "last" price for now.
23
+
# if left unspecified then this is defaulted to "mid" for backwards compatibility (until v2.0 is released) (LOH-2)
24
24
# uncomment below to use binance, poloniex, or bittrex as your price feed. You will need to set up CCXT to use this, see the "Using CCXT" section in the README for details.
25
25
# be careful about using USD vs. USDT since some exchanges support only one, or both, or in some cases neither.
26
-
#DATA_FEED_A_URL="ccxt-kraken/XLM/USD/mid"
26
+
#DATA_FEED_A_URL="ccxt-kraken/XLM/USD/last"
27
27
#DATA_FEED_A_URL="ccxt-binance/XLM/USDT/ask"
28
28
#DATA_FEED_A_URL="ccxt-poloniex/XLM/USDT/bid"
29
29
# bittrex does not have an XLM/USD market so this config lists XLM/BTC instead; you should NOT use this when trying to price an asset based on the XLM/USD price (unless you know what you are doing).
Copy file name to clipboardExpand all lines: examples/configs/trader/sample_sell.cfg
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -21,11 +21,11 @@ DATA_TYPE_A="exchange"
21
21
# this code can be retrieved from the exchange's website or from the ccxt manual for ccxt-based exchanges.
22
22
# modifier:
23
23
# this is a modifier that can be included only for feed type "exchange".
24
-
# a modifier allows you to fetch the "mid" price, "ask" price, or "bid" price for now.
25
-
# if left unspecified then this is defaulted to "mid" for backwards compatibility (until v2.0 is released)
24
+
# a modifier allows you to fetch the "mid" price, "ask" price, "bid" price, or "last" price for now.
25
+
# if left unspecified then this is defaulted to "mid" for backwards compatibility (until v2.0 is released) (LOH-2)
26
26
# uncomment below to use binance, poloniex, or bittrex as your price feed. You will need to set up CCXT to use this, see the "Using CCXT" section in the README for details.
27
27
# be careful about using USD vs. USDT since some exchanges support only one, or both, or in some cases neither.
28
-
#DATA_FEED_A_URL="ccxt-kraken/XLM/USD/mid"
28
+
#DATA_FEED_A_URL="ccxt-kraken/XLM/USD/last"
29
29
#DATA_FEED_A_URL="ccxt-binance/XLM/USDT/ask"
30
30
#DATA_FEED_A_URL="ccxt-poloniex/XLM/USDT/bid"
31
31
# bittrex does not have an XLM/USD market so this config lists XLM/BTC instead; you should NOT use this when trying to price an asset based on the XLM/USD price (unless you know what you are doing).
assert.True(t, ticker.BidPrice.AsFloat() <ticker.AskPrice.AsFloat(), fmt.Sprintf("bid price (%s) should be less than ask price (%s)", ticker.BidPrice.AsString(), ticker.AskPrice.AsString()))
if!assert.True(t, ticker.BidPrice.AsFloat() <ticker.AskPrice.AsFloat(), fmt.Sprintf("bid price (%s) should be less than ask price (%s)", ticker.BidPrice.AsString(), ticker.AskPrice.AsString())) {
0 commit comments