[back testing] marketinfo mode_high return 0

 

Hi all,

Could anyone please help me!

When I am doing back testing using code:


   double TodayHighest = MarketInfo(Symbol(),MODE_HIGH);
   Print("TodayHighest is:  ",TodayHighest);
  

  double TodayLowest = MarketInfo(Symbol(),MODE_LOW);

Print("TodayLowest is:  ",TodayLowest);


All the values I got were "0.0"

But When I tried

double askprice = MarketInfo((Symbol(),MODE_ASK);

I can get a non-zero value.

 

However, when I click active EA trading button, it is showing "today's" high and low successfully.

Also I start wondering is this MarketInfo function able to get High and Low on previous day when doing the back test.

Can anyone help?

 

no marketinfo is not available.

use MT5 if you want more.

 
Marco vd Heijden:

no marketinfo is not available.

use MT5 if you want more.

Is there any alternative way to find day HIGH and day LOW when doing back testing?

My broker doesn't provide MT5

 

yes there is.

you do a loop scan over the last 24 Bars (assuming H1 frame) with the comparison if High[bar] > is larger then daily_high {daily_high=High[bar];} to end up with the daily high.

Reason: