Forum

Need Help Interfacing to Delphi DLL

Does anyone have some sample code for how to call a DLL written in Delphi from MetaTrader? I can't get Var parameters to work. I wrote the following test function in Delphi and compiled it as a DLL (using Delphi 5): function AddIntegers( a: integer; b: integer): integer; stdcall; begin result := a

Change Timeout Duration for ERR_TRADE_TIMEOUT

Is there any way to change the duration that the terminal will wait before it times out with ERR_TRADE_TIMEOUT error status? That duration is extremely long, 3 minutes and 18 seconds, according to another thread in this forum. This is far too long, especially if it keeps the Trade Context jammed all

ERR_TRADE_MODIFY_DENIED on OrderClose()

I'm getting this weird error occurring very frequently, when performing an OrderClose(). The close fails, with error code 145, ERR_TRADE_MODIFY_DENIED, which means "modification denied because order too close to market". But I'm not modifying an order, I'm just trying to close it! This is occurring