as i don’t have any programing skills, i try to use the EA builder to make a simple EA utilizing EMA AND ENVELOPES crossover setup.
however, the setup simply is:
when the EMA > envelopes upper line —> buy
when the EMA < envelopes lower line —> sell
the problem i face with the EA builder is;
the EA keep buying one order after anther as long as the MA is > envelopes
the opposite is true for sell orders, there is no limit for the number of orders after each signal.
while i want it only to do a single one trade after each crossover and then wait for a new signal.
i think my problem is very easy, but not for someone who has no programing skills at all.
i would really appreciate any help to add this part to my EA code.
I’m sorry, but if you have no programming skills at all, you have no chance, sorry to be brutal but that is the truth, a successful EA eludes most of expert programmers with expert trading skills, your time will be better spent doing just about anything else.
well, thanks for reply.
so i think my post will be a message for the creator of the EA builder to add that function to his/her great tool.
then my EA would be perfect even though i have no idea about programing codes.
best wishes
// static so only set first time start() is called - put near beginning
static bool trading = false;
//assuming you are using set TP and SL and letting the system
//close the trades for you - in which case include this logic before
//you check for signals
//this will detect when TP or SL is hit and position is closed.
//it will also detect if trades are already open when you start the EA
//buy signal found - surround buy logic with this if statement
if(trading == false)
{
//go long OrderSend bit
trading = true;
}
//sell signal found - surround sell logic with this of statement
if(trading == false)
{
//go short OrderSend bit
trading = true;
}
// now u have logic to only open one trade on a signal
// and only one trade until it is closed by TP / SL
// if you use huge stops it will be possible to get for example
// a sell signal while original long is in red running towards
// huge stop. Stop will hit and system will take late sell signal
//if u use explicit logic to close trades then after the actual closes add