Can someone help me on this EA?

 

I want the attached EA to be placing order once per day if the signal occure between the hour stipulated in the i.e 7 a.m to 17 p.m which its did but i discoverd that it place order more than one between the period if the signal occure and i do not no what to do.

This is how i want it to place buy order: when new day formed, i will like it to wait till 7a.m(gmt+1) then it will calculate the highest of five previous candles plus five pips if the price break it then it places buy order and reverse is the case for sell .But in case its has placed buy order and the signal for sell order occured i want it to place it has well ( i.e hedge)but if it does not occure, its should not place it .So it is going to be one order per day on a pair or two per day if there is hedging. Please that if what i meant by my EA but am not geting it accurately.Kindly help.


            
Files:
 

IMO you need to make your code more readable if you want others to look at it and help you . . sorry but it is very, very bad . . .

  • Virtually no comments
  • Non-descriptive variable names
  • Non-descriptive function names
  • Indenting for { } all over the place

To help with your problem:

Set a variable TradeAllowed = true;

Only place an order if this is true . . . if (TradeAllowed) . . . do code to place order

After the code has placed the order set TradeAllowed = false;

When the day changes to the next day, set TradeAllowed = true;

Reason: