Ideas for price gap calculation?

 

Hi Guys,

Could you give me a little guidance on this:

I'm trying to code a script, that would indicate the biggest price gap between two following price quotations in a M1 bar. Is there a function that retrieves price quotations from a certain bar? This script would be useful for news trading. I have no idea where to start with this one... thanks for your advice.

Cheers,

Tom


EDIT:

I've decided to do it the easy way: I've coded an EA that prints out consecutive price quotations and than I copy/paste the results to excel- works fine

 
I'm assuming here that you don't mean the range of the bar which would just be to subtract the low from the high. It's the greatest price movement between two consecutive ticks in the same bar right? A very suitable and easy project for you if you're trying to learn MQL. Just really a case of: a) identifying the start of a new bar b) zeroing a maxrange variable c) subtracting each tick with the last one received d) moving the result to the maxrange variable if it's greater than what was there already Start writing the pseudocode and you'll see it's simple. Between the existing code snippets on the forum and any further help you need coming from us, you'll be there in no time. CB
Reason: