Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1125
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Can you open the help for the function and see what it returns? And _LastError?
Specifically OrderSend returns an order ticket or -1. Guess in which case it will be -1 yourself ;)
I've been reading about this for 10 minutes now :)
Here as an example is quite suitable
And I've already started working out my error codes, thanks :) And I'm almost done with my EA on how to slow it down)
In this example, I can not find the value of"Slippage" it is in the OrderSend, it may not be so important or mandatory, I wonder!
And I've already started working out my error codes, thanks :) And I'm almost done with my EA on how to slow it down)
In this example, I can not find the value of"Slippage" it is in OrderSend, it may not be so significant or mandatory, I wonder!
And this is to catch code 135 or 129 and increase the slippage value for the next attempt. Or, if increased slippage doesn't look attractive, just count a certain number of seconds until the next attempt. Also, keep an eye on the spread, if the spread is increased at this time, wait for it to decrease and try again. Also, it is desirable not to use Sleep(), it certainly simplifies writing code and it does not bring much harm to hibernate for half a second or a second, but if the Expert Advisor is a fast Pipsier, for which every millisecond is important, or a pause in tens of seconds is needed, it is better not to use sleep, during sleep the Expert Advisor is paralyzed and can not only trade, but also monitor the trading environment or perform other calculations, does not respond to user actions, etc.
You can fix the current time, count down the required number of seconds (or milliseconds) and then act.
And I've already started working out my error codes, thanks :) And I'm almost done with my EA on how to slow it down)
In this example, I can not find the value of"Slippage" it is in OrderSend, it may not be so significant or mandatory, I wonder!
TodaySlippage is not as relevant as it used to be and it is usually used on accounts with fix spread, but there are only a few of such accounts and only 5-7 people trade on them. If the spread is floating, there is noSlippage, it is better to monitor the spread itself, and if it is too wide, then refrain from entering, but again, it all depends on the strategy, how critical a large spread is.
Bullshit...
On very popular ECNs the slippage on the news is mammoth. Sometimes hundreds of pips (5ozn). Or they just keep on tormenting orders for a whole minute, saying "new price", "no price", etc.
This is to catch code 135 or 129 and increase the slippage value for the next attempt. Or, if increased slippage doesn't look attractive, just count a certain number of seconds until the next attempt. Also, keep an eye on the spread, if the spread is increased at this time, wait for it to decrease and try again. Also, it is desirable not to use Sleep(), this, of course, simplifies writing code and causes no special harm, when hibernating for half a second or a second, but if the Expert Advisor is a fast Pipsier, for which every millisecond is important, or a break of tens of seconds is required, it is better not to use sleep, during sleep the Expert Advisor is paralyzed and can not only trade, but also monitor the trading environment or perform other calculations, does not respond to user actions, etc.
You can fix the current time, count down the number of seconds (or milliseconds) and then act.
I have already started to look for error codes, thank you :) And I have almost finished how to brake my Expert Advisor)
In this example, I can not find the value of"Slippage" it is in the OrderSend, it may not be so significant or mandatory, I wonder!
During Sleep command hibernation, the EA is indeed paralysed. Even in case of one terminal, it is necessary to provide work of twenty different threads, i.e. to let each of them occupy CPU time. At least to display something on the screen, not to mention the crucial for millisecond pipser task of accepting incoming ticks. In reality there are dozens of other operating system services which also want to work, i.e. to occupy the processor with their own needs. If the Sleep command doesn't do it, the OS thread scheduler will forcibly do it, but according to its own considerations who should be given time. You can rely on it too and load the processor almost 100% all the time with just this advisor. But it will hardly suit anybody. If the programmer doesn't plan the processor resources allocation, in most cases, the approach implemented in MQL where the Expert Advisor is given the CPU at the tick receipt for one symbol and after the processing of this arrival, the Expert Advisor "paralyzes" and does not take the CPU until the next tick.
The parameter Slippage in OrderSend (not to be confused with the real slippage in case of "Market execution" mode of order execution, by market) makes sense to set only in the "Instant execution" mode, immediate execution, when the order is either executed at the declared price or rejected, that is, it gets rejected. The maximum allowed deviation of the execution price from the price stated in the order can be set as non-zero. In the "Market execution" mode, this parameter does not mean anything, in this case the execution price is set by the dealing centre, the deviation from the price stated in the order is not limited in any way.
Bullshit...
On very popular ECNs the slippage on the news is mammoth. Sometimes hundreds of pips (5ozn). Or they just keep on tormenting orders for a whole minute, saying "new price", "no price", etc.
Есть условие для открытия ордера BUY. Открывается ордер, как сделать переход к SELL условию после закрытия BUY ордера?
if(High[1]-Close[1]>=NormalizeDouble(xbs1*_Point,_Digits))
{
int b_tik=OrderSend(_Symbol,OP_BUY,Lots,Ask,Slip,Low[2]-sl,High[1]+ tp,"",Magic,0,clrBlue)==true; //открытие ордера
GlobalVariableSet("B_order",0); // Больше не ищем вход Buy
//-----?????
GlobalVariableSet("S_order",1); // Переходим к поиску Sell
return;
}