Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 484

 
Vladislav Andruschenko:
0 means floating stop. In the tester the spread is fixed. If you set 1, then 1 will always be there. But in real life it floats.

I agree. But in the tester I have a spread of 12 pips. On the demo account it does not exceed 10 pips. It spins 8-10 pips.

I do not understand why it is so.

 
Valerius:

I agree. But in the tester I have a spread of 12 pips. On the demo account it does not exceed 10 pips. It spins 8-10 pips.

I do not understand why it happens so.

If I have a floating spread, the stop-loss level is equal to two spreads respectively.

Forum on trading, automated trading systems and trading strategies testing.

Any questions from newbies on MQL4, help and discussion on algorithms and codes

Valerius, 2018.03.02 16:35

Good evening all!

In the tester an order is modified without any problems, but on a demo account this modification does not work.

I don't get the stop loss modification. In the tester stoploss can be only 1 pip away from the current price but in demo accounts even if we set stoploss at a distance of spread + 6-8 pips more .

MODE_STOPLEVEL=0, MODE_FREEZELEVEL=0.

Please advise why and how to do correct modification.


It will not be enough. I also do not exclude the possibility that the price may change and there will be another opening error.

And in the Strategy Tester... If you really need it, you can open a Buy position at the Bid price and look at many other miracles. Although, it will be opened at the Ask price despite the incorrectly specified price.

 
Alexey Viktorov:

With a floating spread, the level of stop loss equals two spreads, respectively


It will not be enough. Moreover, we cannot rule out that the price may change and there will be another opening error.

And in the Strategy Tester ... If you really need it, you can open a Buy position at the Bid price and look a lot of different wonders. Although, it will be opened at the Ask price despite the incorrectly specified price.

Wouldn't there be a requote? I think the first answer to the question about requotes in the tester (!!!) is that the opening prices are mixed up.

Or have I already forgotten everything?

 
Artyom Trishkin:

Isn't there going to be a requote? I think the first answer to the question about requotes in the tester (!!!) is that the opening prices are mixed up.

Or have I forgotten everything?

There will be requotes in the tester too.

 
Vladimir Zubov:

There will be requotes in the tester too.

Well, that's what I'm saying.

 
Alexey Viktorov:

With a floating spread, the level of the stop loss equals two spreads, respectively


That would not be enough. Also, it is possible that the price may change and there will be another opening error.

In the tester ... If you really need it, you can open a Buy position at the Bid price and look at many other miracles. Although, it will be opened at the Ask price despite the incorrectly specified price.


Are you 100% sure about this statement?

 

Guys, it's not a question of opening an order, it's a question of modifying it.

I already wrote above that in both casesMODE_STOPLEVEL=0, MODE_FREEZELEVEL=0.

In demo I can modify stoploss only when stoploss is within double spread of the current price but in tester it is only 1 pip.

What have I missed? What is the correct way to make this modification?

 
Vladislav Andruschenko:


Are you 100% sure of this statement?

You can never be 100% sure even of yourself

But as a rule of thumb, with floating stops (zero SYMBOL_TRADE_STOPS_LEVEL), two spreads are sufficient.

In any case, there must be a stop-order correction function which handles the error return code of the wrong stops.

 
Artyom Trishkin:

You can never be 100% sure even of yourself

But as a rule of thumb, with floating stops (zero SYMBOL_TRADE_STOPS_LEVEL), two spreads are sufficient.

In any case, there must be a stop order correction function which handles the return error code of the wrong stops.

I agree with you.

This topic is very hackneyed and there is still no 100% solution to the problem of wrong stops.

  1. 2*spread
  2. 3*spread
  3. 0-1 point

all of these options have a place.

If you can pull a floating spread in the symbol information, why you can't pull a floating stop level is unclear to me.

So, this is the idea. After all, the stop level is regulated by the broker.

They may change it as they wish, even 10 times more during news releases.

 
Valerius:

Guys, it's not a question of opening an order, it's a question of modifying it.

I already wrote above that in both casesMODE_STOPLEVEL=0, MODE_FREEZELEVEL=0.

In demo I can modify stoploss only when stoploss is within double spread of the current price but in tester it is only 1 pip.

What have I missed? How to make this modification correctly?

MODE_STOPLEVEL=0, MODE_FREEZELEVEL=0 - this does not indicate their absence. It's saying that their value can vary.

When you get error 130, you need to recalculate the size of the stop order according to (if memory serves, Alpari has two spreads) the size of the double spread (and the spread can also change, if SYMBOL_SPREAD is also zero). So - in your particular case, when you get error 130, you need to take the current spread, multiply it by two and try to modify again.

One thing I don't understand - why do you need such close stops?

Reason: