My first EA, simple question

 

Hi,

simple question, but it is stopping me from getting any further.

why doesn't the High value I output by runing this in the strategy tester match up with the one on the chart in the data window?

I am looking at the correct chart (I click the chart from the strategy tester)

the EA:

//+------------------------------------------------------------------+

//| expert start function |

//+------------------------------------------------------------------+

int start()

{

Print(iHigh(NULL,0,0));

return(0);

}

//+------------------------------------------------------------------+

I did this test because I couldn't match up the results of iCustom with the chart and was trying to dig backwards to see if I could even get the correct High price, which it seems I can't.

 
ycomp:
Hi,

simple question, but it is stopping me from getting any further.

why doesn't the High value I output by runing this in the strategy tester match up with the one on the chart in the data window?

I am looking at the correct chart (I click the chart from the strategy tester)

the EA:

//+------------------------------------------------------------------+

//| expert start function |

//+------------------------------------------------------------------+

int start()

{

Print(iHigh(NULL,0,0));

return(0);

}

//+------------------------------------------------------------------+

I did this test because I couldn't match up the results of iCustom with the chart and was trying to dig backwards to see if I could even get the correct High price, which it seems I can't.

Try to do it that way

Print(High[0]);

But it's the same, i think your problem is that UR checking the highest value of non closed bar - it may change before close.

 

ok, I'll try that... any ideas why the iCustom doesn't work? I tried with many indicators including simple ones like RSI, CCI. I was following the parameters properly, 0 for current bar, correct "line" variable, correct symbol and time frame, etc.

although the results were obviously the RSI, CCI value or whatever, they were not from the current bar.

 

ok, stupid me... I tested it... that solves all my problems. High[0] returns the open of [0] because I guess that is all the data even in the strategy tester available.

High[1] returns the High of previous bar. Now that I understand it, makes perfect sense. thx.

Reason: