I'm desperate here. I've been trying all night to get my array to work but nothing happens. I've realy tried to be self-sufficient and to try to learn but I still can't get to where I need to go. If someone could please have mercy upon me and lend me some assistance....PLEASE!!!!!
I'm running a grid script but would like to track how many lots I'm running by Symbol. I want to be able to add up what my total position is by lotsize. Let's say I have 0.10, 0.10, 0.10, 0.10, 0.20, 0.30, I want to be able know that I have the equivalent to 0.90 lots. I would also like to know the minimum and maximum lot sizes....0.10 and 0.30
Code:
ArrayResize(OrderArray, i);
ArrayInitialize(OrderArray,0);
cnt = 0;
for (i = 0; i < OrdersTotal(); i++)
{
if (OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES) && OrderSymbol() == Symbol() )
{
OrderArray[cnt][PROFIT] = OrderProfit() + OrderSwap();
OrderArray[cnt][OPEN] = OrderOpenPrice();
OrderArray[cnt][LOTS] = OrderLots();
if(OrderType() == OP_BUY)
{
////// I can't get anything to work!!!!!!!
BuyLots += OrderArray[cnt][LOTS];
////// This returns Zero when I place BuyLots in my Comments
////// This returns error messages
MaxBuyLots =ArrayMaximum(OrderArray[LOTS],WHOLE_ARRAY,0);
}