![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
do you have the full code i see if i can be of help
So, from mt.position_get() I would like to extract price_open, after that I would say if x in y and x != price_open.....do the request.
The idea is to avoid the same price. If you buy, let say, on 5$ (x=ask price, 5$), then the price_open==5$.So, when the first time x==5$ I send the request, but the second time x==5$ then the price_open of the first trade ==5$, then if x==price_open there will be no trade(request), and like this I avoid that python buys at a same price each time of a loop.
If x==6$, and price_openof the first trade==5$. The new request will be sent. Because if x in y and x != price_open then the request will be sent.
Print the size of 'positions':
Print the size of 'positions':
Thank you.
Ok, what now? python still dont recognize position_open.
Thank you.
Ok, what now? python still dont recognize position_open.
What is 'position_open'? Please provide a link to the MQL5 documentation.
What is 'position_open'? Please provide a link to the MQL5 documentation.
First I m sorry it is not position_open but price_open.
I opened a position on MT5. Now i write mt5_positions_get and print(mt5_positions_get), and I get this (TradePosition(ticket=1100036586, time=1654202682, time_msc=1654202682900, time_update=1654202682, time_update_msc=1654202682900, type=0, magic=0, identifier=1100036586, reason=0, volume=0.01, price_open=1.07477, sl=0.0, tp=0.0, price_current=1.07457, swap=0.0, profit=-0.2, symbol='EURUSD', comment='', external_id=''),)
From that I need price_open=1.07477
Ty for patience!