Please, help with EA daily high low

 
Hello,

I program EA based on daily high-low. Program enters with the help of indicator induced through iCustom. I have a problem that I'm open position immediately on the first candle. I want it opened on another candle from the new daily high-low.
I attach files.

Thank you for any help or advice. :-)
Zadejte text nebo adresu webu nebo přeložte dokument.
Příklad použití slova :
Automaticky přeloženo Googlem
Files:
daydream.mq4  2 kb
 
And indicator
 
petrincak: I have a problem that I'm open position immediately on the first candle. I want it opened on another candle from the new daily high-low.
  1. So wait for the start of a new day
    #define HR2400 86400       // 24 * 3600
    int      TimeOfDay(datetime when){  return( when % HR2400          );         }
    datetime DateOfDay(datetime when){  return( when - TimeOfDay(when) );         }
    datetime Today(){    return(DateOfDay( TimeCurrent() ));                      }
    datetime Tomorrow(){ return(Today() + HR2400);                                }
    
    datetime NextTrade; 
    int init(){ NextTrade = Tomorrow(); }
    int start(){
       if(Today() < NextTrade) return; // Wait until new day
       :
       if(...){
           OrderSend(...); 
           NextTrade = Tomorrow();     // Opened an order, no more today.
  2. Your iCustom calls are the current day not previous day. Thus Close[0] will ALWAYS be between hi/lo
 
Thank you for your answer and idea. But I want trade currnet daily HL. Because I Trade on Renko chart, I want to program the new value of the daily high, for the next candle, which will open <DailyH opened sell. And after open>DialyL the same.
 
This is my manual system. And I want it convert to EA. :)