Please use this to post code . . . it makes it easier to read.
So if the Order fails, iTicket < 0, what do you do ? nothing, why don't you report the error then you might know what is going on . . .
iTicket = OrderSend(Symbol(), OP_BUY, GetLots(SL), Ask, Slippage, 0, 0, "", MagicNumber, 0, Blue); if(iTicket > 0) { OrderModify(iTicket, OrderOpenPrice(), sl, tp, 0, CLR_NONE); }And you can NOT use OrderOpenPrice() until you do a OrderSelect()
RaptorUK:
So if the Order fails, iTicket < 0, what do you do ? nothing, why don't you report the error then you might know what is going on . . .
Please use this to post code . . . it makes it easier to read.
So if the Order fails, iTicket < 0, what do you do ? nothing, why don't you report the error then you might know what is going on . . .
What editor are you using
RaptorUK:
So if the Order fails, iTicket < 0, what do you do ? nothing, why don't you report the error then you might know what is going on . . .
Please use this to post code . . . it makes it easier to read.
So if the Order fails, iTicket < 0, what do you do ? nothing, why don't you report the error then you might know what is going on . . .
What toolbar has the SRC button?
bluesman:
What editor are you using
What toolbar has the SRC button?
What editor are you using
What toolbar has the SRC button?
I am confused...I see the toolbar but what is the trick to getting code to format correctly? Sorry...I've done this before but just can't friggin remember....
bluesman:
I am confused...I see the toolbar but what is the trick to getting code to format correctly? Sorry...I've done this before but just can't friggin remember....
I am confused...I see the toolbar but what is the trick to getting code to format correctly? Sorry...I've done this before but just can't friggin remember....
Compose a message, click the SRC button, paste your code into the window/box that appears, then click Insert at the bottom right.
RaptorUK:
Ah...thank you. I will have time tomorrow....thanks again. Also, I can't seem to find the switch to be notified of responses by email..I know it is here somewhere, but I could not locate it. thanks again, Raptor....
Compose a message, click the SRC button, paste your code into the window/box that appears, then click Insert at the bottom right.
bluesman:
Also, I can't seem to find the switch to be notified of responses by email..I know it is here somewhere, but I could not locate it. thanks again, Raptor....
Click Subscribe to topic . . . I don't get email notifications though even if I subscribe . . .
Also, I can't seem to find the switch to be notified of responses by email..I know it is here somewhere, but I could not locate it. thanks again, Raptor....
Trades are not executed but the Alerts execute fine....it worked fine about a year ago......????
if(SL > 0) sl = Ask - SL*Point; if(TP > 0) tp = Ask + TP*Point; if(BrokerECN) { iTicket = OrderSend(Symbol(), OP_BUY, GetLots(SL), Ask, Slippage, 0, 0, "", MagicNumber, 0, Blue); if(iTicket > 0) { OrderModify(iTicket, OrderOpenPrice(), sl, tp, 0, CLR_NONE); } } else { OrderSend(Symbol(), OP_BUY, GetLots(SL), Ask, Slippage, sl, tp, "", MagicNumber, 0, Blue); } lasttrade = Time[0]; SLMoved = 0; Alert(Symbol(),"* Price: ", Ask," SL: ",sl," TP: ",tp); Alert(Symbol(),"DD:HH:MM ",DayOfWeek(),":",Hour(),":",Minute()," Buy ", GetLots(SL) ," Lots");
bluesman:
Trades are not executed but the Alerts execute fine....it worked fine about a year ago......????
Trades are not executed but the Alerts execute fine....it worked fine about a year ago......????
A year ago you were on a 4 digit non-ECN broker. Now you are not.
- You didn't check return code before and you still aren't as requested.
- You are still useing OrderOpenPrice you can't
- You're not modify tp, sl and SLIPPAGE for 5 digit brokers.
If you're not going to modify your code when we answer your question, NOBODY can help you.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have an EA of a breakout strategy that no longer places trades. I stopped using it a year or so ago but changed the beginning and end times of the range which are both external variables. I have not changed the trading code since it ran successfully. Now it will trigger the Alerts in the code that tell the specifics of a trade when it happens, but the trade does not happen....only the alerts. The following shows where the alerts trigger and where the trading code is just not executed. The complete file is attached. Any ideas?
if(Bid >= High[h] + 1*Point)
{
if(SL > 0)
sl = Ask - SL*Point;
if(TP > 0)
tp = Ask + TP*Point;
if(BrokerECN)
{
iTicket = OrderSend(Symbol(), OP_BUY, GetLots(SL), Ask, Slippage, 0, 0, "", MagicNumber, 0, Blue);
if(iTicket > 0)
{
OrderModify(iTicket, OrderOpenPrice(), sl, tp, 0, CLR_NONE);
}
}
else
{
OrderSend(Symbol(), OP_BUY, GetLots(SL), Ask, Slippage, sl, tp, "", MagicNumber, 0, Blue);
}
lasttrade = Time[0];
SLMoved = 0;
Alert("* Price: ", Ask," SL: ",sl," TP: ",tp);
Alert(Symbol(),"DD:HH:MM ",DayOfWeek(),":",Hour(),":",Minute()," Buy ", GetLots(SL)," Lots");