- Error 1 means you didn't try to change anything.
- You say you know how to open "without SL and TP." So how do you do that?
WHRoeder:
- Error 1 means you didn't try to change anything.
- You say you know how to open "without SL and TP." So how do you do that?
Hi WHRoeder,
first order:
... int Ticket_1 = OrderSend(Symbol(), OP_BUY, Lot, Ask, Slippage, 0, 0, EA_Name, Magic, 0, Lime); if (Ticket_1>0) { Last_Lot=Lot; Last_Time=iTime(NULL,0,0); } ...
now mody the order
... if (Order_Type==OP_BUY && MyRealOrdersTotal(Magic)==1 && Order_Stop_Loss!=(LastOpenedPrice(Magic)+ Point*Traling_Stop) && Ask>=(LastOpenedPrice(Magic)+ Point*Traling_Start {OrderModify(OrderTicket(),0,(LastOpenedPrice(Magic)+ Point*Traling_Stop),(LastOpenedPrice(Magic)+ Point*TP),0,Blue);} ...
second oder with the try to clear the SL and TP
... OrderModify(OrderTicket(),0,0,0,0,0); //thats not right //if (LastOpenedType(Magic)==1 && MyRealOrdersTotal(Magic)==1) Lot=LastOpenLot(Magic); int Ticket_3 = OrderSend(Symbol(), OP_BUY, Lot, Ask, Slippage, 0, 0, EA_Name, Magic, 0, Lime); ...
Suffi
Play videoPlease edit your post.
For large amounts of code, attach it.
OrderModify(OrderTicket()
You can NOT use OrderTicket or any other trading functions until you do a successful OrderSelect. Does LastOpenedPrice() do that? how do you check if it worked? What are Function return values ? How do I use them ? - MQL4 forumOrderModify(OrderTicket(),0,0,0,0,0); //thats not right
Why are you trying to modify the price. Why are you trying to modify SL and TP to zero when that's what you set them to when you opened the order? What are Function return values ? How do I use them ? - MQL4 forum
WHRoeder:
Play videoPlease edit your post.
For large amounts of code, attach it.
-
You can NOT use OrderTicket or any other trading functions until you do a successful OrderSelect. Does LastOpenedPrice() do that? how do you check if it worked? What are Function return values ? How do I use them ? - MQL4 forum
-
Why are you trying to modify the price. Why are you trying to modify SL and TP to zero when that's what you set them to when you opened the order? What are Function return values ? How do I use them ? - MQL4 forum
The OrderSelect is above of the extract of the code.
It works well, except for the error message in the Journal
I would not change the price.
What I have to register there?
Suffi
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 need help.
My EA open the first order with a stoploss and takeprofit, the price goes the false side, now the EA open the next order without SL and TP.
Before the order are open, I will cleare the SL and TP from order before. I don´t know how I do that.
I get always error1.
Suffi