In intra day ,I wants to avoid first bar of the day for opening a new position. please help..
if( Interval() >= inDaily )
Error( "Set bar interval to intra-day one!" );
dn = DateNum();
avoiding_first_bar_of_day = ! (dn != Ref( dn, -1));
Buy = /*Your Buy rules here*/ AND avoiding_first_bar_of_day;
BTW, it is unclear whether you mean to avoid entry or signal at first bar and whether you are using trade entry delays.
So if you mean avoiding actual trade entry at first bar of day then adding a simple bar delay would do just that... avoiding entry at signal's bar (if you have no problem with signal occurring at first bar of day).
buy_rules = /*Your Buy rules here*/;
Buy = Ref(buy_rules, -1);
BuyPrice = Open;
4 Likes