I call AlfaDirect(www.alfadirect.ru) functions from AmiBroker by COM.
AlfaDirect has function:
ADObj.CreateLimitOrder(Account,
PlaceCode,
PCode,
EndDate,
Comments,
Currency,
BuySell,
Quantity,
Price,
ActivateIfPriceHasGrow,
ActivateIfPriceHasFall,
ActivateIfOrderExec,
ActivateIfOrderCancel,
ActivateIfDateReached,
CheckLimitsOnActivate,
ChangeTo,
ChangeIfPriceHasGrow,
ChangeIfPriceHasFall,
ChangeIfOrderExec,
ChangeIfOrderCancel,
ChangeIfDateReached,
DeleteIfPriceHasGrow,
DeleteIfPriceHasFall,
DeleteIfOrderExec,
DeleteIfOrderCancel,
Timeout)
with types:
Account [in] String
PlaceCode [in] String
PCode [in] String
EndDate [in] DateTime
Comments [in] String
Currency [in] String
BuySell [in] String
Quantity [in] Integer
Price [in] Float
ActivateIfPriceHasGrow [in] Float (If parameter is Null, condition is
ignored)
ActivateIfPriceHasFall [in] Float (Can be Null)
ActivateIfOrderExec [in] Integer (Can be Null)
ActivateIfOrderCancel [in] Integer (Can be Null)
ActivateIfDateReached [in] DateTime(Can be Null)
CheckLimitsOnActivate [in] String (Can be Null)
ChangeTo [in] Float (Can be Null)
ChangeIfPriceHasGrow [in] Float (Can be Null)
ChangeIfPriceHasFall [in] Float (Can be Null)
ChangeIfOrderExec [in] Integer (Can be Null)
ChangeIfOrderCancel [in] Integer (Can be Null)
ChangeIfDateReached [in] DateTime (Can be Null)
DeleteIfPriceHasGrow [in] Float (Can be Null)
DeleteIfPriceHasFall [in] Float (Can be Null)
DeleteIfOrderExec [in] Integer (Can be Null)
DeleteIfOrderCancel [in] Integer (Can be Null)
Timeout [in] Integer
OrderNo [out] Integer
When i call object with ALF:
adt = CreateStaticObject("ADLite.AlfaDirect");
ordno = adt.CreateLimitOrder("109970-000", "MICEX_SHR", "LKOH",
Date(), "sample order", "RUR", "B", 1, 2000, Null, Null, Null,
Null, Null, "Y", Null, Null, Null, Null, Null, Null, Null, Null,Null,
Null, 10);
if (ordno == 0) {
_TRACE(adt.LastResultMsg);
}
i see in Trace:
Overflow while converting variant of type (Single) into type (Integer)
Formulas\Custom\AlfaDirect.afl 15 27 11:17:12.97
It works well if I call CreateLimitObject from JScript or VBScript (
Can I call this function from AFL?
What type has Null in AmiBroker?