Forex Portal API
Project description
Forex Portal Python API
Installation
$ python3 -m pip install forexportal-api
Docs
Initialize the object first
from forexportal import ForexPortalAPI
forex = ForexPortalAPI()
Class methods
forex.getQuoteInfo(quote)
This method returns information about the quote, for example EURUSD
, AAPL
, #Bitcoin
, eth.
>>> forex.getQuoteInfo('EURUSD')
Quote(symbol='EURUSD', description='Euro vs US Dollar', digits=4, ask=1.0165, bid=1.0162, change=-0.0001, minmax={'min': 1.0147, 'max': 1.0255}, change24h=-0.0035, position={'sell': 48.84, 'buy': 51.16}, timestamp=1659099955, change24h_percent=-0.34, rate_open={'previous_close': 1.0193, 'open': 1.0192, 'change': -0.003, 'change_percent': -0.3}, rate_24h={'previous_close': 1.0207, 'open': 1.0207, 'change': -0.0045, 'change_percent': -0.44}, rate_7d={'previous_close': 1.0221, 'open': 1.0222, 'change': -0.006, 'change_percent': -0.59}, rate_30d={'previous_close': 1.0523, 'open': 1.0522, 'change': -0.036, 'change_percent': -3.54}, minmax_52w={'min': 0.9953, 'max': 1.1909}, minmax_7d={'min': 1.0097, 'max': 1.0258}, about='EURUSD is a currency pair that is traded with a relatively low spread and reflects the correlation between the euro and the US dollar. The euro is the base currency in the pair while the US dollar is the quoted one. Quotes of the currency pair show how many dollars are needed to buy 1 euro.')
forex.getQuoteHLOC(quote)
This method returns the HLOC indicator of the specified quote
>>> forex.getQuoteHLOC('EURUSD', limit = 5)
[Tick(open=1.0222, high=1.0231, close=1.0203, low=1.0186, date=1659085200), Tick(open=1.0204, high=1.0245, close=1.0243, low=1.0198, date=1659088800), Tick(open=1.0241, high=1.0241, close=1.0208, low=1.0206, date=1659092400), Tick(open=1.0211, high=1.0211, close=1.0178, low=1.0175, date=1659096000), Tick(open=1.0177, high=1.0178, close=1.0161, low=1.0147, date=1659099600)]
forex.getQuoteSignals(quote)
Returns quote signals
>>> forex.getQuoteSignals('EURUSD', limit = 5)
[Signal(comment='Candles: Harami', pair='EURUSD', cmd='Buy Stop', trading_system='Auto', price=1.0125, sl=1.01028, tp=1.02893, period='H1', author=False, timestamp=1658869264, cmd_id=4, trading_system_id=3, pair_description='Euro vs US Dollar'), Signal(comment='Candles: Stick sandwich', pair='EURUSD', cmd='Buy Stop', trading_system='Auto', price=1.013, sl=1.01028, tp=1.02943, period='H1', author=False, timestamp=1658865611, cmd_id=4, trading_system_id=3, pair_description='Euro vs US Dollar'), Signal(comment='Harmonic: Gartly', pair='EURUSD', cmd='Sell Stop', trading_system='Auto', price=1.0171, sl=1.0278, tp=1.0079, period='H1', author=False, timestamp=1658736000, cmd_id=5, trading_system_id=3, pair_description='Euro vs US Dollar'), Signal(comment='Levels: Trend channel', pair='EURUSD', cmd='Sell Stop', trading_system='Auto', price=1.01838, sl=1.02936, tp=1.0074, period='H1', author=False, timestamp=1658493067, cmd_id=5, trading_system_id=3, pair_description='Euro vs US Dollar'), Signal(comment='Waves: Impulse', pair='EURUSD', cmd='Buy Stop', trading_system='Auto', price=1.0278, sl=1.0109, tp=1.04335, period='H1', author=False, timestamp=1658376038, cmd_id=4, trading_system_id=3, pair_description='Euro vs US Dollar')]
forex.subscribeQuote(quote)
Tracks changes in the quotation rate in real time
for tick in forex.subscribeQuote('EURUSD'):
print(tick)
SubTick(digits=4, ask=1.0158, bid=1.0155, change=-0.0001, symbol='EURUSD', lasttime=1659112284)...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
forexportal-api-0.2.tar.gz
(3.8 kB
view details)
File details
Details for the file forexportal-api-0.2.tar.gz
.
File metadata
- Download URL: forexportal-api-0.2.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0380e1b0bd3d840b06cf2a8621a7e8b91ac74a955cf3914962d529eb5ea165e |
|
MD5 | 2cf1e25b891b57d605474c3e553e87cb |
|
BLAKE2b-256 | bc0b662ff7797fda13e289842a30469e15cbd4543157aaa525ae6fafc6e026e6 |