[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 189

 

Good day to you all!

Can you advise me please...

Suppose we have the following construction OrderSend(Symbol(),OP_BUY,Lots,Ask,3 ,0,0);

On the fourth place, we have slippage = 3.

This is a fragment from the reference:

slippage - Maximum permitted price slippage for market orders(Buy or Sellorders ).

1. If you don't mind, please explain on your fingers what it is, from what and why. )) It is not very clear what is the deviation from and in what (pips, minutes...).

2. And the second, at what level should I set??? Somewhere I've seen in articles that this value should be set to 30 for currency pairs with five signs (e.g. EURUSD).

Thanks a lot!

 
Andrey067:

Hi all!

I'm just starting to take my first steps in programming. I am practicing with simple examples. But I want to understand better syntax and want to write something more interesting: for example, to create an indicator of maximum and minimum for a period, fractal... I would be very grateful if someone could share the sources...

Sharing the most valuable line with you . http://www.google.ru/advanced_search?q=codebase+site:mql4.com&hl=en&lr=&newwindow=1&prmd=ivns
 
NickXXX:

Good day to you all!

Can you please advise me...

Suppose we have the following construction OrderSend(Symbol(),OP_BUY,Lots,Ask,3 ,0,0);

On the fourth place, we have slippage = 3.

This is a fragment from the reference:

slippage - Maximum permitted price slippage for market orders (Buy or Sell orders).

1. If you don't mind, please explain on your fingers what it is, from what and why. )) It is not very clear what is the deviation from and in what (pips, minutes...).

2. And the second, at what level should I set??? Somewhere I've seen in articles that this value should be set to 30 for currency pairs with five signs (like EURUSD).

Thanks in advance!


To 1 - read on the internet for an explanation of what "slippage" is - it is the slippage parameter

For the second - you should set it to 4 signs - for example 3 - at 5 signs - 30

 
NickXXX:

Good day to you all!

Can you advise me please...

Suppose we have the following construction OrderSend(Symbol(),OP_BUY,Lots,Ask,3 ,0,0);

On the fourth place, we have slippage = 3.

This is a fragment from the reference:

slippage - Maximum permitted price slippage for market orders (Buy or Sell orders).

1. If you don't mind, please explain on your fingers what it is, from what and why. )) It is not very clear what is the deviation from and in what (pips, minutes...).

2. And the second, at what level should I set??? Somewhere I've seen in articles that this value should be set to 30 for currency pairs with five signs (like EURUSD).

Thank you very much!


1. See here, specifically "... If the requested opening price is severely out of date, an error 138 (ERR_REQUOTE) will be generated regardless of the value of the slippage parameter. If, however, the requested price is obsolete but is still present in the price stream, the position will be opened at the current price and only if the current price falls within the price+-slippage range." Deviation in pips.

2. In the textbook, the value of 2 (real pips on four-digit pairs), for five-digit pairs - the value is 20-30, it depends on the broker... When I was trading on A..... and I was using 20-30 - I didn't have any problems with order opening by this parameter's value.

 
Roman.:


1. See here, namely "... If the requested open price is heavily out of date, then an error 138 (ERR_REQUOTE) will be generated, regardless of the value of the slippage parameter. If, however, the requested price is obsolete but is still present in the price flow, the position will be opened at the current price and only if the current price falls within the price+-slippage range." Deviation in pips.

2. In the tutorial - value 2 (real pips, on four digits), for five digits - value 20-30, it depends on broker... I traded with the value of 20-30 on A..... and had no problems with opening of orders by the value of this parameter.

For example, if A.....i has the following conditions:

1. for currency pairs with 5 decimal places - the minimum change of the 4th decimal place (0.0001);

2. for currency pairs with 3 decimal places - the minimum change of the 2nd decimal place (0,01).

Do I set it to 20-30 on a 5-digit pair (for example EURUSD) or to 2-3, because a change of the 4th decimal place is taken into account?

 
NickXXX:

And if, for example, A..... and these are the conditions:

  • for currency pairs with 5 decimal places - the minimum change of the 4th decimal place (0.0001);
  • for currency pairs with 3 decimal places - the minimum change of the 2nd decimal place (0,01).

I set 20-30 for 5 decimal pairs (e.g. EURUSD) or 2-3 as only the change of the 4th decimal sign is taken into account????


Whatever, on five-figure brokers put 40 and don't sweat it, in the end unless it's masochistic scalping, four real points up/down won't undermine your game plan... :-))) Try microreal and that's it.
 
NickXXX:

And if, for example, A..... has these conditions:

1. for currency pairs with 5 decimal places - minimum change of the 4th decimal place (0.0001);

2. for currency pairs with 3 decimal places - the minimum change of the 2nd decimal place (0,01).

Do I set it to 20-30 on a 5-digit pair (for example EURUSD) or to 2-3, because a change of the 4th decimal place is taken into account?


No. Exactly, you multiply the real points by 10, as it is a FIVE, i.e. the slippage value will be in the 20-30 range.
 
Thank you very much...!
 
Andrey067:

Hi all!

I'm just starting to take my first steps in programming. I am practicing with simple examples. But I want to understand better syntax and want to write something more interesting: for example, to create an indicator of maximum and minimum for a period, fractal... I would be very grateful if someone could share the sources...

Do you want to take a ready-made example and work it out?

How about reading this section of the textbook first?

 

I am writing an EA for channel breakdown. I stumbled on checking for breakdowns of channels before opening a deal, i.e. I need to calculate or record the time of channel breakdown before opening a deal. I get channels with the help of the indicator and get values like this:

for (i = 0; i < ObjectsTotal(); i++)
{
if (StringFind(ObjectName(i), "#",0) >= 0) continue;
if (ObjectType(ObjectName(i)) == 1)
{
if (var_400 < ObjectGet(ObjectName(i),OBJPROP_PRICE1)
{
ChangeTrend1 = ObjectGet(ObjectName(i),OBJPROP_TIME2);
var_416 = ObjectGet(ObjectName(i),OBJPROP_PRICE1);
var_400 = ObjectGet(ObjectName(i),OBJPROP_PRICE1);
FirstPrice1 = ObjectGetValueByShift(ObjectName(i), iBarShift(NULL, 0, ChangeTrend1, false);
}
if ((var_408 > ObjectGet(ObjectName(i),OBJPROP_PRICE1)) && (ObjectGet(ObjectName(i),OBJPROP_PRICE1) > 0))
{
var_408 = ObjectGet(ObjectName(i),OBJPROP_PRICE1);
FirstPrice2 = ObjectGetValueByShift(ObjectName(i), iBarShift(NULL, 0, ChangeTrend2, false));
ChangeTrend2 = ObjectGet(ObjectName(i),OBJPROP_TIME2);
}
}
if (ObjectType(ObjectName(i)) == 2)
{
if (var_400 < ObjectGetValueByShift(ObjectName(i),0))
{
ChangeTrend1 = ObjectGet(ObjectName(i),OBJPROP_TIME2);
var_416 = ObjectGetValueByShift(ObjectName(i),1);
var_400 = ObjectGetValueByShift(ObjectName(i),0);
FirstPrice1 = ObjectGetValueByShift(ObjectName(i), iBarShift(NULL, 0, ChangeTrend1, false);
}
if ((var_408 > ObjectGetValueByShift(ObjectName(i),0)) && (ObjectGetValueByShift(ObjectName(i),0) > 0))
{
ChangeTrend2 = ObjectGet(ObjectName(i),OBJPROP_TIME2);
var_408 = ObjectGetValueByShift(ObjectName(i),0);
FirstPrice2 = ObjectGetValueByShift(ObjectName(i), iBarShift(NULL, 0, ChangeTrend2, false));
}
}
}

var_392 = MathRound((var_400 - var_416)/ld_84 * 100);
if ((var_400 != 0) && (var_408 != 9999) && (var_400 != var_408)){
var_400 = NormalizeDouble(var_400,Digits);

var_408 = NormalizeDouble(var_408,Digits);

Please help in solving this problem. Thank you in advance.



Reason: