So you mean, I should use OrderOpenPrice() for OrderSend() and OrderClosePrice()for OrderClose()?
But why? - Where is the difference? - e.g.:
Magic Number: So you mean somehting like this? (I nerver understood Magic Numbers... - I already read the documentation 5 times I think... Magic Numbers are so difficult...)
Would that be right? - (But the documentation says: int magic=0, // magic number - https://docs.mql4.com/trading/ordersend)So I thought I also can use 0...
And my last question for today is. How can I get the price between Bid and Ask? - Is it "PRICE_MEDIAN"?
extern int magicNr = 45634;
if( signalBUY ) ticketNr = OrderSend( _Symbol, OP_BUY, lots, Ask, slippage, SLprice, TPprice, NULL, magicNr, 0, clrGreen );
if( signalSELL ) ticketNr = OrderSend( _Symbol, OP_SELL, lots, Bid, slippage, SLprice, TPprice, NULL, magicNr, 0, clrRed );
if( OrderSelect( ticketNr, SELECT_BY_TICKET ) )
bool flagClose = OrderClose( ticketNr, lots, OrderClosePrice(), slippage, clrGold );
Now, my final say because this is becoming tedious. You continue to refuse to do the research and look at example code:
Thank you a lot. My code looks now so. Is that right?
input int magicNr = 45634;
ticketNr = OrderSend(NULL, OP_BUY, lots, Ask, 100, lowestPrice, 0, NULL, magicNr, 0, clrGreen);
ticketNr = OrderSend(NULL, OP_SELL, lots, Bid, 100, highestPrice, 0, NULL, magicNr, 0, clrRed);
OrderClose(ticketNr, tvk, OrderClosePrice(), 100, clrGold);
tvkClosed = true;
Alert("Closed ",Symbol()," Trade with ",tvk," Lot!");
Well, why don't you try answering your own question! What does the documentation say about OrderSend() and that parameter?
Also, what does the documentation say about OrderClose() and the return value?
I always use Symbol() as the first parameter in OrderSend() ( when I am placing an order with the chart symbol.)
NULL means the current symbol when calling iClose() etc but it is not explicitly stated in the documentation that it can be used with OrderSend. It does work, but who knows whether that may change in future builds? For that reason, I will stick with Symbol().