This will happen if the conditions are correct for opening on one TF, and correct for closing on another. First tick: ea yells, "Yippee. Something to do. I can send a trade" and does so. Next tick: ea yells, "Yippee. Something to do. I can close a trade" and does so. Next tick, ea yells..............................kwchau » Tue Jul 15, 2014 4:31 pm wrote:Based on Steve's Sell Twice into Trend EA, I have made some changes to the codes such that I can trigger trade based on W1 Stoch 7 and take profit when the D1 Stoch 7 reaches my threshold. There is no other exit strategies. I put the attached amended EA on a D1 chart. It runs ok all along but suddenly today, it keeped opening and closing trades until I removed it manually.![]()
My coding skill is nearly zero so I could not figure out what has gone wrong.
I hope I've made myself clear enough so that Steve or some coding gurus in this forum could help me to find out where are the problems and how I could overcome this opening and closing issue. Thanks guys in advance !
Try this. Go to line 909, insert a blank line and add this code:
Code: Select all
if (DailyStochMainClose > Stoch7ForExitLevel)Code: Select all
if (!SendLong)
{
//Short trade
//Specific system filters
if ((StoCrossStatus == crossshort70 && !Trade2Open) || (StoCrossStatus == crossshort90 && !Trade1Open))
if (DailyStochMainClose > Stoch7ForExitLevel)
// if (CloseEnough(DailyStochMain, 0))
// if(CloseEnough(WeeklyStochMain, 0)) //remove yellow and red line condition
SendShort = true;
}//if (!SendLong)