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 Sat Apr 27, 2024 12:06 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Prevent trading during high spread
PostPosted: Wed Dec 03, 2014 6:07 pm 
Offline

Joined: Thu Jun 23, 2011 5:06 pm
Posts: 54
Does any one know how to prevent trading during high spreads. I read a few things that indicate that the code must differentiate between 4 and 5 decimal currencies. But I haven't seen any specific code that I can drop into MQL icon to perform such. I would so much appreciate your help. Im looking for something generic so that I can use the "SYMBOL" parameter rather the having to input the specific currency. Or if you know someone who can code for cash to do this this will work also.


Top
 Profile  
 
 Post subject: Re: Prevent trading during high spread
PostPosted: Wed Dec 03, 2014 9:42 pm 
Offline
Site Admin

Joined: Fri Oct 16, 2009 3:40 pm
Posts: 451
Try this condition:
bid-ask > your limit


Top
 Profile  
 
 Post subject: Re: Prevent trading during high spread
PostPosted: Mon Dec 22, 2014 12:45 pm 
Offline

Joined: Thu Jun 23, 2011 5:06 pm
Posts: 54
Hi Thanks for replying to my question.

Did you mean to say "Bid-Ask<3.5" using the "Less than rather than greater than symbol. Im not a coder. But it looks like your code says to execute if the spread is greater than a certain value. Please explain.


Top
 Profile  
 
 Post subject: Re: Prevent trading during high spread
PostPosted: Sat Dec 27, 2014 11:23 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
If you join your spread condition with trading conditions using ANDs you should use
(Bid - Ask < amount) AND (...)
amount is a value not pips
See http://www.dailyfx.com/forex/education/ ... aders.html


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