Serving Traders Since 2005
|
|
|
|||||||
| MetaTrader 5 MT5 is already out of its beta stage, but the development is ongoing. Some brokers already offer real accounts and the interest of traders is growing. You can discuss anything related to MetaTrader 5 in this forum. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Hi
I do not know if I am doing something wrong here for that error to appear. the error only appears on the s_Ma buffer "last line" MQL5 Code:
Last edited by samjesse; 2nd January 2012 at 10:11. |
|
||||
|
It takes some time for MetaTrader to produce the indicator data, so it's possible that the second indicator isn't ready when you call CopyBuffer(). Try to catch that error and re-do copying until it disappears.
__________________
Please, read the Forum Rules and the Signature Rules to avoid termination of your account. |
|
||||
|
When you call iMA(), it takes some time for MetaTrader to calculate all the data. Until it's done, the handle doesn't point at the correct data.
There is no point in calling iMA() more than one time, as it will probably trigger MetaTrader to restart indicator calculation. The point is to call CopyBuffer() in a cycle until it stops returning an error.
__________________
Please, read the Forum Rules and the Signature Rules to avoid termination of your account. |
|
||||
|
is the following OK. if loops for a long time and I stop it manually.
MQL5 Code:
|
|
||||
|
Looks OK. Do you also check the handles for INVALID_HANDLE value? Maybe the problem is there.
__________________
Please, read the Forum Rules and the Signature Rules to avoid termination of your account. |
|
||||
|
Something like this:
__________________
Please, read the Forum Rules and the Signature Rules to avoid termination of your account. |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Array access error | samjesse | MetaTrader 5 | 1 | 28th October 2011 13:02 |
| Error opening SELL order:130 | pepe | MetaTrader Expert Advisors | 7 | 18th January 2011 21:18 |
| Handling OrderSend Error 148 | Enivid | MetaTrader Expert Advisors | 0 | 4th June 2010 15:09 |
| Handling OrderSend Error 3 | Enivid | MetaTrader Expert Advisors | 0 | 2nd June 2010 10:17 |