Hello,
I am trying to get all my active orders. I think i am calling the right functions, but the function Me:GetMyOrders[Orders] is always returns null and the script is exiting without getting any orders.
I am happy for any information you can give me.
Thanks
I am trying to get all my active orders. I think i am calling the right functions, but the function Me:GetMyOrders[Orders] is always returns null and the script is exiting without getting any orders.
I am happy for any information you can give me.
Thanks
Code:
function myOrders()
{
variable int i = 1
variable index:myorder Orders
variable int OrdersCount
echo "Updating/Fetching My Orders..."
Me:UpdateMyOrders
wait 10
Me:GetMyOrders[Orders]
while ${Orders} == NULL && ${i:Inc} <= 10
{
wait 10
Me:GetMyOrders[Orders]
}
echo "orders: ${Orders} i=${i}"
if ${i} >= 10
{
echo TIMEOUT
return null
}
Orders:GetIterator[it]
if ${it:First(exists)}
{
do
{
if (${it.Value.IsSellOrder})
{
echo === SELL Order ===
}
elseif (${it.Value.IsBuyOrder})
{
echo === BUY Order ===
}
echo ID: ${it.Value.ID}
}
while ${it:Next(exists)}
}
echo "Script finished."
return Orders
}