
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
But the fact that the expert in the tester can't load the spy is strange. Does it work in the demo?
ERR_INDICATOR_CANNOT_CREATE
4802
The indicator cannot be created
He gets an error
ERR_INDICATOR_CANNOT_CREATE
4802
The indicator cannot be created
I can't figure it out yet. On the demo works, but in the tester does not load (does not create) . Tried even this:
#property tester_indicator "iSpy.ex5"
Does not help.I can't get a clue yet. On the demo works, but in the tester does not load (does not create) . Tried even this:
Does not help.By the method of scientific prodding, it worked in the tester:
And it was enough to insert only in the first condition, for "GBPUSD". Now the question - why exactly like this?
By the scientific method - this is how it worked in the tester:
And it was enough to insert it only in the first condition, for "GBPUSD". Now the question is - why exactly like that?
Wow, "scientific poking" is a great thing in our business. Well, why it is like that is a question for the developers, in my opinion.
Thank you for helping me to figure it out.
There is a line in the OnCalculate() function in the Spy Control panel MCM:
By default price[rates_total-1] is equal to the close price of the last unfinished bar, which in turn is equal to the last bid price. i.e. we always get the bid price from the spy by default.
If you want to get the ask price forcibly, replace this line, for example, with....
Thank you, but a little bit wrong, i.e. you can get either bid or ask. But I need to get both ask and bid prices at once to analyse situations like this.
2011.01.24 10:59:28 exSpy (GBPUSD,M5) 08:59:24 -> id=2: EURUSD PERIOD_M1 price=1.35778
2011.01.24 10:59:28 exSpy (GBPUSD,M5) 08:59:24 -> id=2: EURUSD PERIOD_M1 price=1.35778
2011.01.24 10:59:28 exSpy (GBPUSD,M5) 08:59:24 -> id=2: EURUSD PERIOD_M1 price=1.35778
three ticks and bid does not change, therefore (possibly) the ask has changed. i would like to get more complete information.
Is it possible ?
Thank you, but a little bit wrong, i.e. you can get either bid or ask. But to get both prices at once, both bid and ask, you need to analyse situations like this.
2011.01.24 10:59:28 exSpy (GBPUSD,M5) 08:59:24 -> id=2: EURUSD PERIOD_M1 price=1.35778
2011.01.24 10:59:28 exSpy (GBPUSD,M5) 08:59:24 -> id=2: EURUSD PERIOD_M1 price=1.35778
2011.01.24 10:59:28 exSpy (GBPUSD,M5) 08:59:24 -> id=2: EURUSD PERIOD_M1 price=1.35778
three ticks and bid does not change, therefore (possibly) the ask has changed. would like to receive more complete information.
Is it possible ?
It is possible, there are several ways:
1. have two spies on the same symbol under different id's. One will send bid and the other will send ask.
2. have one spy on the same symbol, but make it send two events bid and ask sequentially under different id.
3. There are more options, but they are already associated with significant modifications to the scheme of passing parameters to OnChartEvent - I do not advise.
Use the spy as a "semaphore of new tick arrival", and in the Expert Advisor get full information about the tick using SymbolInfoTick.
Give me a hint, if you don't mind. The article contains an example of an enumeration
and an example of working with the values of this enumeration:
Similar constructions are observed in the standard library. As far as I understand, we are talking about hexadecimal numbers and bitwise operations, but a couple of general articles found in the Internet did not help to clarify the meaning and purpose of their use in MQL5. Could you tell me where you can clearly and clearly familiarise yourself with the peculiarities of hexadecimal logic used in MQL5?
Give me a hint, if you don't mind. The article contains an example of an enumeration
and an example of working with the values of this enumeration:
Similar constructions are observed in the standard library. As far as I understand, we are talking about hexadecimal numbers and bitwise operations, but a couple of general articles found in the Internet did not help to clarify the meaning and purpose of their use in MQL5. Could you tell me where you can clearly and clearly familiarise yourself with the peculiarities of hexadecimal logic used in MQL5?
Hexadecimal logic is the same everywhere. You can read about number systems here. There you can read about positional number systems and see references to the 16 and binary ones. There are also examples of system-to-system conversion there.
All bitwise operations are intended for the binary system. About bitwise operations in MQL5 here.