FANCY LINE
FANCY LINE
Topics1Comments0Reader0
Articles0CodeBase0Charts0
Friends 1
FANCY LINE
FANCY LINE
I solve it incase someone need it

HistorySelect(0,TimeCurrent());
int TotalDeals = HistoryDealsTotal();
datetime LatestDeal = 0;
ulong LatestTicket = 0;
for(int i = 0; i < TotalDeals;i++){
ulong Ticket = HistoryDealGetTicket(i);
if(HistoryDealGetInteger(Ticket,DEAL_ENTRY) == DEAL_ENTRY_OUT){
// long DealTime = HistoryDealGetInteger(Ticket,DEAL_TICKET);
if ( HistoryDealGetInteger(Ticket,DEAL_ENTRY ) ==DEAL_TYPE_BUY){

double DEALSL= HistoryDealGetDouble(
LatestTicket,DEAL_SL );
LatestTicket = Ticket;


if(bid {
Print(__FUNCTION__,"STOPLOSS REACHED FOR BUY POSITION+++++++++++",DEALSL);
}

// if SL greater than zero ...

}else if ( HistoryDealGetInteger(Ticket,DEAL_ENTRY ) ==DEAL_TYPE_SELL){

double DEALSL= HistoryDealGetDouble(
LatestTicket,DEAL_SL );
LatestTicket = Ticket;

if(bid>DEALSL)
{
Print(__FUNCTION__,"STOPLOSS REACHED FOR BUY POSITION+++++++++++",DEALSL);
}

// if SL greater than zero ...


}


}
}
FANCY LINE
Added topic Need help calculating Profit for buy position only and sell position spready
Hey guys need help please Is it possible to calculate the profit for the open position either buy or sell separately. I'm using AccountInfoDouble(ACCOUNT_PROFIT) to get the profit but I cannot get the profit for the buy position only or the
FANCY LINE
Registered at MQL5.community