I want to code an EA that sends 2 pending orders at a specific hour at day, lets say, at 8am: a buylimit order 10 pips above the last day's minimum and a selllimit order 10 pips below the last day's maximum, both with 20 pips of SL and 90 pips of TP, but I don't know how , here is my temporal code, but it sends thousands of orders, I only want 1 per day, please help me:
double H, L;
int tiket_buy, tiket_sell;
H = iHigh(NULL, PERIOD_H1, 24);
L = iLow(NULL, PERIOD_H1, 24);
Print("LOW: ", L, " HIGH: ", H);
tiket_sell = OrderSend(Symbol(),OP_SELLLIMIT,0.1,H-0.001,5,H+0.002,H-0.009,"SELLLIMIT",10000,0,Red);
tiket_buy = OrderSend(Symbol(),OP_BUYLIMIT,0.1,L+0.001,5,L-0.002,L+0.009,"BUYLIMIT",20000,0,Green);
double H, L;
int tiket_buy, tiket_sell;
H = iHigh(NULL, PERIOD_H1, 24);
L = iLow(NULL, PERIOD_H1, 24);
Print("LOW: ", L, " HIGH: ", H);
tiket_sell = OrderSend(Symbol(),OP_SELLLIMIT,0.1,H-0.001,5,H+0.002,H-0.009,"SELLLIMIT",10000,0,Red);
tiket_buy = OrderSend(Symbol(),OP_BUYLIMIT,0.1,L+0.001,5,L-0.002,L+0.009,"BUYLIMIT",20000,0,Green);