InvestorsHub Logo
Post# of 102
Next 10
Followers 38
Posts 9736
Boards Moderated 2
Alias Born 06/03/2007

Re: SherriT post# 70

Monday, 06/01/2009 6:41:25 PM

Monday, June 01, 2009 6:41:25 PM

Post# of 102
This is what I am using Sherri, when I was using strictly indicators I found that sometimes the EA would execute multiple times 20 seconds apart or so. I set the time variable at init and then flag it after every trade. I have it set here for a min of 900 seconds (15 minutes) between trades.

if(OT<1 && TT==True) //Are any orders open already?
{
//SHORT ENTRY
if(down==True && IsTradeAllowed()==True && TimeCurrent()>time+900)
{
int shortticket=OrderSend(Symbol(),OP_SELL,lots,Bid,slippage,SNSL,SNTP,"Short Order Being Placed ",magicnumber,0,Red);
if(shortticket<0)
{
Print("Short Order Send failed - error #",GetLastError());
}
if(shortticket>0)
{
if(OrderSelect(shortticket,SELECT_BY_TICKET,MODE_TRADES))
entry=OrderOpenPrice();
time=TimeCurrent();
Print("SELL order opened : ",OrderOpenPrice(),"|| Target Price : ",entry-scalp);
}
return(0);
}

"remember the mayonaise jar...keep cool but don't freeze"

Join the InvestorsHub Community

Register for free to join our community of investors and share your ideas. You will also get access to streaming quotes, interactive charts, trades, portfolio, live options flow and more tools.