expert advisor - miscellaneous questions - page 41 1...34353637383940414243 New comment Max Enrik 2017.05.15 10:23 #401 Stupid things today I tried few times old version EA it closes all Open Orders.Now I confused.---But anyway I use MarketInfo() instead of simple Bid, and Ask. Marco vd Heijden 2017.05.15 10:42 #402 Usually i try all of it to discover what works best.I have one script that closes all order when need be. for(int order=0; order<=OrdersTotal()-1; order++) { bool selected=OrderSelect(order,SELECT_BY_POS); { if(selected==1) { bool close=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3,clrNONE); } } }But as you can see nothing gets checked so it for manual implementation where you can visually verify that the orders are closed or not. Indicators with alerts/signal Help with code? [ARCHIVE!] Any rookie question, William Roeder 2017.05.15 14:14 #403 whroeder1: In the presence of multiple orders (one EA multiple charts, multiple EA's, manual trading) You must count down when closing/deleting/modifying in a position loop. Get in the habit of always counting down. Loops and Closing or Deleting Orders - MQL4 forum and check OrderSelect. What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles You must RefreshRates after sleep and between multiple server calls if you want to use the Predefined Variables (Bid/Ask) or OrderClosePrice() instead. Max Enrik: RefreshRates() I do not understand where could I put it.You ask the question, you get the answer, and you ignore it and ask again. No down, no RefreshRates. Max Enrik 2017.05.15 15:08 #404 whroeder1: You ask the question, you get the answer, and you ignore it and ask again. No down, no RefreshRates.Why I asked again. Sorry I did not understand below sentence. ( I can't translate it. )You must RefreshRates after sleep and between multiple server calls if you want to use the Predefined Variables (Bid/Ask) or OrderClosePrice() instead. Close all trades as Trailingstop EA won't work stop repeating orders in Max Enrik 2017.05.15 18:52 #405 @MarcoAfter I replaced, JPY does not shows correct price and does not open order. Marco vd Heijden 2017.05.15 18:57 #406 Do you have the code snippet. Max Enrik 2017.05.15 19:31 #407 Marco vd Heijden: Do you have the code snippet.Here you go.void buyorder() { Ticket = OrderSend( _Symbol, OP_BUY, lotsize, MarketInfo(OrderSymbol(),MODE_BID), slippage, sl, tp, "trade panel", magic, 0, clrRed ); return; } William Roeder 2017.05.15 20:03 #408 Ticket = OrderSend( _Symbol, OP_BUY, lotsize, MarketInfo(OrderSymbol(),MODE_BID), slippage, You can not use any Trade Functions unless you have an order selected.Check your return codes What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles Daily Pivots based EA Code not fully working Draw vertical line code Max Enrik 2017.05.15 20:57 #409 whroeder1: You can not use any Trade Functions unless you have an order selected.Check your return codes What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles #1 Could I use Bid instead of MarketInfo?#2 Could I write it like below?void buyorder() { Ticket = OrderSend( _Symbol, OP_BUY, lotsize, Bid, slippage, sl, tp, "trade panel", magic, 0, clrRed ); if( Ticket < 0 ) { Print("OrderSend failed with error: ", GetLastError() ); return; } return; } Marco vd Heijden 2017.05.15 21:11 #410 Only for the chart symbol.Ask, Bid, _Period,_Symbol,Symbol(),Period()These are all related to the chart symbol.Use MarketInfo when you are working with symbols other then the chart symbol. 1...34353637383940414243 New comment
Stupid things today I tried few times old version EA it closes all Open Orders.
Now I confused.
---
But anyway I use MarketInfo() instead of simple Bid, and Ask.
Usually i try all of it to discover what works best.
I have one script that closes all order when need be.
But as you can see nothing gets checked so it for manual implementation where you can visually verify that the orders are closed or not.You ask the question, you get the answer, and you ignore it and ask again. No down, no RefreshRates.
Why I asked again. Sorry I did not understand below sentence. ( I can't translate it. )
@Marco
After I replaced, JPY does not shows correct price and does not open order.
Do you have the code snippet.
Here you go.
#1 Could I use Bid instead of MarketInfo?
#2 Could I write it like below?
Only for the chart symbol.
These are all related to the chart symbol.
Use MarketInfo when you are working with symbols other then the chart symbol.