i want a peace of code in an indicator that does the following : search in the history of a currency pair for the open price (bid) that is equal to the current open price (bid). How best can this be done? Thank yu.
- Non-dynamic trading.
- Pending Order EA
- How to get current bid/ask price
tafadzwa:
i want a peace of code in an indicator that does the following : search in the history of a currency pair for the open price (bid) that is equal to the current open price (bid). How best can this be done? Thank yu.
i want a peace of code in an indicator that does the following : search in the history of a currency pair for the open price (bid) that is equal to the current open price (bid). How best can this be done? Thank yu.
If you can't find what you need in the Codebase or the Market, then you can create a request in Jobs Service.
angevoyageur:
If you can't find what you need in the Codebase or the Market, then you can create a request in Jobs Service.
If you can't find what you need in the Codebase or the Market, then you can create a request in Jobs Service.
If I correctly understand you must search the open prices of each bar, so a straightforward way is to implement a while loop something like:
int maxnumberofbars = 400;
int i = 1;
bool openpricefound = false;
while(i<=maxnumberofbars && openpricefound==false)
{
if (Open[i] == Bid) openpricefound == true
<any other logic you want on the price must be put in the if>
i++;
}
Bye
Play videoPlease edit your post.
For large amounts of code, attach it.
if (Open[i] == Bid) openpricefound == true
Likely will never match. The == operand. - MQL4 forum
![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