| New signals service! | |
|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Quote:
It's a very good and generic idea! this array could be used for a lot of purposes! I'll give it a hand! |
|
||||
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);
}
|
|
||||
|
deeforex,
I'm writing an article right now about this issue !Please track it at: http://www.metatrader.info/node/161 |
|
||||
|
Quote:
I'm listening loud and clear Thanks Codersguru! |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Arrays in MQL4 | clippertm | Questions | 5 | 08-11-2008 01:16 AM |
| Too much distance from real price in Open Orders | echnaton | Metatrader 4 | 2 | 02-25-2007 11:05 AM |
| close all open orders script | forextrend | General Discussion | 2 | 12-17-2006 06:16 AM |
| Script to close open orders... | babarmughal | Expert Advisors - Metatrader 4 | 1 | 12-13-2006 04:50 PM |
| How do I open and close multiple orders for a single account? | iboersma | Questions | 4 | 05-26-2006 01:28 PM |