EMA FAN Requirements: 1. General Requirements: The EMA FAN is a trend based EA. It is designed to recognize when a perfect “FAN” is created using 6 EMAs. The open is determined by measuring the distance from EMA1 and ema6. Then it needs an external variable “OpenTrade” to determine when to enter a Long or Short trade. The ticket is monitored each tick to determine the distance between EMA1 and EMA6. When this distance starts to shrink the trade is closed. A second close signal is used for extreme market rises and falls. This is a “CloseTrade” external variable. I would like to have the source code when finished. 2. Open Trades: The 6 EMA’s are external variables used in optimization for these requirements they are defined below: double ema1 = iMA(NULL,PERIOD_CURRENT, 10,MODE_EMA,PRICE_CLOSE,EMA_1_P); double ema2 = iMA(NULL,PERIOD_CURRENT, 20,MODE_EMA,PRICE_CLOSE,EMA_2_P); double ema3 = iMA(NULL,PERIOD_CURRENT, 30,MODE_EMA,PRICE_CLOSE,EMA_3_P); double ema4 = iMA(NULL,PERIOD_CURRENT, 40,MODE_EMA,PRICE_CLOSE,EMA_4_P); double ema5 = iMA(NULL,PERIOD_CURRENT, 50,MODE_EMA,PRICE_CLOSE,EMA_5_P); double ema6 = iMA(NULL,PERIOD_CURRENT, 60,0,MODE_EMA,PRICE_CLOSE,EMA_6_P); as an example: * EMABuy = (ema1 - ema6) * EMASell = (ema6 - ema1) Let’s say that: * EMABuy = 0.000055 or * EMASell = 0.000075 Then, for the long position: * the value is then measured against the OpenTrade external variable. Let’s say that variable is 0.000057. * As the EMABuy increases and is >= Open Trade, a trade is opened. * The same would be for the short positions. **Only one trade should be opened at a time Long and short positions can vary so having Open and close Trade Long and Short extern variables would be important. 3. Closing Trades: Conditions are: 1. Stop Loss a. External Variable b. external option to use 2. Take Profit a. External Variable b. external option to use 3. Trailing Stop a. External Variable b. external option to use 4. CloseTrade Extern Variable a. The close trade variable is input by the user and can be optimized. b. It is used exactly as the OpenTrade variable when entering the trade. c. It is used as a failsafe for the next close signal 5. EMABuy or EMASell values reduction 3 times in a row. 6. When the EMABuy or EMASell value reduces 3 ticks in a row then the order should be closed. As an example: * EMABuy opened a trade at 0.000057. it can increased or remain the same. But, let’s say it has increased to 0.000060. * On the next tick, the value decreases to 0.000059. * One the next tick, the value decreases to 0.000055. * One the next tick, the value decreases from 0.000055 to 0.000051 * In this example the EMABuy has fallen for 3 straight ticks in a row and the order should be closed. * If the value falls and then goes back up again the order should never be closed. 4. Additional Requirements: * Extern Magic # that should appear in the trade comments * Extern Trade Start Time * Extern Trade Stop Time * Extern Slippage 5. Optional Requirements: * Should the EMABuy or EMASell values reach a big distance between them, determined by an extern variable, then the EA should make one additional trade at double the lot size as the open trade. * This is the only exception to the one trade at a time rule.