Forex
Google
New signals service!

Go Back   Forex Trading > Discussion Areas > Metatrader 4


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 05-03-2006, 06:55 AM
WAW WAW is offline
Junior Member
 
Join Date: Dec 2005
Posts: 23
WAW is on a distinguished road
EA need yr support!

hi All

Can you please help me in coding my EA,

i need to place tow pending orders buystop and sellstop for each of the main currency pairs, at the same time,

when ever i try to code that it gave me error #130,
and always send one pending order buystop and never send the sellstop order at the same time

will u help please

Thansk in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-03-2006, 11:27 AM
WAW WAW is offline
Junior Member
 
Join Date: Dec 2005
Posts: 23
WAW is on a distinguished road
hi again

would u please help

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-03-2006, 12:00 PM
WAW WAW is offline
Junior Member
 
Join Date: Dec 2005
Posts: 23
WAW is on a distinguished road
Just to refresh my request ....

I do need yr help !

Thanks in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-03-2006, 12:17 PM
Senior Member
 
Join Date: Mar 2006
Posts: 787
Maji is on a distinguished road
Try using a sleep/pause function in a for loop to place your trades.

Maji
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-03-2006, 12:23 PM
WAW WAW is offline
Junior Member
 
Join Date: Dec 2005
Posts: 23
WAW is on a distinguished road
Quote:
Originally Posted by Maji
Try using a sleep/pause function in a for loop to place your trades.

Maji
Thanks Maji

but kindly where can i found example for the use of that function?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 05-03-2006, 01:32 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Quote:
Originally Posted by WAW
hi All

Can you please help me in coding my EA,

i need to place tow pending orders buystop and sellstop for each of the main currency pairs, at the same time,

when ever i try to code that it gave me error #130,
and always send one pending order buystop and never send the sellstop order at the same time

will u help please

Thansk in advance
Hi WAW,

The #130 error number means that you supplied an invalid stop, profit or price for the limit order.

To know the minimum pips you can set above/below the market price check the new pending order window (image attached) and it differs from broker to broker!
Attached Images
File Type: jpg ss.jpg (117.5 KB, 55 views)
__________________
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!
Reply With Quote
  #7 (permalink)  
Old 05-03-2006, 02:01 PM
WAW WAW is offline
Junior Member
 
Join Date: Dec 2005
Posts: 23
WAW is on a distinguished road
Quote:
Originally Posted by codersguru
Hi WAW,

The #130 error number means that you supplied an invalid stop, profit or price for the limit order.

To know the minimum pips you can set above/below the market price check the new pending order window (image attached) and it differs from broker to broker!
thanks Coderguru

but i did try to make a difference 10 and even 20 pips and still open only one buy or sell stop and not both orders in the same time?

here is the code :

if ( EAtotal<2 )
OrderSend(Symbol(),OP_SELLSTOP,Lots,S,3,Bid-SL*Point,Bid+TP*Point,"HOG",0,0,Red);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES )) Print("BUY order opened : ",OrderOpenPrice());
}
else Print("Error opening BUY order : ", GetLastError());
return(0);

RefreshRates();
OrderSend(Symbol(),OP_SELLSTOP,Lots,b,2,Bid-SL*Point,Bid+TP*Point,"HOG",0,0,Red);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES )) Print("SELL order opened : ",OrderOpenPrice());
}
else Print("Error opening SELL order : ",GetLastError());
return(0);
}
}
return(0);
}

hope you help me to adujust it

Thanks in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 05-03-2006, 02:18 PM
Senior Member
 
Join Date: Mar 2006
Posts: 787
Maji is on a distinguished road
Quote:
Originally Posted by WAW
thanks Coderguru

but i did try to make a difference 10 and even 20 pips and still open only one buy or sell stop and not both orders in the same time?

here is the code :

if ( EAtotal<2 )
OrderSend(Symbol(),OP_SELLSTOP,Lots,S,3,Bid-SL*Point,Bid+TP*Point,"HOG",0,0,Red);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES )) Print("BUY order opened : ",OrderOpenPrice());
}
else Print("Error opening BUY order : ", GetLastError());
return(0);

RefreshRates();
OrderSend(Symbol(),OP_SELLSTOP,Lots,b,2,Bid-SL*Point,Bid+TP*Point,"HOG",0,0,Red);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES )) Print("SELL order opened : ",OrderOpenPrice());
}
else Print("Error opening SELL order : ",GetLastError());
return(0);
}
}
return(0);
}

hope you help me to adujust it

Thanks in advance
WAW,

If you email me the code I can take a look at it. My email address is tradermaji at cox dot net

Thanks,
Maji
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 05-03-2006, 02:30 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Quote:
Originally Posted by WAW
thanks Coderguru

but i did try to make a difference 10 and even 20 pips and still open only one buy or sell stop and not both orders in the same time?

here is the code :

if ( EAtotal<2 )
OrderSend(Symbol(),OP_SELLSTOP,Lots,S,3,Bid-SL*Point,Bid+TP*Point,"HOG",0,0,Red);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES )) Print("BUY order opened : ",OrderOpenPrice());
}
else Print("Error opening BUY order : ", GetLastError());
return(0);

RefreshRates();
OrderSend(Symbol(),OP_SELLSTOP,Lots,b,2,Bid-SL*Point,Bid+TP*Point,"HOG",0,0,Red);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES )) Print("SELL order opened : ",OrderOpenPrice());
}
else Print("Error opening SELL order : ",GetLastError());
return(0);
}
}
return(0);
}

hope you help me to adujust it

Thanks in advance
Some borkers prevents more than 1 pending orders (NothFinance is an example), Could you try it with Fibo Group?
__________________
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!
Reply With Quote
  #10 (permalink)  
Old 05-03-2006, 02:30 PM
WAW WAW is offline
Junior Member
 
Join Date: Dec 2005
Posts: 23
WAW is on a distinguished road
Quote:
Originally Posted by Maji
WAW,

If you email me the code I can take a look at it. My email address is tradermaji at cox dot net

Thanks,
Maji
Appreciate your reply but i have already attached the code in my previous post

here it is again :

if ( EAtotal<2 )
OrderSend(Symbol(),OP_SELLSTOP,Lots,S,3,Bid-SL*Point,Bid+TP*Point,"HOG",0,0,Red);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES )) Print("BUY order opened : ",OrderOpenPrice());
}
else Print("Error opening BUY order : ", GetLastError());
return(0);

RefreshRates();
OrderSend(Symbol(),OP_SELLSTOP,Lots,b,2,Bid-SL*Point,Bid+TP*Point,"HOG",0,0,Red);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES )) Print("SELL order opened : ",OrderOpenPrice());
}
else Print("Error opening SELL order : ",GetLastError());
return(0);
}
}
return(0);
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

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 On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Support! codersguru Metatrader 4 mql 4 - Development course 53 04-17-2006 05:49 AM


All times are GMT. The time now is 09:59 AM.



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