Good time.
Where is the error?
void GetHPosition(_hist &Array[])
{
/ / - - - defining the boundaries of the required trading history
datetime end=TimeCurrent(); / / current server time
datetime start=end-periodseconds(PERIOD_W1);/ / setting the start to a day ago
/ / - - - query the program cache for the desired interval of the trading history
historyselect(start,end);
int _GetLastError=0;
/ / - - - get the number of transactions in the history
int _positionshtotal=historydealstotal();
/ / - - - get the ticket of the transaction that has the last index in the list
int temp_value= (int)mathmax(_positionshtotal,1);
ArrayResize(Array,temp_value);
_ExpertHist=0;
for(int z=_PositionsHTotal-1; z>=0; z--)
{
ulong deal_ticket=HistoryDealGetTicket(z);
{
Array[z].magic= HistoryDealGetInteger(deal_ticket,DEAL_MAGIC);
Array[z].priceopen=HistoryDealGetDouble(deal_ticket,DEAL_PRICE);
_ExpertHist++;
}
}
temp_value=(int)MathMax(_ExpertHist,1);
ArrayResize(Array,temp_value);
}
vlad143
datetime start=end –periodseconds(PERIOD_W1);/ / set the start to a day ago
So for a day or a week?
prostotrader
if(HistorySelect(start,end))
{
}
The first mistake