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 Sun Jun 16, 2024 12:14 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Trades not taken
PostPosted: Sat Mar 19, 2011 7:03 am 
Offline

Joined: Sun Jan 16, 2011 12:06 pm
Posts: 58
I am using a starategy in my demo account that uses awesome oscillator and stays in trade all the time during my selected trading hours. It is supposed to go in opposite direction at the same bar where it closes the lat trade. I am noticing it is not happening and it is not taking the new trade after closing exiting position. It is missing one trade before taking a new position.
Please help figuring out what is happening.

I am attaching my strategy

Thanx a lot :D :D :D :D


Attachments:
Awesome_Oscillator_Strategy.mol [11.62 KiB]
Downloaded 469 times
Top
 Profile  
 
 Post subject: Re: Trades not taken
PostPosted: Sat Mar 19, 2011 9:38 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
Sorry, I do not fully understand your issue. Please describe in detail your strategy (when to buy / sell)


Top
 Profile  
 
 Post subject: Re: Trades not taken
PostPosted: Sat Mar 19, 2011 10:39 am 
Offline

Joined: Sun Jan 16, 2011 12:06 pm
Posts: 58
OK, I buy when I get the blue bar on awesome osc & close long and sell at the same time when I get a red bar on awesome osc and keep doing it to trade in both directions during my specified trade hours. I stay in market 100% of the time during my selected trading hours.
I hope it explains my startegy well.

Thanks a lot


Top
 Profile  
 
 Post subject: Re: Trades not taken
PostPosted: Sun Mar 20, 2011 8:18 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
Please look at iAO mql documentation:

double iAO( string symbol, int timeframe, int shift)
Calculates the Bill Williams' Awesome oscillator and returns its value.
Parameters:
symbol - Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.
shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
Sample:
double val=iAO(NULL, 0, 2);

Note that there are no modes in the indicator so it gives you just one value. No way to tell the color of the line.
To do what you want, get the indicator code here http://codebase.mql4.com/251 then save it with another name. Compile it and then open the strategy builder and import it.
That indicator has 3 modes, one for the value (it does not draw), a second one for a green color, a third one for a red color. If you see the green line, the red line is zero (and vice-verse)

Unfortunately using this indicator the way you want it is more complex


Top
 Profile  
 
 Post subject: Re: Trades not taken
PostPosted: Mon Mar 21, 2011 9:38 am 
Offline

Joined: Sun Jan 16, 2011 12:06 pm
Posts: 58
Thanks for detailed reply. You guys are awesome. :D :D :D


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