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 Tue May 14, 2024 10:21 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: pips between two ema's
PostPosted: Tue Jan 18, 2011 3:01 pm 
Offline

Joined: Tue Jan 04, 2011 2:16 am
Posts: 7
hi molanis team,
i am trying to build a custom indicator with EMA 18 and EMA 50.
i wanna get a value for the vertical distance at time "i+1".
it is not important whether EMA 18 > EMA 50 or EMA 18 < EMA 50. i just wanna have a value between 0 (means EMA 18 + EMA = equal) or they are more or less different.

best regards,


Top
 Profile  
 
 Post subject: Re: pips between two ema's
PostPosted: Tue Jan 18, 2011 6:17 pm 
Offline

Joined: Tue Jan 04, 2011 2:16 am
Posts: 7
sorry for my bad english,
once again: i am trying to build a custom indicator with EMA 18 and EMA 50.
i wanna get a value for the vertical distance at time "i+1".
it is not important whether EMA 18 > EMA 50 or EMA 18 < EMA 50. i just wanna have a value between 0 (means EMA 18 + EMA = equal) to 20.

if both values are on the y-axis then: √((y1-y2)²).

is it possible to "translate" this formula to indicator builder?


Top
 Profile  
 
 Post subject: Re: pips between two ema's
PostPosted: Tue Jan 18, 2011 11:16 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
In the indicator builder, use the indicator button and insert an ma then (-) then the second ma. When inserting the indicators use shift = 1 to get the amounts for the previous bar.
For the rest of the formula use MathSqrt and MathPow
double MathSqrt( double x)
The MathSqrt function returns the square root of x. If x is negative, MathSqrt returns an indefinite (same as a quiet NaN).
double MathPow( double base, double exponent)
Returns the value of the base expression raised to the specified power (exponent value).


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