Download MetaTrader 5
To add comments, please log in or register
Interessiert am Partnerprogramm MQL5.community? Veröffentliche Links und verdiene Geld damit!
Patrick
153
Patrick 2009.09.29 16:09 

Running a strategy test on "Open Prices Only" and using:


Print(">> ", Time[0], " ", Open[0], " ", High[0], " ", Low[0], " ", Close[0]);


Returns the same value for the Open, High, Low, Close Prices:


2009.09.29 09:01:34 2009.09.09 23:57 TEST EURUSD,M1: >> 1252540620 1.4560 1.4560 1.4560 1.4560


When I reference the previous bar:


Print(">> ", Time[0], " ", Open[1], " ", High[1], " ", Low[1], " ", Close[1]);


2009.09.29 09:01:34 2009.09.09 23:58 TEST EURUSD,M1: >> 1252540680 1.4559 1.4562 1.4558 1.456


I get the appropriate values for each on the previous bar.


Using Open Prices only, shouldn't I be able to use the current [0] value to get the correct values for Open, High, Low, and Close for all the prices???






Brian Dee - Random Trader
1763
Brian Dee - Random Trader 2009.09.29 17:18  

B B

> Using Open Prices only, shouldn't I be able to use the current [0] value to get the correct values for Open, High, Low, and Close for all the prices???

I dont think so - I never use this!

If you think about it, at open the bar is a very very short candle...

If there is a difference, it may show up on a 5 decimal places (sub-pip) data feed?

NB Print is limited to 4 decimal places by default, so use DoubleToString() to get round this - see https://docs.mql4.com/common/Print

Good Luck

-BB-

renaud
5
renaud 2014.03.16 19:52  
Bauer_Boy:

Running a strategy test on "Open Prices Only" and using:


Print(">> ", Time[0], " ", Open[0], " ", High[0], " ", Low[0], " ", Close[0]);


Returns the same value for the Open, High, Low, Close Prices:


2009.09.29 09:01:34 2009.09.09 23:57 TEST EURUSD,M1: >> 1252540620 1.4560 1.4560 1.4560 1.4560


When I reference the previous bar:


Print(">> ", Time[0], " ", Open[1], " ", High[1], " ", Low[1], " ", Close[1]);


2009.09.29 09:01:34 2009.09.09 23:58 TEST EURUSD,M1: >> 1252540680 1.4559 1.4562 1.4558 1.456


I get the appropriate values for each on the previous bar.


Using Open Prices only, shouldn't I be able to use the current [0] value to get the correct values for Open, High, Low, and Close for all the prices???


Hi,


Yes this is normal since when the Strategy Tester pauses with Open prices only mode... your candle is opening... and you only know the Open price of Bar 0 at this time...

So at this time Open = Close = High = Low :-)

But at this time Bar 1 has closed... so you can read Open, Close, High, Low with disctints values

I hope it can help. Bye. Renaud.




Alain Verleyen
Moderator
28518
Alain Verleyen 2014.03.16 19:56  
Renaud:


Really ? Five years later ?
/
To add comments, please log in or register