View Single Post
  #1 (permalink)  
Old 04-28-2007, 07:27 PM
ryanklefas's Avatar
ryanklefas ryanklefas is offline
Senior Member
 
Join Date: Apr 2006
Location: USA
Posts: 439
ryanklefas is on a distinguished road
MA Cross lovers... gather here!

I know that Moving Average cross systems are quite popular, so I made a generic one that can take whatever standard MA you want. An explanation of the features is in the source code, but I'll also post them here:




Code:
extern string    averages="==== MA Settings ====================";
extern int       FastPeriod=5;                   // Period for calculating MA
extern int       FastShift=0;                    // Shift the MA over X number of bars

extern int       FastType=0;                     // 0: Simple moving average
                                                 // 1: Exponential moving average
                                                 // 2: Smoothed moving average
                                                 // 3: Linear weighted moving average
                                                 
extern int       FastApplication=0;              // 0: Close price
                                                 // 1: Open price
                                                 // 2: High price
                                                 // 3: Low price
                                                 // 4: Median price, (high+low)/2
                                                 // 5: Typical price, (high+low+close)/3
                                                 // 6: Weighted close price, (high+low+close+close)/4
extern int       SlowPeriod=10;
extern int       SlowShift=0;
extern int       SlowType=0;
extern int       SlowApplication=0;

extern string    manage="==== Order Management ====================";
extern int       BreakEvenAtProfit=0;
extern int       BreakEvenShift=0;               // Move the breakeven point up or down around the order open price
extern int       TrailingStop=0;
extern bool      OnlyTrailAfterProfit=false;     // Trailing Stop will only trails when order is profitable

extern string    account="==== Account Settings ====================";
extern int       MinimumEquity=0;                // New orders will be disabled if equity drops below minimum
extern int       MinimumBalance=0;               // New orders will be disabled if balance drops below minimum

extern string    activity="==== EA Activity Settings ====================";
extern bool      DisableClosingOrders=false;    // If true, the order closing section of the EA will not run
extern bool      DisableNewOrders=false;        // If true, the order creating section of the EA will not run
extern int       ConcurrentOrdersMax=10;

extern string    id="==== Identity Settings ====================";
extern int       ExpertID=127792141;            // Magic number: for identifying an EA's orders
extern bool      TimeSpecific=false;            // If true, Time frames are considered in determining
                                                // whether an order belongs to the EA or not
extern string    ExpertName="Generic MA Cross";    // Expert name: for aesthetic purposes
Attached Files
File Type: mq4 Generic MA Cross Expert.mq4 (16.2 KB, 474 views)
__________________
"Don't work harder, work smarter." -- my Java professor

Coder for Hire:
http://www.firecell-fx.com

Last edited by ryanklefas; 06-30-2007 at 06:14 PM.
Reply With Quote