Обычный трейлингстоп - по достижении икс пунктов прибыли стоп-лосс устанавливается на уровень, отстоящий от текущей цены на указанное количество пунктов.
Yes, I understand - I need the code of MQL4 program - to clearly understand the sequence and which values are used.
And I don't need a trailing stop, I need a one-time set to an unchangeable level.
Search for "breakeven".
Да это понятно-мне нужен код прграммы MQL4 - чтобы наглядно понять последовательность и какие значения используются.
И нужен мне не следящий Трэйлингстоп,а единожды выставленный на неизменяемый уровень.
- Declare a boolean variable and assign the value "False" to it.
- Find our order. Check if its Stop Loss is lower than its open position, then we assign our boolean variable the value "True", you know, the trawl is allowed. Otherwise we execute command return(0);
We also pass to the trawl the sign at which this particular order should be trawled, not another one, and our variable as a switch.
What happens in this case? As long as the price has not reached the level of pre-defined profit, the trawl will not work by definition. As soon as it reaches it, the stop will be pulled up. On the next tick, the EA will detect that the required order has a stop loss = its open position and it will not let the trawl operate - the switch variable will set it to false.
This is not the easiest way, but if you already have the trawl code ready, it's easier to do this than to rewrite the code, debug, test, verify....
- Declare a boolean variable and assign the value "False" to it.
- Find our order. Check if its Stop Loss is lower than its open position, then we assign our boolean variable the value "True", you know, the trawl is allowed. Otherwise we execute command return(0);
We also pass to the trawl the sign at which this particular order should be trawled, not another one, and our variable as a switch.
What happens in this case? As long as the price has not reached the level of pre-defined profit, the trawl will not work by definition. As soon as it reaches it, the stop will be pulled up. On the next tick, the Expert Advisor will detect that the required order has a stop loss = its open position and it will not let the trawl operate - the switch variable will set it to false.
This is not the easiest way, but if you already have the trawl code ready, it's easier to do this than to rewrite the code, debug, test, verify....
At my leisure I'll definitely use your tip - I have the ready code of trawl.
На досуге обязательно воспользуюсь Вашей подсказкой - готовый код трала у меня есть.
Alert("Bid = ",Bid);Compile it, put it on the chart. As a result, on every tick we see a window with the message of the current Bid.
The simple Expert Advisor has been created. The main thing that it shows us is that the code of the EA is launched anew at every tick.
The OrderSend() function is used to open orders. Usually, before its use, the programmer runs the code that analyzes the flow of last candles and identifies where the order must be opened.
To be able to quickly find the parameters of functions embedded in the language, put the mouse cursor somewhere between the letters of the function name and press F1 or Ctrl+F1 - the context help for the language function opens at the bottom of the code window.
Create a new EA in the editor. In the start() function write the following:
Compile it, put it on the chart. As a result, on every tick we see a window with the message of the current Bid.
The simple Expert Advisor has been created. The main thing that it shows us is that the code of the EA is launched anew at every tick.
The OrderSend() function is used to open orders. Before using it, the programmer usually starts to analyze the flow of the latest candlesticks and to find out where to open the order.
To be able to quickly find the parameters of functions embedded in the language, one should put the mouse cursor somewhere between the letters of the function name and press F1 or Ctrl+F1 - context help for the language function will open at the bottom of the code window.
Hello !
I have a question for all forum members and those responsible for the material contained on this site.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
At this link https://www.metatrader5.com/ru/terminal/help/indicators/trend_indicators/envelopes
at the very bottom of the page there is a Warning:
Warning: All rights to these materials are reserved by MetaQuotes Software corp.
Reproduction in whole or in part is forbidden.
Question:I need to use in my EA this indicator - Envelopes but after reading the Warning
I don't know exactly what to do.
On the Meta Quotes Software corp. website for Contacts there is only a phone number, no mailing address - so contacting them will be a problem for me -
- That's why I asked the question here.
For whom exactly and under what conditions - does the above Warning apply ?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Who knows the code or link - please share.
The code is as follows: You need an EA to set a specified number of points of profit - Stop Loss when the price reaches a specified
Avid to put a Stop Loss when price reaches a set number of points profit.