Disliked{quote} You mean like employment etc with conflicts. Great idea! How do you change this ea to make limit orders instead of stops? Need to manipulate the code?Ignored
void OpenSelllimit()
{
int ticket,tries;
tries = 0;
if (!GlobalVariableCheck("InTrade")) {
while (tries<3)
{
GlobalVariableSet("InTrade", CurTime()); // set lock indicator
ticket = OrderSend(Symbol(),OP_SELLLIMIT,LotsOptimized(),ho,1,hso,htp,TradeComment,Magic,0,Red);
Write("OpenSelllimit, OrderSend Executed, @ "+ho+" SL @ "+hso+" TP @ "+htp+" ticket="+ticket);
GlobalVariableDel("InTrade"); // clear lock indicator
if (ticket<=0) {
Write("Error Occurred : "+ErrorDescription(GetLastError()));
tries++;
} else tries = 3;
}
}
}
void OpenBuyLimit()
{
int ticket,tries;
tries = 0;
if (!GlobalVariableCheck("InTrade")) {
while (tries<3)
{
GlobalVariableSet("InTrade", CurTime()); // set lock indicator
ticket = OrderSend(Symbol(),OP_BUYLIMIT,LotsOptimized(),lo,1,lso,ltp,TradeComment,Magic,0,Green);
Write("OpenBuyLimit, OrderSend Executed, @ "+lo+" SL @ "+lso+" TP @ "+ltp+" ticket="+ticket);
GlobalVariableDel("InTrade"); // clear lock indicator
if (ticket<=0) {
Write("Error Occurred : "+ErrorDescription(GetLastError()));
tries++;
} else tries = 3;
}
}
and change Low with High and High with Low:
string Comment1=StringConcatenate("High @ ",DoubleToStr(h,Digits)," SellOrder @ ",DoubleToStr(ho,Digits)," StopLoss @ ",DoubleToStr(hso,Digits)," TakeProfit @ ",DoubleToStr(htp,Digits));
string Comment2=StringConcatenate("Low @ ",DoubleToStr(l,Digits)," BuyOrder @ ",DoubleToStr(lo,Digits)," StopLoss @ ",DoubleToStr(lso,Digits)," TakeProfit @ ",DoubleToStr(ltp,Digits));
Compile it if there is no error it will work well.