MetaTrader 5 Python User Group - how to use Python in Metatrader - page 85
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
Strange, but an empty table arrives too. There is no need to open anything in the terminal itself as in Quicksilver to make the unloading work?
Any chart with the desired pair (for ticks).
Can anyone confirm this? Is there any way to get a comment from the broker?
Would you add a description to the Documentation?
Added
I want to organise a virtual trade accounting in python. I need it in order to distinguish the char- teristics of different trading strategies. The broker used is Otkritie. There is no netting. There is a common position for the instrument, Stop and Take of the position is common. I decided to do this: I open a trade by any strategy by market with any volume, without stop and take. Instead, I put a stop and limit order of the same size. I memorize the orders in the table separately. Every certain period of time, I place orders = mt5.orders_get(symbol=symb) and get a list of known ticket orders.ticket.tolist().
Then I go through my trade table and check if a stop or limit order ticket still exists in the list of open orders received. If there is no stop loss, it means that a stop loss has triggered virtually; if there is no limit, it means a take profit. Then I delete entries for this trade from my table and delete the remaining pending order for this trade. And everything works except one - I don't know how to calculate virtual profit on this deal. In the picture you can see the sell stop is set at 141430, but in reality there was a slippage and the open price is 141350. I request the request for a triggered position: deals = mt5.history_orders_get(ticket=246525084) (this ticket has been saved in the system when the order was placed, as in the picture above), but in my reply I see no information about the order place, only information about the order place. The history shows that the sell stop was really executed in the ticket 15215696 and I can ask for the right price in this ticket. But first I need to find the ticket from the trade. How do I match this ticket with the pending order ticket (sell stop)?
order_send and order_check return None. I don't understand where to look. Please tell me what's wrong. Please.
Code
Output
I managed to solve the problem. In request volume,price,sl,tp fields should have float type. It works like this
Colleagues, please advise:
1. How can I pull available trading session intervals by instrument from mt5 in Python and update them periodically?
2. do i expect to see a method in the library to request and change Trailing Stop on open positions?