Of course it doesn't )))) It's not SL, TP and TS that should be set to minimum, but Stop Level. And not only once at program start, but at every tick:
digits = (int) SymbolInfoInteger(symbol, SYMBOL_DIGITS); point = SymbolInfoDouble(symbol, SYMBOL_POINT); tickSize = SymbolInfoDouble(symbol, SYMBOL_TRADE_TICK_SIZE); ask = SymbolInfoDouble(symbol, SYMBOL_ASK); bid = SymbolInfoDouble(symbol, SYMBOL_BID); spread = ask - bid; stopLevel = MarketInfo(symbol, MODE_STOPLEVEL) * point; if (stopLevel == 0) { if (!isECN) stopLevel = NormalizeDouble(2 * spread, digits); } else stopLevel = NormalizeDouble(stopLevel + tickSize, digits);isECN - must be available to the user for setting. There are accounts like "true ECN" where there really are no limitations on minimum distances, i.e. stops/profits/positions can be set inside the spread.
Thanks. but your design is the same as mine, only you multiplied at min stop = 0 just by the spread*2, but as we know at many brokers min stop = 3 spread, why did you make 2?
I check for min stop on every tick.
StopLevel does not help, as it also returns zero, I use the Ask-Bid difference
and for the min stop, too.
Hi all, friends!
There's a special feature of Marketplace: we need to check all values for min stop.
If the value of the variable is less than the min-stop, then assign a min-stop, so that there is no error 130.
Currently 90% of brokers have floating spread and min STOP and yield 0.
There is a code construct that assigns all variables to the min stop.
But it doesn't work in the marketplace anymore, because minstop = 0 everywhere now,
Who is dealing with this problem?
As an option, introduce a restriction on the minimum stop size. For example, in OnInit(), if a user sets a stop less than 2 points, give a warning and return the code INIT_PARAMETERS_INCORRECT.
Another option is not to allow the user to control the stop size, but to calculate it dynamically in the Expert Advisor based on trading conditions.
Alternatively, you can introduce a limit on the minimum stop size. For example, in OnInit(), if a user sets a stop of less than 2 pips, it would give a warning and return the code INIT_PARAMETERS_INCORRECT.
Another option is to not allow the user to control the stop size, and calculate it dynamically in the Expert Advisor based on trading conditions.
I agree - not giving control, but you know how it is required by the type: I want to set my own stop.
I will think about the message output - thank you.
As the broker declares min stop to be zero, there is nothing else to do, you can pick up a multiplier if the spread is not enough
Yes, this is only for the market - but there is no universality for any broker
the way it works is you have to make a min stop at 3 spreads in order to be accepted in the market,
The only difference is that the market accepts them - you have to make a min stop and 3 spreads, but in fact this is wrong - if a broker min stop = 1 spread - then the user cannot put less than 3 spreads.
Baffle.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all, friends!
There's a special feature of Marketplace: we need to check all values for min stop.
If the value of the variable is less than the min-stop, then assign a min-stop, so that there is no error 130.
Currently 90% of brokers have floating spread and min STOP and yield 0.
There is a code construct that assigns all variables to the min stop.
But it doesn't work in the marketplace anymore, because minstop = 0 everywhere now,
Who is dealing with this problem?