| New signals service! | |
|
|||||||
| 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 |
|
![]() |
|
|
LinkBack (1) | Thread Tools | Display Modes |
|
|||
|
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"); } |
|
|||
|
PHP Code:
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. |
|
|||
|
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 |
|
||||
|
ema
Quote:
ema.mq4 |
|
|||
|
Moving Average Cross Oscillator thread http://www.forex-tsd.com/indicators-...scillator.html
|
|
|||
|
Indicators needed
Anyone can programme a moving average indicator consisting of simple MA and Exponential MA with cross alert.
|
|
|||
|
__________________
J "Success is a journey, not a destination." |
![]() |
| Bookmarks |
| Tags |
| Cross |
| Thread Tools | |
| Display Modes | |
|
|
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 |