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 Mon May 13, 2024 12:22 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Trading Bollinger bounces (Touches) - 5 pips from bands
PostPosted: Tue Jul 24, 2012 3:32 am 
Offline

Joined: Tue Jul 24, 2012 2:15 am
Posts: 5
Hi all.

Not sure if anyone can help me with this. I have not been able to find a similar topic on the forums.

I currently manually trade off the 9ma bollinger bands. I buy when (in addition to other conditions) price is within 5 pips from the lower band and sell when price is within 5 pips from the upper band (2 STD).

I have been battling to create an EA for this. If I remove the 5 pips condition, it seems to work fine, but I miss quite a few trades.

To cut the story short, I have attached the EA. I have used the MQL function so I can add something like lowerband+50 (since my broker uses 5 digits). However, this seems to open very random trades everywhere. When I change it to lowerband+5, it opens no trade.

So is there some way to include an integer (eg 5 pips) within the condition that uses the bands?

For now, I have only done the 'Buy' part. Once I am done with the Buy, the Sell will be easy.


Attachments:
BolingerOse-part worked.mol [10.67 KiB]
Downloaded 482 times
Top
 Profile  
 
 Post subject: Re: Trading Bollinger bounces (Touches) - 5 pips from bands
PostPosted: Sat Jul 28, 2012 9:41 am 
Offline
Site Admin

Joined: Fri Oct 16, 2009 3:40 pm
Posts: 451
You use MarketInfo(Symbol(),MODE_ASK-5) and it should be MarketInfo(Symbol(),MODE_ASK)-0.0005 (for EURUSD), you enter the pip value in money terms so do not use 5 but 0.0005


Top
 Profile  
 
 Post subject: Re: Trading Bollinger bounces (Touches) - 5 pips from bands
PostPosted: Tue Jul 31, 2012 3:01 am 
Offline

Joined: Tue Jul 24, 2012 2:15 am
Posts: 5
Thanks a million!

I cant believe I didn't notice my error!

Thanks. It's worked.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 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