I have a problem with quote. I explain.
I have an EA which call an icustom and in the setting I give a pair name. For to be sure the data which used by the icustom is good, I write in a file the iclose (iclose(pair name,0,0), I want the current close ) of the pair. And I don't have the good quote.
I precise, the EA is on a chart and the pair is on this chart is an other I give in the setting of icustom, and the timeframe is daily
What is the problem, please, how can I have the good quotes (sometimes the quotes is good and sometimes no)? I work like this, because my EA use 16 pairs and I can't open a chart for each pair.
Thank's a lot for your answer.
Try using MarketInfo( pair, MODE_ASK ) && MarketInfo( pair, MODE_BID ).
If you're getting Error Messages, Please provide the Error# you're getting.
datetime now = Time; // or TimeCurrent()
int iOP = iBarShift(OtherPair, OtherTF, now);
double cOP = iClose(OtherPair, OtherTF, iOP);
Hi and thank's for your answer,
I tested your proposition and I don't have error, it return me BID and ASK, not the true BID and ASK but around this.
What is the tester? For backtesting?? If it's that, no I didn't use, my problem is with a current system. I do my backtesting with an other soft.
I tested your proposition and I written this* in the init() for see what mt4 return me, and it return wrong close. At the first compilation sometime, it return 0, sometime a close around the true close, and at the second compilation it return the true close. It's the same thing if I use iclose(pair name,0,0).
*datetime now = TimeCurrent();
int iOP = iBarShift("AUDNZD", 0, now);
double cOP = iClose("AUDNZD", 0, iOP);
For information, if the chart of the pair ttaht I want the close is open, the result return by iclose(pair name,0,0) is good, but I work with 16 pairs, and I can't open the 16 charts.
I have a problem just whith iclose(pair name,0,0).
In other word, if I write in the init() Print("USDCAD",0,0) and the chart of USDCAD is not open, mt4 write a price which is not the good price. But if I compil again, mt4 return the good price. Why?
but how can I do for have the good close without open all the charts?
Thank's again for your help.
Yes it's a good idea, but it's not good for my system. However I finaly found an other solution. I created a indicator which use all the pair I use, then in the init() I can call iclose and to have the good price.
Thank's so much for your answers and help, I appreciated !!