I built this EA and I thought I put in the code to only make one trade per bar but it dont seem to be working. Sometimes it places more than one trade per bar. Could someone please help me figure out why? I'm checking with datetime and storing it in time.
//Enters a buy trade if the conditions are met
if(perGBP > perEUR && GbpEurDiff > gap && previousK < previousD && currentK > currentD && currentD < 20)
double GbpEurDiff = perGBP - perEUR; //Check to see if the difference is below zero
if(GbpEurDiff < 0)
GbpEurDiff = -GbpEurDiff; //if its below zero invert the negative to positive
double GbpEurDiff = MathAbs(perGBP - perEUR); //Check to see if the difference is below zero
Thank you whroeder1. Would I just return zero? return(0);