hamidraza:
Excellent, working very well. Thank you very much
Is there a way to define a specific time period rather than 90 days? For example, from 0100 - 0900?
Thanks.
i want
when i make
sell order the Bid price should not be less than the Ask price of last buy order or position
buy order the Ask price should not be greater than the Bid price of last sell order or position
and also how i can get highestprice and lowest price and average price so i can inclde the to buy or sell instead of Ask and Bid price
thanks
![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 try to find highest and lowest price during the last 3 months with following code
double highestprice, lowestprice;
highestprice=High[iHighest(NULL,PERIOD_D1,MODE_HIGH,90,1)];
lowestprice=Low[iLowest(NULL,PERIOD_D1,MODE_LOW,90,1)];
It works fine if chart window is D1 but gives wrong results if chart window is other than D1. Looked up on forum and other places, some suggested using ihigh/ilow in place of high/low but it gives error. if use ihigh/ilow like this way iHigh(Null,PERIOD_D1,90) it gives high and low of 90th bar rather than highest of previous 90 bars of PERIOD_D1. I feel it is a bug. Suggestions would be very much appreciated. Thanks