Hi,
I want to create my own EA, but I am stuck because programming is not my forte.
I have created/copied a simple alert indicator with which I am happy, but instead of Comment SELL or BUY I want the EA to enter a trade.
Can someone please replace the comment part with the code necessary to enter an order? the first part about the variables is still commented because i don’t know how to proceed after “if” statement.
Keep ti simple please
//extern double TakeProfit = 50;
//extern double Lots = 0.2;
//extern double TrailingStop = 30;
//int OrderSend ("EURUSD",OP_SELL,0.2,ask,,Bid-50*Point,Bid+50*Point);
void OnTick()
{
double SlowMovingAverage = iMA(NULL,0,10,0, MODE_EMA,PRICE_CLOSE,0);
double LastSlowMovingAverage = iMA(NULL,0,10,0, MODE_EMA,PRICE_CLOSE,1);
double FastMovingAverage = iMA(NULL,0,20,0, MODE_EMA,PRICE_CLOSE,0);
double LastFastMovingAverage = iMA(NULL,0,20,0, MODE_EMA,PRICE_CLOSE,1);
if ((LastFastMovingAverage < LastSlowMovingAverage)
&& (FastMovingAverage > SlowMovingAverage))
Comment ("SELL");
if ((LastFastMovingAverage > LastSlowMovingAverage)
&& (FastMovingAverage < SlowMovingAverage))
Comment ("BUY");
}
Thanks in advance