Please pay more attention when posting, I had to edit your post to make it readable, it was all on 1 line.
angevoyageur:
Please pay more attention when posting, I had to edit your post to make it readable, it was all on 1 line.
Please pay more attention when posting, I had to edit your post to make it readable, it was all on 1 line.
sorry . It is the first time I publish a question
Fondamental: whereas I always remains zero and I can not give him the proper functioning .
| The code you posted contradicts your statement. Add print statement including your variables, or post the real code. |
WHRoeder:
Fondamental: whereas I always remains zero and I can not give him the proper functioning . | The code you posted contradicts your statement. Add print statement including your variables, or post the real code. |
//initialization function datetime News[2]; int Magic= 123; int CandleNews; //tick function // Array declaration News[0] = D'2016.01.01 17:00:00'; News[1] = D'2016.01.02 17:30:00'; for(int i = 0; i <ArraySize(News); i++){ CandleNews=iBarShift(Symbol(),PERIOD_CURRENT,News[i],false); if(CandleNews>5) //after 5 candles from the candle news opener order { OrderSend(Symbol(),OP_BUY,1.0,Ask,0,0,0,"ArrayDatetimeNews",Magic,0,Blue); } return; }
I already have an expert that open only one order on a news. But to make the backtest i need an array that open more orders on a list of news.
Ps.Sorry for my english but i'am italian
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have this problem that gives me trouble for quite some days , I think it's pretty much a fact of the code structure, because in this case the shift of the news candle never increases . Because if the news comes out at 17:00 , at 17:01 the news candle will no longer 0 but will of course 1 ( M1 ) , whereas I always remains zero and I can not give him the proper functioning .