#11 (permalink)  
Old 07-01-2005, 07:50 PM
Freshman
 
Join Date: Jun 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
keris2112 is on a distinguished road
Default

Quote:
Originally Posted by rondio
Scorp,
is there a simple way to add a time function to a ma a cross? i had tried many variations on the code below, but i can not get it to work. seems like it should not be that hard. any ideas?

// Check for BUY, SELL, and CLOSE signal
IsBuying = (ma2_0 > ma3_0 >= (15)Minute);
IsSelling = (ma2_0 < ma3_0 >= (15)Minute);

the logic i am trying to code is to buy if ma 2 is greater than ma3 for 15 minutes or more.
You could do something like this in MT4. I don't know exactly how to code it, but you should be able to use the TimeSeconds(CurTime()) function to set maXtime = TimeSeconds(CurTime()) at the time of the cross, then keep checking to see if TimeSeconds(CurTime()) - maXtime >= 900 seconds.

Keris

Hope this helps. Sorry I can't give you the code exactly, but hopefully one of the coders here can use what I've posted.

Last edited by keris2112 : 07-01-2005 at 08:03 PM.
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nested If statement - 3 Conditions Dave77 Tutorials, Tips & Tricks 0 08-18-2006 08:55 AM
Help needed for MQLII audible Alarm statement Dave77 MetaTrader and ZeroCode 3 08-31-2005 03:47 AM
RSI - MQL II Indicator Statement Problem Dave77 MetaTrader and ZeroCode 2 07-17-2005 12:33 AM
Indicator Statement Question 2 Dave77 MetaTrader and ZeroCode 1 06-19-2005 06:33 AM


All times are GMT. The time now is 01:09 PM.
Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0

Registered members have access to special online forex currency trading tools, software, mt4 expert advisors and indicators. Register now