This is the configuration window for the function fnGetHistoryInfo. Just choose the type of information desired and the order-selection criteria to search.

The available types are:
INFO_LOTS:Get the lot size of the last closed order.
INFO_MAGICNUMBER :Get the magic number of the last closed order.
INFO_OPENPRICE :Get the open price of the last closed order.
INFO_CLOSEPRICE :Get the closed price of the last closed order.
INFO_OPENTIME :Get the open time of the last closed order.
INFO_CLOSETIME :Get the close time of the last closed order.
INFO_PROFIT :Get the profit of the last closed order. (this value can be negative)
INFO_STOPLOSS :Get the stoploss of the last closed order.
INFO_TAKEPROFIT :Get the takeprofit of the last closed order.
INFO_SWAP :Get the swap value of the last closed order.
INFO_TICKET :Get the ticket of the last closed order.
INFO_ORDERTYPE :Get the order type of the last closed order.
And other functions are available to get further order-history information. Keep reading to learn more.
Easy Drag and Drop
The Order History functions are dragged and dropped on the free-range VTS drawing pad just like any other function. You are only limited by your imagination.
This drawing uses the fnGetHistoryInfo function, saved to the easy-to-read name lastProfit, to get the profit of the last closed trade.
If the last trade resulted in a loss, the fnOpenOrder function is executed to open another order.

Get Any Information about Any Closed Trade
This package includes the following functions:
The fnGetHistoryInfo function it used to get information about any closed order.
The fnGetLastTradeDuration is used to get the duration, in minutes, of the last closed trade.
The fnGetLastClosedTradeSymbol is used to get the currency symbol of the last closed trade.
The fnGetConsecutiveCount function is used the get the number of the last consecutive winning or losing trades.
The fnGetLargestProfit function is used to find the largest profit of a closed trade within the last X trades or minutes.
The fnGetLargestLoss function is used to find the largest loss of a closed trade within the last X trades or minutes.
Click here to see to the full documentation