I wrote a program which makes sound when there is price change larger than spread between ticks and displays what is happening in a separate window. Any comments?
try make it like this. The code you have will have warnings when compiling it using '#property strict'
#property strict int size = 4, x; double stored_bid[5],spread; void OnTick() { for(x=0; x<size; x++) { stored_bid[x] = stored_bid[x+1]; } stored_bid[size] = SymbolInfoDouble(Symbol(),SYMBOL_BID)/Point(); spread =(int) SymbolInfoInteger(Symbol(),SYMBOL_SPREAD); if (MathAbs((stored_bid[size]-stored_bid[0])/1 > spread)) Alert(x, ", ", stored_bid[size]-stored_bid[0], ", ", spread); // else // Alert(stored_bid[size]-stored_bid[0], ", ", spread, "| ", stored_bid[0], ", ", stored_bid[1], ", ", stored_bid[2], ", ", stored_bid[3], ", ", stored_bid[4]) ; }
try make it like this. The code you have will have warnings when compiling it using '#property strict'
Thanks, how do I display a number on chart just above the candle of how many times did it hit it during it if it is has been drop or below if it has been rise?
By the way, it did not change number of warnings. The existing warnings are.
How do I store it, so it is loaded retrospectively?
'GoldDrop.mq5' GoldDrop.mq5 1 1 implicit conversion from 'number' to 'string' GoldDrop.mq5 11 36 possible loss of data due to type conversion GoldDrop.mq5 15 21 possible loss of data due to type conversion GoldDrop.mq5 16 11 code generated 1 1 0 error(s), 3 warning(s), 354 msec elapsed 1 4
There is no data loss as the points are integers. And the implicit string conversion. Well, my English is not that good. I really do not understand the meaning. It is something like implied I am not bothered about. I tried to express it directly by adding 'string' before declaration with no effect. Apparently there is no Str$() function in this language. Sorry, I have VB background and JS but JS did not have any implied doubts about converting numbers to strings.
By the way, what I noticed as the Gold is on historical low right now, even while in decline, the only price changes above the spread were the positive ones. There were no negative changes above the spread the whole afternoon. The positive ones ended with a sharp $1 in 1 minute rise after which the spikes ended. Potentially an interesting signal here.
The search on strict in user manual does not return any results neither in contents nor index. I hate garbage so I learned that the right way is go through wizard, delete everything it created and write your own code. So the strict should go too in my opinion. Especially that the user manual is full of mistakes.

- www.mql5.com

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I wrote a program which makes sound when there is price change larger than spread between ticks and displays what is happening in a separate window. Any comments?