[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 466
![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
Question for expert programmers!
How do I set a StopLoss?
newstop - the new price detected by the indicator line, at this price I want to set a stop loss
For example newstop = 1.5005, but the price Bid is at a level = 1.5000, and the broker stoploop at 10 points, respectively, that I can not set the stoploss at this level, how to prescribe it correctly to avoid errors from the stoploop?
(newstop>MarketInfo(Symbol(),MODE_STOPLEVEL))
Thank you.
double op=NP(MathMax(Bid-SL*Point, Bid-StopLvl))
NP - price normalization.
double op=NP(MathMax(Bid-SL*Point, Bid-StopLvl))
NP - нормализация цены.
Thanks, but what about multiplying by Point?
I didn't show all the code, that's probably why I didn't quite understand my question, here's a piece of code.
Will the logic of what is written below work?
Or do I have to do this first, for example, for bai?
Or should I do this first, for example for buy?
The order type has to be taken into account when checking the condition. You can do it like this:
Question for programmers. The search hasn't yielded anything yet. How, in a trading robot to set (where to find a block of code / someone did this issue) skipping stakes, that is, the robot trades starting with the second bid after a loss-making, because the transactions take place virtually, and when found triggered stoploss in one robot gnachinaet trade already money, then worked out a given number of rates, again begins to trade with non-money but virtually (skipping rates) and again waiting triggered stoploss, again through one starts working using in betting depot means.
There was an article like this.
The articles on skipping bets do exist, but the code itself to *make* the robot skip bets is absent, or not found (I opened the attached archives). There is a robot that makes one or two losing bets per year, if I wait for them and then enter the market, but do it automatically, it's another martingale. If you wait for them and then enter the market automatically, it is another martingale. I thought the subject is solved, but I cannot find any code.
A virtual trading module needs to be made. The code to implement this approach is there. You just need to adapt it to your own needs.