Tarea técnica
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
int OnInit()
{
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Script deinit function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
ObjectDelete(_Symbol);
}
//+------------------------------------------------------------------+
//| Script tick function |
//+------------------------------------------------------------------+
void OnTick()
{
double maFast, maSlow;
int idx = StartIndex();
if (_Symbol == "XAUUSD" || _Symbol == "EURUSD" || _Symbol == "USOIL")
{
maFast = iMA(_Symbol, PERIOD_M1, 13, 0, MODE_SMMA, PRICE_CLOSE, idx);
maSlow = iMA(_Symbol, PERIOD_M1, 26, 0, MODE_SMMA, PRICE_CLOSE, idx);
if (maFast > maSlow && maFast > maSlow)
{
int ticket = OrderSend(_Symbol, OP_BUY, 0.1, Ask, 3, Ask-20*Point, Ask+20*Point, "MyOrder", 0, 0, Green);
if (ticket > 0)
{
OrderModify(ticket, OrderOpenPrice(), OrderOpenPrice()-50*Point, OrderOpenPrice()+50*Point, 0, Blue);
Alert("Buy order sent!");
}
}
else if (maFast < maSlow && maFast < maSlow)
{
int ticket = OrderSend(_Symbol, OP_SELL, 0.1, Bid, 3, Bid+20*Point, Bid-20*Point, "MyOrder", 0, 0, Red);
if (ticket > 0)
{
OrderModify(ticket, OrderOpenPrice(), OrderOpenPrice()+50*Point, OrderOpenPrice()-50*Point, 0, Red);
Alert("Sell order sent!");
}
}
}
}
//+------------------------------------------------------------------+
//| Script properties |
//+------------------------------------------------------------------+
input string Expert_Title = "My Trading Bot";
input ulong Expert_MagicNumber = 22655;
input bool Expert_EveryTick = false;
input int Signal_ThresholdOpen = 10;
input int Signal_ThresholdClose = 10;
Han respondido
1
Evaluación
Proyectos
17
29%
Arbitraje
5
20%
/
40%
Caducado
1
6%
Libre
2
Evaluación
Proyectos
9
22%
Arbitraje
0
Caducado
0
Libre
Información sobre el proyecto
Presupuesto
30+ USD
Plazo límite de ejecución
de 10 a 15 día(s)