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
Where is the changelog?
1. Fixed numpy objects auto-deleting issue
2. Fixed Buy/Sell/Close scripts error handling (__init__.py)1. Fixed numpy objects auto-deleting issue
2. Fixed Buy/Sell/Close scripts error handling (__init__.py)Thanks!
One question on the copy_ticks_range output:
The fields volume and volume_real are 0 for all ticks (I have selected COPY_TICKS_ALL). Is it because my broker history (the volume obtained from copy_rates_range correspond with the one in the Metatrader chart)? Also, what is the difference between these two fields?
On the the other hand, I was looking for the meaning of the four different flags that appear in the history without success. Is there any place where can I found such a meaning?
Thanks!
One question on the copy_ticks_range output:
The fields volume and volume_real are 0 for all ticks (I have selected COPY_TICKS_ALL). Is it because my broker history (the volume obtained from copy_rates_range correspond with the one in the Metatrader chart)?
Read the Reference for MqlTick please. These fields are not ticks volume
The Structure for Returning Current Prices (MqlTick)
This is a structure for storing the latest prices of the symbol. It is designed for fast retrieval of the most requested information about current prices.
struct MqlTick
{
datetime time; // Time of the last prices update
double bid; // Current Bid price
double ask; // Current Ask price
double last; // Price of the last deal (Last)
ulong volume; // Volume for the current Last price
long time_msc; // Time of a price last update in milliseconds
uint flags; // Tick flags
double volume_real; // Volume for the current Last price with greater accuracy
};
The variable of the MqlTick type allows obtaining values of Ask, Bid, Last and Volume within a single call of the SymbolInfoTick() function.
The parameters of each tick are filled in regardless of whether there are changes compared to the previous tick. Thus, it is possible to find out a correct price for any moment in the past without the need to search for previous values at the tick history. For example, even if only a Bid price changes during a tick arrival, the structure still contains other parameters as well, including the previous Ask price, volume, etc.
You can analyze the tick flags to find out what data have been changed exactly:
Read the Reference for MqlTick please. These fields are not ticks volume
See also the TICK_FLAG enumeration.Thank you Rashid, I will take a look.
I am finishing to explore the metatrader python doc. It is really useful!
I am able to execute market orders and manage them (modify sl/tp and close them).
Also I am able to put pending orders (buy/sell limit and buy/sell stop orders). However, I don't know how to find them (none of the available functions in the doc: positions_get, history_deals_get or history_order_get, contains such orders).
Is it possible to obtain them with a mt5 function? Or is it not possible yet?
It would be useful, for instance, in order to delete all pending orders quickly...
With ther order number I am able to modify/delete it:
Thanks!
Thank you Rashid, I will take a look.
I am finishing to explore the metatrader python doc. It is really useful!
I am able to execute market orders and manage them (modify sl/tp and close them).
Also I am able to put pending orders (buy/sell limit and buy/sell stop orders). However, I don't know how to find them (none of the available functions in the doc: positions_get, history_deals_get or history_order_get, contains such orders).
Is it possible to obtain them with a mt5 function? Or is it not possible yet?
It would be useful, for instance, in order to delete all pending orders quickly...
With ther order number I am able to modify/delete it:
Thanks!
You have to use orders get. Here is an example using pymt5adapter
Thank you, Nicholi Shen!
hi
in python , I want to check market watch base on one indicator and in this regard I used ' copyrates_range ' , but sometime getting data from one symbol take more time and I don't want to wait and want to ignore that symbol , what can I do ?
thanks
hi
in python , I want to check market watch base on one indicator and in this regard I used ' copyrates_range ' , but sometime getting data from one symbol take more time and I don't want to wait and want to ignore that symbol , what can I do ?
thanks
You can't do much because the terminal blocks when it's downloading rate data from the trade server. Even if you use async, threading, multiprocessing, you still run into the issue of a blocked terminal on subsequent calls. You could spawn multiple processes connected to multiple terminals and use one worker to handle priority fast tasks and another to handle a queue of long running blocking requests.
Forum on trading, automated trading systems and testing trading strategies
MetaTrader 5 Python User Group - how to use Python in Metatrader
Renat Fatkhullin , 07/20/2014 01:19
You can run the python program on charts like regular scripts. They can receive data and trade.
But not in the tester.