Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 915
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
)
Hello! Please write why in the Strategy Tester does not open trades, writes in the log error: (2015.07.13 00:22:39.218 TestGenerator: unmatched data error (high value 1.31150 at 2013.07.11 05:00 is not reached from the lowest timeframe, high price 1.31140 mismatches) quotes updated. Here is the code of the Expert Advisor:
)
Regarding the mentioned tester error, this will always be the case when testing on ticks. The quotes history in MT4 is not perfect, there are always mismatches.
The code is full of errors. Variables are not initialized, the start function doesn't understand what it returns, there is no check of trading functions execution, so please fix it.
Add #property strict to the beginning of the code.
And since we have created two functions for defining order types, why not integrate the counter of orders of each type and write if ( OrdersBuy<1...), if ( OrdersSell<1...) instead of comparing if( OrdersTotal()<1...)? It would be more correct.
Please advise how to open only one trade in conditions of one bar, if the trade takes place inside the bar, but at the time of closing the signal to open appears immediately on the same bar.
In other words - the bar gave a signal to open an order. It was opened and a short take was triggered. The deal has been closed but the EA closes the first one and immediately opens the second one with the exact same order because we still have the condition to open it within the same bar. I need to open only one position on one bar. And to open the next trade we should wait for the opening of another bar.
Please advise how to open only one trade in conditions of one bar, if the trade takes place inside the bar, but at the time of closing the signal to open appears immediately on the same bar.
In other words - the bar gave a signal to open an order. It was opened and a short take was triggered. The deal has been closed but the EA closes the first one and immediately opens the second one with the exact same order because we still have the condition to open it within the same bar. I need to open only one position on one bar. And we wait for the opening of another bar to open the next trade.
The _already open = false;
if (isNewBar()){ _already opened = false;}
if (!OrderSend(...) ) { /* error handling */; } else { _already opened = true; }
isNewBar() - standard, as it is in the articles, using static datetime date = Time[0];
if (_already opened) { return; //does not send the warrant }
Regarding the tester error mentioned, this will always be the case when testing on ticks. Quote history in MT4 is imperfect, there are always mismatches.
The code is full of errors. Variables are not initialized, the start function doesn't understand what it returns, there is no check of trading functions execution, so please fix it.
Add #property strict to the beginning of the code.
And since we have created two functions for defining order types, why not integrate the counter of orders of each type and write if ( OrdersBuy<1...), if ( OrdersSell<1...) instead of comparing if( OrdersTotal()<1...)? It would be more correct.
bool _already opened = false;
if (isNewBar()){ _already opened = false;}
if (!OrderSend(...) ) { /* error handling */; } else { _already opened = true; }
isNewBar() - standard, as it is in the articles, using static datetime date = Time[0];
if (_already opened) { return; //don't send the warrant }
it says 'isNewBar' - function not defined 2015
I'm not really a wizard. I'd like an exact copy and paste if you can please.
it says 'isNewBar' - function not defined 2015
I'm not really a craftsman. I'd like an exact copy and paste if possible please.
it says 'isNewBar' - function not defined 2015
I'm not really a craftsman. I'd like an exact copy and paste if possible please.
Yes in any advisor in the kodobase would find it!
Any councillor in a kodobase would have found it!
Thanks )) The strongest simply! everything worked from the 1st time!
Thank you all!
Please help me understand.
How do I write different lines from the indicator into the EA?
I have an indicator - MACD 2 Line. How can I register the lines from the indicator in my EA?