Forex
Google
New signals service!

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions


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 (2) Thread Tools Display Modes
  #1191 (permalink)  
Old 06-24-2008, 01:42 PM
Junior Member
 
Join Date: Oct 2006
Posts: 12
forexcel is on a distinguished road
S.O.S: Problem with Buy_STOP/Sell_STOP

Hello all,
I'd like to have a buystop and a sellstop taken at the same time. The buystop is always triggered, but the sellstop is only triggered for one second and disappeared leaving only the buystop. How do I correct that? Do I need to post some other parts of the code in order for you to help?

Thanks in advance for helping me.

Regards,

forexcel



Code:
if(position && lastsig!=1) {
co=CalculateCurrentOrders(Symbol()) ;
if (co==0) {
res = OpenStop(OP_BUYSTOP,LotsRisk(StopLo ss), High[shift]+OrderPipsDiff*Point, StopLoss, TakeProfit1);
res = OpenStop(OP_SELLSTOP,LotsRisk(StopL oss),Low[shift]-OrderPipsDiff*Point, StopLoss, TakeProfit2);
}
last=Time[0];
lastsig=1;
return;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1192 (permalink)  
Old 06-24-2008, 01:58 PM
IN10TION's Avatar
Senior Member
 
Join Date: Mar 2007
Posts: 510
Blog Entries: 1
IN10TION is on a distinguished road
:: use your code that only send out one order (a buy or a sell), when you have a confirmation that first one is accepted, start the second request (in your case the opposite then the first one)

:: you can NOT send two requests at ones.
Quote:
Originally Posted by forexcel View Post
Hello all,
I'd like to have a buystop and a sellstop taken at the same time. The buystop is always triggered, but the sellstop is only triggered for one second and disappeared leaving only the buystop. How do I correct that? Do I need to post some other parts of the code in order for you to help?

Thanks in advance for helping me.

Regards,

forexcel



Code:
if(position && lastsig!=1) {
co=CalculateCurrentOrders(Symbol()) ;
if (co==0) {
res = OpenStop(OP_BUYSTOP,LotsRisk(StopLo ss), High[shift]+OrderPipsDiff*Point, StopLoss, TakeProfit1);
res = OpenStop(OP_SELLSTOP,LotsRisk(StopL oss),Low[shift]-OrderPipsDiff*Point, StopLoss, TakeProfit2);
}
last=Time[0];
lastsig=1;
return;
__________________
..updated 4.Oct.08.. IN10TION newsReader v09.84 Lite - the best news reader on your chart
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1193 (permalink)  
Old 06-24-2008, 02:15 PM
Junior Member
 
Join Date: Oct 2006
Posts: 12
forexcel is on a distinguished road
Quote:
Originally Posted by IN10TION View Post
:: use your code that only send out one order (a buy or a sell), when you have a confirmation that first one is accepted, start the second request (in your case the opposite then the first one)

:: you can NOT send two requests at ones.
Thanks for your reply In10TION...

Can you code it for me, please?

Thanks

forexcel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1194 (permalink)  
Old 06-24-2008, 02:26 PM
Administrator
 
Join Date: Sep 2005
Posts: 16,259
Blog Entries: 105
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 may use this script (attached) to place 2 pending orders.
Attached Files
File Type: mq4 Set2StopOrders.mq4 (3.9 KB, 9 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1195 (permalink)  
Old 06-24-2008, 02:41 PM
IN10TION's Avatar
Senior Member
 
Join Date: Mar 2007
Posts: 510
Blog Entries: 1
IN10TION is on a distinguished road
:: is this script working ok? Would be strange because there also, the orders are send together, or shortly after each other, they don't wait for conformation. I think it will make faults sometimes.

:: sorry forexcel, but not have the time... I think you can figure it out? eat some brain food...
little tip: start with only buys... when that is working, do sell at a next tick when you have confirmation when your buy is ok.
Quote:
Originally Posted by newdigital View Post
You may use this script (attached) to place 2 pending orders.
__________________
..updated 4.Oct.08.. IN10TION newsReader v09.84 Lite - the best news reader on your chart

Last edited by IN10TION; 06-24-2008 at 02:43 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1196 (permalink)  
Old 06-24-2008, 02:48 PM
Administrator
 
Join Date: Sep 2005
Posts: 16,259
Blog Entries: 105
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
yes, it is sending buy and sell pending orders almost together with 1 or 3 seconds interval (on demo). On real account may be more.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1197 (permalink)  
Old 06-25-2008, 02:27 AM
Senior Member
 
Join Date: Oct 2007
Posts: 216
Dave137 is on a distinguished road
Cool

How can you put the RSI of another Currency on a graph so that both currency RSI show up on on graph?? So that the RSI of EURUSD and GBPUSD show on the EURUSD graph?

Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1198 (permalink)  
Old 06-25-2008, 06:30 AM
Administrator
 
Join Date: Sep 2005
Posts: 16,259
Blog Entries: 105
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
Indicator is on this post http://www.forex-tsd.com/180575-post2.html
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1199 (permalink)  
Old 06-25-2008, 03:20 PM
Junior Member
 
Join Date: Dec 2007
Posts: 13
amatrader is on a distinguished road
Hi folks,

I'm looking for some code that will send me a copy of my statement for a preset period, for example once a week or, once a month. It must be able to send it to an address that I enter in the code if that's possible.

I found this piece of code here in the forum, can someone show me how to make it send my statement to any address.

Quote:
bool mail;
int start(){
if (Hour()>=23 && !mail){
SendMail("DLMod1", "Account Balance is-"+DoubleToStr(AccountBalance(),2)+"_Account Equity is-"+DoubleToStr(AccountEquity(),2)+
"_Account Profit is-"+DoubleToStr(AccountProfit(),2)+"_Account Margin is-"+DoubleToStr(AccountMargin(),2)+
"_Account Free Margin is-"+DoubleToStr(AccountFreeMargin(),2));
mail=true;
}
if(Hour()<23)mail=false;
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1200 (permalink)  
Old 06-25-2008, 11:21 PM
Senior Member
 
Join Date: Oct 2007
Posts: 216
Dave137 is on a distinguished road
Smile

Quote:
Originally Posted by newdigital View Post
Thanks much NewDigital!

Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
histogram, forex

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

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/questions/270-ask.html
Posted By For Type Date
OzFx System:) - Page 639 This thread Refback 06-21-2008 09:53 PM
Forex SRDC Sidus Sibkis EA MT4 Forum OTCSmart This thread Refback 12-08-2007 11:46 AM


All times are GMT. The time now is 07:17 AM.



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