HistoryDealGetDouble returns 100000.00 every once in a while for no reason in the context of DEAL_PROFIT

Benjamin Dixon  
Here's the code that works most of the time and prints the profit.
            Print(omagic,cb,ccy.cursym," position closed by user, SL or TP:",Ordnum,cb,EnumToString(OrdDtype),cb);
         if(!istester || logslipTester)
            string reason = "SLTP exit";
            LogSlippage((string) reason,DEAL_ENTRY_OUT);
         if(!logslipTester && !isoptimizer)
            long position_id=HistoryOrderGetInteger(Ordnum,ORDER_POSITION_ID);
               ulong thisdealtic=HistoryDealGetTicket(HistoryDealsTotal()-1);
               double prft;
                     Print(omagic,cb,ccy.cursym," checked profit:",prft);

In the logs, every once in a while I get this:

2021.05.21 02:11:25.098 Core 1 2021.04.23 06:15:50   555556,ETHUSD checked profit:100000.0

I can match the Ordnum to a stop loss hit for small loss in the report:

100000.0 is the most baffling....

Benjamin Dixon  
Benjamin Dixon:

OK I see why 100000.0.

Occasionally returns 0 which causes me to wind up with the deposit as the profit. Not sure why yet though, ordnum is a legit order number that got executed and then exited by SL. 

Happy ending. Ordnum is not a legit order that executed there must be a bug elsewhere. I'll find it.