Forex
Google

Go Back   Forex Trading > Programming > Metatrader Programming
Forex Forum Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


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

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-12-2007, 02:58 PM
cromium's Avatar
cromium cromium is offline
Junior Member
 
Join Date: Sep 2007
Posts: 5
cromium is on a distinguished road
Need a guide to edit my EA

Hello guys,

I'm newbie in programming MQL4 and I'm facing a major problem while I was creating my first EA... My EA always places multiple orders in one time with the same price. I was wondering if anybody in the forum who are more senior can guide me how to edit my EA so it can only place an order (buy/sell) at every price condition.
Thanks.


Best Regard
Attached Files
File Type: mq4 Cromium - BETA 1.mq4 (3.9 KB, 12 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 09-12-2007, 03:26 PM
newdigital newdigital is online now
Administrator
 
Join Date: Sep 2005
Posts: 15,230
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
You need this thread dose it posible to creat any function of "mql code" posting in this forum? : there is some links like 'one order per chart' for example.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-14-2007, 09:54 AM
waltini waltini is offline
Senior Member
 
Join Date: May 2006
Posts: 130
waltini is on a distinguished road
This is what I use.

int buy_orders = 0, sell_orders = 0;
int i;
int cnt = OrdersTotal();
for (i=0;i<cnt;i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber)
if (OrderType() == OP_BUY) buy_orders++;
else if (OrderType() == OP_SELL) sell_orders++;
}


I always put this at the start of every ea and then check that there are no existing orders in the logic section.(I borrowed it from someone else!)

if(sell_orders<1 && etc....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
MQL4 Guide RickD Metatrader Programming 21 05-06-2008 06:53 PM
Need Help To Edit This Great EA zeppelin Expert Advisors - Metatrader 4 83 11-16-2007 12:43 PM
How to edit ex4 file Fisher Indicators - Metatrader 4 2 08-09-2006 11:30 AM
cant find the edit button Duke Nukem General Discussion 9 12-09-2005 08:24 AM


All times are GMT. The time now is 02:41 PM.