Forex



Go Back   Forex Trading > Training > Metatrader > Metatrader 4 mql 4 - Development course > Questions
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 09-02-2006, 04:34 PM
deeforex's Avatar
Member
 
Join Date: Oct 2005
Posts: 91
deeforex is on a distinguished road
Using Arrays to track info for All Open Orders

Could someone show me a snippet of an array for logging the details for all open orders? I want to be able to track information on all Open orders such as OrderOpenPrice and order profit. Then I would like to use the information in the array to find the minimum and maximum values. I've tried all sorts of thing but nothing seems to work.

Thanks in Advance!!!
dee
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 09-02-2006, 05:38 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Cool very good and generic idea!

Quote:
Originally Posted by deeforex
Could someone show me a snippet of an array for logging the details for all open orders? I want to be able to track information on all Open orders such as OrderOpenPrice and order profit. Then I would like to use the information in the array to find the minimum and maximum values. I've tried all sorts of thing but nothing seems to work.

Thanks in Advance!!!
dee
dee,

It's a very good and generic idea! this array could be used for a lot of purposes!

I'll give it a hand!
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #3 (permalink)  
Old 09-02-2006, 06:46 PM
deeforex's Avatar
Member
 
Join Date: Oct 2005
Posts: 91
deeforex is on a distinguished road
Quote:
Originally Posted by codersguru
I'll give it a hand!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #4 (permalink)  
Old 09-12-2006, 06:56 AM
deeforex's Avatar
Member
 
Join Date: Oct 2005
Posts: 91
deeforex is on a distinguished road


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);

            }
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #5 (permalink)  
Old 09-12-2006, 07:05 AM
phoenix's Avatar
Senior Member
 
Join Date: May 2006
Posts: 319
phoenix is on a distinguished road
you always count the 0th index

anyway that the great idea .. i agree, coderguru

looking forward to see your great code soon

Last edited by phoenix; 09-12-2006 at 07:07 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #6 (permalink)  
Old 09-12-2006, 05:33 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Cool More about Arrays

deeforex,

I'm writing an article right now about this issue !

Please track it at:
http://www.metatrader.info/node/161
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #7 (permalink)  
Old 09-12-2006, 07:01 PM
deeforex's Avatar
Member
 
Join Date: Oct 2005
Posts: 91
deeforex is on a distinguished road
Quote:
Originally Posted by codersguru
deeforex,

I'm writing an article right now about this issue !

Please track it at:
http://www.metatrader.info/node/161

....Today we are going to study an example of 2 dimensional array and a very useful code that "Using Arrays to track info for All Open Orders" (Do you hear me deeforex ?)
I'm listening loud and clear Thanks Codersguru!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Arrays in MQL4 clippertm Questions 5 08-11-2008 02:16 AM
Too much distance from real price in Open Orders echnaton Metatrader 4 2 02-25-2007 12:05 PM
close all open orders script forextrend General Discussion 2 12-17-2006 07:16 AM
Script to close open orders... babarmughal Expert Advisors - Metatrader 4 1 12-13-2006 05:50 PM
How do I open and close multiple orders for a single account? iboersma Questions 4 05-26-2006 02:28 PM


All times are GMT. The time now is 11:43 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.