You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Forum on trading, automated trading systems and testing trading strategies
And what, did you cut out Python from MT5?
MetaQuotes , 2023.02.20 17:36
MetaTrader 5.0.44 has been released with support for Python 3.11
You can update like this:
Hello traders,
I'm trying to get the SYMBOL_INDUSTRY_NAME and SYMBOL_SECTOR_NAME of a symbol from the python api.
But when using the symbol_info() function, thoses values are not returned, when it's stated in the doc that they should be returned:
symbol_info
Get data on the specified financial instrument.
symbol_info(
symbol // financial instrument name
)
symbol
[in] Financial instrument name. Required unnamed parameter.
Return Value
Return info in the form of a named tuple structure (namedtuple). Return None in case of an error. The info on the error can be obtained using last_error().
Note
The function returns all data that can be obtained using SymbolInfoInteger, SymbolInfoDouble and SymbolInfoString in one call.
When using MLQ5 code it's working just fine:
Print(SymbolInfoString(_Symbol, SYMBOL_DESCRIPTION)); --> 2023.03.11 10:50:08.695 symbol_infoTST (AAPL.US,D1) APPLE INC
Print(SymbolInfoString(_Symbol, SYMBOL_SECTOR_NAME)); --> 2023.03.11 10:50:08.695 symbol_infoTST (AAPL.US,D1) Technology
Print(SymbolInfoString(_Symbol, SYMBOL_INDUSTRY_NAME)); --> 2023.03.11 10:50:08.695 symbol_infoTST (AAPL.US,D1) Consumer Electronics
Here is the python code I'm using:
Returning:
SymbolInfo(custom=False, chart_mode=0, select=True, visible=True, session_deals=0, session_buy_orders=0, session_sell_orders=0, volume=0, volumehigh=0, volumelow=0, time=1678485585, digits=3, spread=20, spread_float=True, ticks_bookdepth=0, trade_calc_mode=2, trade_mode=4, start_time=0, expiration_time=0, trade_stops_level=10, trade_freeze_level=0, trade_exemode=2, swap_mode=5, swap_rollover3days=5, margin_hedged_use_leg=False, expiration_mode=15, filling_mode=3, order_mode=127, order_gtc_mode=0, option_mode=0, option_right=0, bid=148.58, bidhigh=150.94, bidlow=147.6, ask=148.6, askhigh=150.95, asklow=147.62, last=0.0, lasthigh=0.0, lastlow=0.0, volume_real=0.0, volumehigh_real=0.0, volumelow_real=0.0, option_strike=0.0, point=0.001, trade_tick_value=0.001, trade_tick_value_profit=0.001, trade_tick_value_loss=0.001, trade_tick_size=0.001, trade_contract_size=1.0, trade_accrued_interest=0.0, trade_face_value=0.0, trade_liquidity_rate=0.0, volume_min=0.01, volume_max=1600.0, volume_step=0.01, volume_limit=3800.0, swap_long=-6.326, swap_short=2.326, margin_initial=0.0, margin_maintenance=0.0, session_volume=0.0, session_turnover=0.0, session_interest=0.0, session_buy_orders_volume=0.0, session_sell_orders_volume=0.0, session_open=150.15, session_close=150.52, session_aw=0.0, session_price_settlement=0.0, session_price_limit_min=0.0, session_price_limit_max=0.0, margin_hedged=0.2, price_change=-1.2889, price_volatility=0.0, price_theoretical=0.0, price_greeks_delta=0.0, price_greeks_theta=0.0, price_greeks_gamma=0.0, price_greeks_vega=0.0, price_greeks_rho=0.0, price_greeks_omega=0.0, price_sensitivity=0.0, basis='', category='', currency_base='USD', currency_profit='USD', currency_margin='USD', bank='', description='APPLE INC', exchange='', formula='', isin='US0378331005', name='AAPL.US', page='', path='CFD USA Shares\\CFD USA Shares 5\\AAPL.US')
Is this a limitation of the metatrader python api, or I am missing something else ?
Hello traders,
I'm trying to get the SYMBOL_INDUSTRY_NAME and SYMBOL_SECTOR_NAME of a symbol from the python api.
But when using the symbol_info() function, thoses values are not returned, when it's stated in the doc that they should be returned:
When using MLQ5 code it's working just fine:
Print(SymbolInfoString(_Symbol, SYMBOL_DESCRIPTION)); --> 2023.03.11 10:50:08.695 symbol_infoTST (AAPL.US,D1) APPLE INC
Print(SymbolInfoString(_Symbol, SYMBOL_SECTOR_NAME)); --> 2023.03.11 10:50:08.695 symbol_infoTST (AAPL.US,D1) Technology
Print(SymbolInfoString(_Symbol, SYMBOL_INDUSTRY_NAME)); --> 2023.03.11 10:50:08.695 symbol_infoTST (AAPL.US,D1) Consumer Electronics
Here is the python code I'm using:
Returning:
Is this a limitation of the metatrader python api, or I am missing something else ?
It's a small bug, these symbol's properties were added after python API was created. I advised a MQ developer about it.
Test version of MQL5 Copilot in beta 3647 -
https://www.mql5.com/ru/forum/444170
Forum on trading, automated trading systems and testing trading strategies
Machine learning in trading: theory, models, practice and algorithmic trading
Renat Fatkhullin , 2023.03.24 01:43
A preview version of viewing ONNX models is open right in the editor:
MetaTrader 5 Platform update build 3800: Book or Cancel orders, AI coding assistant, and enhanced ONNX support
Depending on the file type, the string "MQL5 language", "Python language" or "C++ language" is automatically inserted at each prompt beginning. Thus, the neural network will provide the result in the required language.
Copilot is currently free and is already enabled in the editor. There are several options available under Tools \ Options \ Copilot:
Python Fundamentals - video lessons on the fundamentals of the Python programming language