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 often get Unable to copy the values of the indicator. Error 4806 in the M1 chart and not on other charts. MQL5 Code:
|
|
||||
|
If the CopyBuffer() function is called too early after initialization it may copy no data because indicator data is not yet ready. Try calling it in the second occurrence of the OnCalculate(), not the first, if this is an indicator.
__________________
Please, read the Forum Rules and the Signature Rules to avoid termination of your account. |
|
||||
|
would this create a side effect problem?
i.e. what are the cases when this would result in infinite loop? MQL5 Code:
Last edited by samjesse; 13th October 2011 at 22:06. |
|
||||
|
I noticed from the this code that Sleep(1000) does not really wait 1 second. before the next loop.
Am I doing something wrong? thx MQL5 Code:
|
|
||||
|
If that's an indicator, just don't alert the error. I do it like this:
MQL5 Code:
You'll know about the error - the indicator just won't draw.
__________________
Please, read the Forum Rules and the Signature Rules to avoid termination of your account. |
|
||||
|
Quote:
|
|
||||
|
Then do not run the code that requires the indicator buffer before some time after initialization passes.
__________________
Please, read the Forum Rules and the Signature Rules to avoid termination of your account. |
|
||||
|
I'd say 1 tick is enough. If you indicator/EA/script reacts to ticks, there's nothing difficult in that.
__________________
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 |
| get indicator values with out plotting | samjesse | MetaTrader 5 | 4 | 8th September 2011 07:58 |
| Easy Way To Copy Best Traders | Commtr | Advertisements | 0 | 24th August 2011 07:19 |
| Technical Problem: Copy Tool? | Forexlight | General Forex Discussion | 0 | 27th January 2011 08:50 |
| Copy Paste Pips bonus | ForexTradingChoice | Advertisements | 0 | 17th January 2011 08:13 |
| Euro Is Unable to Break $1.43 Level | alessio09 | Forex News | 2 | 16th August 2009 08:22 |