Download MetaTrader 5
To add comments, please log in or register
Have you just installed MetaTrader 5? Learn it in details!
Ahmed Sabry Bakry
10
Ahmed Sabry Bakry 2016.03.08 17:45 

Please find the below code and here's the problem:

datetime fromDT ="00:00",

           toDT ="07:00";

int      fromBar = iBarShift(NULL, 60, fromDT),

           toBar = iBarShift(NULL, 60,   toDT),

          length = fromBar - toBar + 1,

           HHbar = iHighest(NULL,60, MODE_HIGH, length, toBar),

           LLbar =  iLowest(NULL,60, MODE_LOW,  length, toBar);

double     HH    = iHigh(NULL,60, HHbar),

           LL    = iLow(NULL,60, LLbar); 

 the problem is in backtesting HH and LL are returning the open price of the current bar only.

 

Any help please?

whroeder1
13640
whroeder1 2016.03.08 19:42  
  1. Don't paste code
    Play video
    Please edit your post.
    For large amounts of code, attach it.

  2. datetime fromDT ="00:00"
    A string is not a datetime. StringToTime - Conversion Functions - MQL4 Reference
  3. "00:00" is not valid to StringToTime.



Vasyl Nosal
18216
Vasyl Nosal 2016.03.08 22:18  

Maybe helps you.

 https://www.mql5.com/en/code/viewcode/14322/86819/time_trading.mq4

Carl Schreiber
5957
Carl Schreiber 2016.03.09 08:53  
eevviill:

Maybe helps you.

 https://www.mql5.com/en/code/viewcode/14322/86819/time_trading.mq4

Your link is dead (error 404).
Vasyl Nosal
18216
Vasyl Nosal 2016.03.09 11:13  
gooly:
Your link is dead (error 404).
https://www.mql5.com/en/code/viewcode/14244/82456/time_trading__7.mq4
/
To add comments, please log in or register