input double LOT = 0.01;
input int SLIP = 1;
input int MAGIC = 12345;
static int TicketNumber;
int OnInit() {
return (INIT_SUCCEEDED);
}
void OnDeinit(const int reason) {
}
void OnTick() {
if (OrdersTotal() == 0 && Hour() == 10) {
TicketNumber = OrderSend(Symbol(), OP_BUY, LOT, Ask, SLIP, 0, 0, "BUY", MAGIC, 0, clrRed);
}
if (OrdersTotal() > 0 && Hour() == 12) {
bool Exit = OrderClose(TicketNumber, LOT, Bid, SLIP, clrDodgerBlue);
}
}
暂无评论