I am using Amibroker interfacing with my Interactive Broker account. I have developed a few AFL programs to handle automatic trading.
However, I encounter a serious problem! Whenever it is 10 min before the close of the market, it would terminate my Amibroker session without any negotiation with the attached message. Even after I re-enter Amibroker, all the memories in my AFL programs are lost.
Their reason is because if I want to stay my position overnight, I need to have more margin. However, my plan is to close the position just right before the close of the market, not at the 10 min before the market close.
Is there any means to suppress this kind of “sudden kickout”?