how to get the second from bottom 's account freemargin

 
Inscribe shows,how to get the last but one's balance or accountfreemargin?I wanna compare the lastest accountfreemargin with the previous one's value,that could help me confirm lot. Guru show the method and process would be more great appreciation!!
 
There is no function to get previous values only the current. You'll have to have the code remember the value before opening a new order.
 
WHRoeder:
There is no function to get previous values only the current. You'll have to have the code remember the value before opening a new order.


How to remember the value in some code?

Some guys show me like this:accountfreemargin()-profit() is the last but one's accountfreemargin,but I have checked,it seems go wrong. Don't know cause.