and how to get the bar before the open position bar?
double hoot(int period,int ticket ){
if (OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) return 0.0f;
datetime tot=OrderOpenTime();
int deltaT=iTime(OrderSymbol(),period,0)-tot;
int shift=deltaT/period;
return(iHigh(OrderSymbol(),period,shift));
}
try it. not been tested.
double high_curr=High[0]; double high_prev=High[1];
double High_curr=iHigh(Symbol(),PERIOD_CURRENT,0); double High_prev=iHigh(Symbol(),PERIOD_CURRENT,1);
![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