Forex
Google
New signals service!

Go Back   Forex Trading > Downloads > Indicators - Metatrader 4


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack (1) Thread Tools Display Modes
  #31 (permalink)  
Old 07-04-2007, 08:32 PM
Member
 
Join Date: Dec 2006
Posts: 80
dwmcqueen is on a distinguished road
Crossing Indicators

I wrote an EA where it calculates the prior and current MA and checks to see whether it is crossing the current Ask price. To calculate the prior, I set the last parameter to 1 (as compared to zero) and just had an if statement that checked to see if prior was > or = Ask and if current was < Ask. This seems to work at times, but from what I understand the prior calc is based off the prior interval, not as it was calced based on the prior tick data, correct?

If so, is there a more precise method for checking when a crossing is occurring?

My specific code is as follows:

double CurrentInd = iMA(NULL, 0, 20, 0, MODE_SMA, PRICE_CLOSE, 0);
double PriorInd = iMA(NULL, 0, 20, 0, MODE_SMA, PRICE_CLOSE, 1);

[...]

if ((CurrentInd>= Ask) && (PriorInd< Ask))
{
Print ("Buy Order Triggered");
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #32 (permalink)  
Old 07-05-2007, 12:15 AM
Senior Member
 
Join Date: Nov 2006
Location: Ukraine
Posts: 491
Shinigami is on a distinguished road
PHP Code:
        if(iRSI(NULL,0,14,Price_model,1)<RSI14_Value_Buy_Open//open buy where rsi is lower than some value
         
{
          if(
iRSI(NULL,0,14,Price_model,1)>iRSI(NULL,0,14,Price_model,2)) //and RSI is going up
           
{
            if(
iRSI(NULL,0,5,Price_model,1)>iRSI(NULL,0,14,Price_model,1)+RSI5_Diff_Buy//and rsi5 is higher n points
             
{
              if(
iRSI(NULL,0,5,Price_model,1)>iRSI(NULL,0,5,Price_model,2))//rsi5 is going up
               
{
                if(
iRSI(NULL,0,5,Price_model,2)<iRSI(NULL,0,14,Price_model,2))//and they crossed
                
OrderSend(...);
               }
             }
           }
         } 
That is what I used to make an RSI cross. Hope that helps.
Price_model is an extern variable.

If you want a more precise way, check more than the previous bar. Like to find if they crossed in a flat period or if there was a move before.
__________________
MQL4 programming is easy ^^

Last edited by Shinigami; 07-05-2007 at 12:18 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #33 (permalink)  
Old 07-28-2007, 09:53 AM
Junior Member
 
Join Date: Mar 2007
Posts: 8
effilang is on a distinguished road
Moving Average Cross Oscillator

Hi there guys,

Is there anyway i can have two exponential moving averages, eg: 2 and 8 displayed as an oscillator.

I don't want them on my price chart, but rather at the bottom stacked next to RSI, Stochastics etc.

I can't seem to find an indicator for this.

I would greatly appreciate anyones assistance.

Best Regards,
E. Lang
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #34 (permalink)  
Old 07-28-2007, 10:03 AM
Beno's Avatar
Senior Member
 
Join Date: Aug 2006
Location: London
Posts: 285
Beno is on a distinguished road
This might be of use
Attached Files
File Type: mq4 rsi2ma.mq4 (2.8 KB, 387 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #35 (permalink)  
Old 07-28-2007, 10:53 AM
cja's Avatar
cja cja is offline
Senior Member
 
Join Date: Apr 2006
Posts: 557
cja is on a distinguished road
ema

Quote:
Originally Posted by effilang View Post
Hi there guys,

Is there anyway i can have two exponential moving averages, eg: 2 and 8 displayed as an oscillator.

I don't want them on my price chart, but rather at the bottom stacked next to RSI, Stochastics etc.

I can't seem to find an indicator for this.

I would greatly appreciate anyones assistance.

Best Regards,
E. Lang
Try this

ema.mq4
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #36 (permalink)  
Old 07-28-2007, 11:59 AM
Administrator
 
Join Date: Sep 2005
Posts: 16,260
Blog Entries: 105
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
Moving Average Cross Oscillator thread http://www.forex-tsd.com/indicators-...scillator.html
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #37 (permalink)  
Old 07-29-2007, 05:27 PM
Junior Member
 
Join Date: Mar 2007
Posts: 8
effilang is on a distinguished road
Thanx guys.

That worked out just fine

Happy Pippin!

Regards,
E. Lang
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #38 (permalink)  
Old 07-31-2007, 04:48 PM
iinzall's Avatar
Senior Member
 
Join Date: Apr 2007
Location: Pontianak - Indonesia
Posts: 107
iinzall is on a distinguished road
MTF Moving Average Cross

I've been looking for MTF moving average Cross in the MTF thread. I've searched it for the whole pages. There is none of it.
So, maybe someone is interested in making it in this thread
Cause, this indi will be one of the best indi, i think.....

Regards,

IIN
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #39 (permalink)  
Old 08-03-2007, 01:44 AM
dit dit is offline
Member
 
Join Date: Aug 2006
Posts: 81
dit is on a distinguished road
Indicators needed

Anyone can programme a moving average indicator consisting of simple MA and Exponential MA with cross alert.
__________________
PiPPin

http://privateforextrader.blogspot.com/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #40 (permalink)  
Old 08-03-2007, 02:28 AM
Member
 
Join Date: Aug 2006
Posts: 44
traderjai_inhi is on a distinguished road
Indicators with alert/signal
__________________
J

"Success is a journey, not a destination."
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
Cross

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/indicators-metatrader-4/1819-cross.html
Posted By For Type Date
MA Cross 3MACross Alert WarnSig - MQL4 Code Base Post #118 Refback 03-26-2008 04:40 PM

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ema Cross! codersguru Ema Cross 732 08-29-2008 05:34 AM
MA cross/Price cross MA EA Pipsta_UK Expert Advisors - Metatrader 4 5 05-10-2007 08:50 PM
3 MA cross demontaz Indicators - Metatrader 4 2 04-15-2007 06:24 AM
ema cross 1f4 General Discussion 5 05-21-2006 03:13 PM


All times are GMT. The time now is 09:13 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.