static int TicketNumber;
int OnInit() {
return (INIT_SUCCEEDED);
}
void OnDeinit(const int reason) {
}
void OnTick() {
if (OrdersTotal() == 0 && iRSI(Symbol(), 0, 14, PRICE_CLOSE, 0) > 30 && iRSI(Symbol(), 0, 14, PRICE_CLOSE, 1) <= 30) {
TicketNumber = OrderSend(Symbol(), OP_BUY, 0.1, Ask, 3, 0, 0, "EA", 1234, 0, Red);
}
if (OrdersTotal() > 0 && iRSI(Symbol(), 0, 14, PRICE_CLOSE, 0) >= 70) {
OrderClose(TicketNumber, 0.1, Bid, 3, Yellow);
}
}
暂无评论