How to get price range from highest price and lowest price in specific time range
-
I want to get price range as number in pips, so I could use it in formula. I try to use formula block to get price range, but no value appears shared/IZ3hwTn0e
-
in tester is value from log file

... you probably need value in pips ... you can use some custom code to convert it to pips, like
Price_range=toPips(Price_range); -
Strange, I used log message to learn what value I get, but nothing appeared in journal. I will check my mt4 platform or restart it.
-
I still don't recommend to anyone to use my functions, such as toPips(). One day I may rewrite the function or simply delete it. I'm very bad at planning, so very often when I look at my old work, I don't like it. So I change my code from time to time. toPips() in particular was never changed, but who knows.
What I don't like in this function is that it actually has second parameter, which is the symbol. In other native MQL function the symbol is the first parameter. -
I restarted my MT4 platform, and journal started show log entries. I used crude method to convert to pips by entering *10000 text to adjust line. I know that this method is not universal it can change with currency pair or broker. For test purpose its enough.
-
You mean those long long numbers? They should be treated with NormalizeDouble(), but I found out that even this doesn't help all the time.
-
Yes long numbers, multiplying worked for me. Can long numbers slow down optimization?
-
I think they dont slow optimization
-
Those long numbers are because of the way they are stored in the memory, this comes from the C programming language. I don't understand it very well, but they simply exists like that. There is a function NormalizeDouble() that should turn them into normal numbers, but even that sometimes doesn't work... I don't know why. I put that function all around the blocks, but still long numbers appear out of the blue.
-
@fxDreema where can I read all of FxDreema Functions? I wanna learn and read it from time to time to keep updated and improve my eas
-
NormalizeDouble() is a standard metatrader function, all can be used in FX, google or any AI platform will show you these, this will link you to a conversation talking about using the side of FX that is not so obvious...