
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
Above code of indicator Spread_of_symbols ... I decided to rewrite it to make it work faster.... and the code appeared, see below ... data is not copied ... if you copy data from 1 to 0 in the code, the indicator draws very fast but an out of range error occurs ... what is wrong in the code see below ...?
DH 0 Trades 19:31:10 '***': cancel order #3694237 buy stop 0.36 AUDJPY.m at 95.679
FI 0 Trades 19:31:10 '***': cancel order #3694239 buy limit 0.36 AUDJPY.m at 93.876
FP 0 Trades 19:31:10 '***': cancel order #3694236 buy stop 1.10 AUDJPY.m at 95.679 done
QE 0 Trades 19:31:11 '***': cancel order #3694238 buy limit 1.10 AUDJPY.m at 93.876 done
CG 0 Trades 19:31:11 '***': cancel order #3694237 buy stop 0.36 AUDJPY.m at 95.679 done
OL 0 Trades 19:31:11 '***': cancel order #3694239 buy limit 0.36 AUDJPY.m at 93.876 done
Four pending orders, according to the log, seemed to be deleted quickly. But onTradeTransaction, the responses came in about 15 seconds, ticks were coming in this period.
***
JG 0 prp5 (EURUSD.m,M1) 19:31:26 TS=6 Delete tp _ OnTrade PENDING id=85 m=3 b/s=SELL Err=Bid completed
***
RL 0 prp5 (EURUSD.m,M1) 19:31:26 TS=6 Delete sl _ OnTrade PENDING id=86 m=3 b/s=SELL Err=Bid completed
***
HK 0 prp5 (EURUSD.m,M1) 19:31:26 TS=6 Delete tp _ OnTrade PENDING id=87 m=3 b/s=SELL Err=Order executed
Although, there is something strange here too
ES 0 prp5 (EURUSD.m,M1) 19:31:29 TS=6 case 8(real) m=3 b/s=SELL Err=Order placed ==>After OrderSendAsync, 3 sec seems to be too long.
P.S. Looks like there were lags in execution of Expert, though I wonder how long packets for OnTradeTransaction can stay in queue.
From the reference:
MQL5 Reference / Standard Library / Classes for creating panels and dialogs / CWnd / StateFlagsSet
What properties?
StateFlagsSet not properties, but state. A group method for changing the state. Just above methods of changing individual state flags.
Use separately.
Looked at the "data access organisation", looked at the sample script that pumps up the data and understood everything, the following questions arose:
1. Why can't I write this code in the indicator in the function OnInit, so that at start the indicator would download its own history and prepare the time series? Can I write such a check in my Expert Advisor?
2. How often do I need to do this check for: 1 for Expert Advisors and 2 for indicators? If I only once prepare the history and timeseries for copying, then in the future errors in copying will not occur? Or I have to check each time or from time to time if the history and timeseries are ready?
3. Is this check necessary only for indicators and Expert Advisors that use several timeframes and symbols, or is it desirable for all?
Please note - the indicator has no right to wait or loop, otherwise it will kill the calculation of subsequent indicators.
Swap processes are asynchronous and the indicator is not allowed to wait for data. So you can query in the inite, by no means wait or slow down and only in the oncalculate to check availability and count.
Please note - the indicator has no right to wait or loop, otherwise it will kill the calculation of subsequent indicators.
1 So where do I paging the data then? If I want to make an indicator with a basket of currency pairs, many symbols...for each of them I need to check and swap the data...should I run a script from the indicator? Why would one indicator kill the calculations of the subsequent ones? In the next indicators, it is enough to use check of the previous indicator's calculation through BarsCalculated(indicator1_Handle), let it calculate and download the data, or am I wrong?
2 Another question, of another kind - when I declare indicator handle in the function, it starts counting? Or does it start counting before I give a command to copy it?