I need some help to calculate the High and the low price of a pair, between a specfied timeframe, like the order open time and current time. It's this possbile?
Today I BUY, tomorrow I SELL!
Timeframe inside current timeframe - is that possible? 2 replies
Seeing higher timeframe indicators on lower timeframe 4 replies
Testing a 1 minute timeframe strategy - High Leverage 26 replies
//variables
datetime t1;
double max=0, min=1000;
int i, n;
(...)
//order opening
ticket = OrderSend(...);
(...)
//getting order open time bar number n
OrderSelect(ticket, SELECT_BY_TICKET);
t1 = OrderOpenPrice();
for(i=0;i>=10000;i++)
{
if(Time[i] == t1) n = i;
}
(...)
//getting mac and min between bar n and now
for (i=n;i>=0;i--)
{
if(High[i]>max) max = High[i];
if(Low[i]<min) min = Low[i];
} string Pips = DoubleToStr((hi-lo) / Point / 10, 1);
Comment("nHigh: ",DoubleToStr(hi, Digits),"nLow: ",DoubleToStr(lo, Digits),"nPips: ",Pips,"nnBars Open: ",nBarsOpen,"nBars Close: ",nBarsClose,"nBars: ",nBarsOpen-nBarsClose);