Hi
I'm new to metatrader although i have done a fair amount of c programming in my time! I'd be really grateful if somebody to answer a couple couple of questions re EA's:
1) The functions Bars returns the no. of bars on the current chart so I reference the current bar as Bar(0) and the previous Bar as Bar(1) ... is that correct?
2) If I only want my EA to be executed against the closing price of the previous bar when the current bar opens - what is the best way to program that? I don't want the signal be flagged a zillion times during the current bar?
3) When the chart first comes up I'd like it to mark all of the long/short/close points but obviously not instigate a trade unless it is the current bar - what is the best way to handle that?
Thanks
Paul
I'm new to metatrader although i have done a fair amount of c programming in my time! I'd be really grateful if somebody to answer a couple couple of questions re EA's:
1) The functions Bars returns the no. of bars on the current chart so I reference the current bar as Bar(0) and the previous Bar as Bar(1) ... is that correct?
2) If I only want my EA to be executed against the closing price of the previous bar when the current bar opens - what is the best way to program that? I don't want the signal be flagged a zillion times during the current bar?
3) When the chart first comes up I'd like it to mark all of the long/short/close points but obviously not instigate a trade unless it is the current bar - what is the best way to handle that?
Thanks
Paul