getMargins("equity") giving wrong data

What I'm trying to do is-To get margin available for trading initially and the margin available after placing a order. Here is the sample code:
regularOrderPlace('regular');//place some10 stocks for RELIANCE
var millisecondsToWait = 2000;
setTimeout(function() {
}, millisecondsToWait);

In above code, getMargins('equity') inside the timeout function doesn't return the updated margin rather it gives the initial margin that i got the from line 1.

But a strange thing is when i remove the first line i.e getMargins("equity") ,i get the correct margin that is available after placing the order. Is there something I am missing out kindly clarify.
Sign In or Register to comment.