molanis.com/forum - Tools for MetaTrader : The place to ask about the best expert advisor builder, expert advisor downloads, and expert advisor programming

AFTER YOU REGISTER SEND US AN EMAIL TO ACTIVATE YOUR ACCOUNT - Before posting:-1- Please read the user guide -2- Try the examples -3- Search in the forum
It is currently Thu May 16, 2024 8:02 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: MQL4 Code Price in between
PostPosted: Tue Apr 16, 2013 7:10 am 
Offline

Joined: Fri Jul 27, 2012 12:08 am
Posts: 14
I'm designing a new EA that has multiple pending orders. However since the DeleteP function cant be connected to an AND operator I need to custom code an MQL block. Basically when the price is between 2 variables (prices) the pending order needs to be closed.

If I just use one variable it works, but with 2 it doesnt? I dont know anything about programming can someone steer me in the right direction?

I used the following code:

Code:
MODE_BID>1.0000 && MODE_BID<1.0100
(So if the price is between 1.0000 and 1.0100 the pending order needs to be closed)

Thanks in advance for the help!


Top
 Profile  
 
 Post subject: Re: MQL4 Code Price in between
PostPosted: Tue Apr 16, 2013 8:44 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
You should put each condition on a TA and then join them using an AND. Connect the AND to pending. No need to code


Top
 Profile  
 
 Post subject: Re: MQL4 Code Price in between
PostPosted: Tue Apr 16, 2013 11:54 pm 
Offline

Joined: Fri Jul 27, 2012 12:08 am
Posts: 14
The AND function does not connect to the DELETEP function unfortunately. But no worries I found the code luckily! It should be MarketInfo(Symbol(),MODE_BID in stead of just MODE_BID


Top
 Profile  
 
 Post subject: Re: MQL4 Code Price in between
PostPosted: Wed Apr 17, 2013 9:52 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
Sorry for that. The AND should connect to DeleteP. we will fix that in the next beta (for next week)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by Molanis © 2009