MA slope Follow EA
- Experts
- Yuzuki Kiyoshi
- Version: 1.0
- Activations: 5
This EA works on logic using MA (moving average).
It is intended to work primarily with USDJPY.
Therefore, it works relatively effectively with cross yen pairs, but we cannot guarantee that it will work with other currency pairs. (However, it may be effective depending on optimization.)
In addition, please do not use this EA in conjunction with other EAs as there is a very high possibility that it will behave unexpectedly if used at the same time.
The initial parameters are for the USDJPY currency pair and were optimized in my environment.
It is believed that it will function to some extent in this state, but please be sure to thoroughly backtest and optimize it in your own environment before running it in a production environment.
Below you will find a brief description of the EA's parameters.
int EXPERT_MAGIC=45628
> EA magic number
ENUM_TIMEFRAMES Time=PERIOD_M30
> Time frame for running the EA
This is only the time frame of the EA and is independent of the time frame of the execution environment.
int Deviation=10
> Maximum price deviation
bool Lot_Control=true
> An order method that automatically determines the quantity to achieve the specified leverage
If true, calculate the quantity as above.
If false, the order will be placed in the quantity (lot) specified in the lots parameter below. (Fixed lot method)
double lots=0.01
> Number of lots when Lot_Control=false
double Leverage=5
> Leverage when Lot_Control=true
bool EnableSL=false
> Deciding whether to set a stop loss
Unlike the EnableUpSL mode, a Stop Loss is set only at the time of placing an order.
double slpips=150
> Stop loss value (in pips)
bool EnableUpSL=false
> When the price moves in the direction of making a profit (if it is a buy order, the price is hitting a new high), set the stop loss to be raised
double Sldistance=200
> Distance between the current price and the stop loss (in pips)
int en1MaPeriod=12
int en2MaPeriod=28
> Setting the average number of days for the MA used when entering
int ex1MaPeriod=40
int ex2MaPeriod=24
> Setting the average number of days for the MA to be used at the time of exit
ENUM_MA_METHOD en1MaMode=MODE_LWMA
ENUM_MA_METHOD en2MaMode = MODE_SMA
> Setting the type of MA to be used when entering
ENUM_MA_METHOD ex1MaMode=MODE_SMMA
ENUM_MA_METHOD ex2MaMode = MODE_EMA
> Setting the type of MA to be used at exit
Enum_BuySellType BuySellType=Buy
> Buy is for buying orders only, Sell is for selling orders only, BuySell is for both buying and selling
When to Optimize
・MaPeriod
・MaMode
Please make this your focus.
As per the initial settings, we recommend setting the stop loss to false.
Also, although we recommend using 30-minute and 1-hour time frames, it also works with 5-minute and other time frames, so please try them out.
However, if you change the time frame, make sure to optimize it for that time frame before running it.
<Caution and Request>
I am still inexperienced and not confident that I have created a complete EA, so as I have said many times, please make sure to optimize it sufficiently before running it in a production environment.
Also, if you have any questions or suggestions for improvement, we would be happy to hear from you.