static int TicketNumber;
int OnInit() {
return (INIT_SUCCEEDED);
}
void OnDeinit(const int reason) {
}
void OnTick() {
if (iOpen(Symbol(), 0, 1) < iClose(Symbol(), 0, 1) &&
iOpen(Symbol(), 0, 2) < iClose(Symbol(), 0, 2) &&
iOpen(Symbol(), 0, 3) < iClose(Symbol(), 0, 3)) {
TicketNumber = OrderSend(Symbol(), OP_BUY, 0.1, Ask, 3, 0, 0, "EA", 1234, 0, Red);
}
if (OrdersTotal() > 0 && (Hour() == 6 || Hour() == 18)) {
OrderClose(TicketNumber, 0.1, Bid, 3, Yellow);
}
}
暂无评论