Thanks So much for your video Its really very helpful Please add more videos while you're programming so it can help the new programers how to think and arrange their programming steps while they are working on thier expert advisors Once again thanks so much
I have work but why are the buystoploss and selstoploss prices like the ASK/BID price so when profit becomes a plus the trading is immediately active so it doesn't match the expected price
Hi There, instead calculate the digits, can we just use the built in function "_Digits"??? same as MT5?? double sellStopLoss = NormalizeDouble(SymbolInfoDouble(symbol,SYMBOL_ASK)+stoploss,_Digits); Thanks
Yes, _Digits or Digits() all have the same value if you are only working with the chart symbol. Remember I passed symbol into this function to make it more generic so if you call it with something other than the chart symbol this may not work.
Please, there is any option to change the trailing stop mt4 settings to calculate the trailing stop pips from the entry price not from the initial stop loss price?
@@OrchardForex So how to make the trailing stop move to specific level above the breakeven? For example, I enter but in euro/usd with price 1.1200 and the initial stop-loss is 20 pips 1.1180 the specific level I need the trailing stop move to when triggered is 1.1240 How I make it and how to make the increment after this level to be each 20 pips not the same value from the initial stop loss to the specific level?
I'm getting an 'ApplyTrailingStop' - function not defined, and an 'ApplyTrailingStop'- function declarations are allowed on global, namespace or class scope only error when I try to call the function ApplyTrailingStop, along with the ApplyTrailingStop function, in the void OnTick section of my EA. I've also tried copying and pasting the code from the link in the description, to avoid typing errors, no luck. Any suggestions?
Is there a way to count trailing stop messages to server? My broker warned me about hyperactivity, threatening to disable my account. I understand that it is due to EA calculating a trailing stop on every tick. I could not find a solution. Anyone knows if there is a way to count these messages? Journal does not show them. Maybe an indicator that would display the messages count in real time? Or a code to embed in the EA?
If you have trailing stop working correctly it will only change in one direction and you are unlikely to have this problem. You may be trying to set TS even if it is the same as the current value, don't do that. I also suggest adding a tolerance, like don't adjust ts unless it is more than 5 points difference.
@@OrchardForex Thanks, but I am not sure what you mean. Trailing stop I used was in one direction, naturally, and still I got several warnings. They said that the most probable cause was EA, but I used an MT4 built-in TS in what I thought was the most innocent way. It was supposed to be used as I did. I guess that market was going in a favorable direction for an unusually long time and I had too many positions that were not closed before overloading server with messages. So I am looking for a messages feedback, as a first step in adjusting my trades and finding a solution. No clues or indicators on MQL site.
@@miodragmilosavljevic1190 By MT4 built in ts I assume you mean from the terminal you selected the order and then trailing stop. I don't know of anything you can do to slow that down. If you did have a lot of positions open and they all had a ts then maybe that was the cause but the built in trailing stop is not from an expert. If the built in is going to be a problem then you will have to write your own and as I suggested you can add a minimum increment to avoid moving with every point.
You just have to open 2 different trades. There is no single command to open both at once. If you are thinking of these as OCO for take profit and stop loss then just apply take profit and stop loss at either order open or with modify.
0 errors just means compiled correctly but there could still be an error. Simple things like > instead of < or = instead of == can make all the difference. Standard diagnostics will be to insert print statements in the code at key points and determine where it is not doing what you expect, and look for errors in the logs.
After Creation as you type this part of code give a error -function not defind. " CreateTrade(Symbol(), InpVolume, InpMagicNumber, InpTradeComment); " any advise please
Hi, MT4 offers two ways to allow users to set the properties, input and extern. I notice that you seem to prefer to use input. Can you tell us why this is please? Cheers, John
Hi, I see you've asked this several times. The difference is not a simple one extern and input will both perform the input function but extern can be used for more. Short answer to why I use input is because input variables cannot be modified later, makes them safe. And so far I have had no need of the other applications for extern.
@@OrchardForexfrom lines 48-51 it says 'create trades' 'applytrailingstop' and 'stoploss' function not defined those are the only errors i have from it and i copied it the exact same way
@@mikelim4520 The line numbers will depend on the rest of your code so I'm making an assumption based on the nearest line numbers from the video. 'create trades' should be CreateTrades, applytrailingstop should be ApplyTrailingStop and stoploss should be StopLoss.
@@mikelim4520 If it is exactly the same then you would not have an error. You haven't included the exact error message, one of the lines you mention is blank and another is a comment, so I can only guess at your problem. The CreateTrades and ApplyTrailingStop functions are shown immediately after the functions are used, at 7:15 and 9:12. ApplyTrailingStop is also shown on the web page mentioned in the description. StopLoss is not a function and if you are getting an error telling you stoploss is an undefined function then I assume you have added brackets after the variable name, which is not exactly as the video.
God Bless you tremendously, your tutorials have helped me perfect my existing EA with my very poor coding skills.
Great to hear!
Works really well. Would you consider doing a similar presentation on moving a stop loss to break even?
Mate, you have awesome content. Thanks.
Thanks So much for your video
Its really very helpful
Please add more videos while you're programming so it can help the new programers how to think and arrange their programming steps while they are working on thier expert advisors
Once again thanks so much
Thank you, I will
Thank you , this is what I need!
You are amazing.. Thanks for all the videos.. Very much helpful !
Sir, It seem to be working on only Order_type_sell only and doesn't work on Order_type_buy. Please recheck the code again.
hi do you have a code for this for download. thank you.
Thankyou working perfecly
You are a great person thanks a lot
Thank you for this
My pleasure!
Thank you! Subscribed
I have work but
why are the buystoploss and selstoploss prices like the ASK/BID price so when profit becomes a plus the trading is immediately active so it doesn't match the expected price
sorry, it turns out I entered the wrong variable "int". when I change to "double" its working thank you very much Mr
I wrote the code correctly, but after it moves the stop, it prints Modifi at every move. Is this normal, or is there a specific error?
Hi There,
instead calculate the digits, can we just use the built in function "_Digits"??? same as MT5??
double sellStopLoss = NormalizeDouble(SymbolInfoDouble(symbol,SYMBOL_ASK)+stoploss,_Digits);
Thanks
Yes, _Digits or Digits() all have the same value if you are only working with the chart symbol. Remember I passed symbol into this function to make it more generic so if you call it with something other than the chart symbol this may not work.
Please, there is any option to change the trailing stop mt4 settings to calculate the trailing stop pips from the entry price not from the initial stop loss price?
No and the inbuilt trailing stop is calculated from the current price, not the inital stop loss.
@@OrchardForex
So how to make the trailing stop move to specific level above the breakeven?
For example, I enter but in euro/usd with price 1.1200 and the initial stop-loss is 20 pips 1.1180 the specific level I need the trailing stop move to when triggered is 1.1240
How I make it and how to make the increment after this level to be each 20 pips not the same value from the initial stop loss to the specific level?
I'm getting an 'ApplyTrailingStop' - function not defined, and an 'ApplyTrailingStop'- function declarations are allowed on global, namespace or class scope only error when I try to call the function ApplyTrailingStop, along with the ApplyTrailingStop function, in the void OnTick section of my EA. I've also tried copying and pasting the code from the link in the description, to avoid typing errors, no luck. Any suggestions?
It sounds like you missed a closing bracket somewhere before the ApplyTrailingStop function.
Hello Sir, if you don't mind, Can you make my EA Trailing stop working on a real account ?. Please let me know where can I send the EA.
Will this also work if you initiate a trade from your phone if you also have mt4 open on your pc?
yes
Awesome video!
Thanks!
Can you do how to add push mobile alert to EA.
That is in our topic backlog
THanks you SIR
Welcome.
thank You
Is there a way to count trailing stop messages to server? My broker warned me about hyperactivity, threatening to disable my account. I understand that it is due to EA calculating a trailing stop on every tick. I could not find a solution. Anyone knows if there is a way to count these messages? Journal does not show them. Maybe an indicator that would display the messages count in real time? Or a code to embed in the EA?
If you have trailing stop working correctly it will only change in one direction and you are unlikely to have this problem. You may be trying to set TS even if it is the same as the current value, don't do that. I also suggest adding a tolerance, like don't adjust ts unless it is more than 5 points difference.
@@OrchardForex Thanks, but I am not sure what you mean. Trailing stop I used was in one direction, naturally, and still I got several warnings. They said that the most probable cause was EA, but I used an MT4 built-in TS in what I thought was the most innocent way. It was supposed to be used as I did. I guess that market was going in a favorable direction for an unusually long time and I had too many positions that were not closed before overloading server with messages. So I am looking for a messages feedback, as a first step in adjusting my trades and finding a solution. No clues or indicators on MQL site.
@@miodragmilosavljevic1190 By MT4 built in ts I assume you mean from the terminal you selected the order and then trailing stop. I don't know of anything you can do to slow that down. If you did have a lot of positions open and they all had a ts then maybe that was the cause but the built in trailing stop is not from an expert. If the built in is going to be a problem then you will have to write your own and as I suggested you can add a minimum increment to avoid moving with every point.
Hi, how can I open or execute buystop and sellstop at the same time.
You just have to open 2 different trades. There is no single command to open both at once. If you are thinking of these as OCO for take profit and stop loss then just apply take profit and stop loss at either order open or with modify.
@@OrchardForex thank you very much
i did every thing you said & 0 error, but its seem like nothing heppened
0 errors just means compiled correctly but there could still be an error. Simple things like > instead of < or = instead of == can make all the difference. Standard diagnostics will be to insert print statements in the code at key points and determine where it is not doing what you expect, and look for errors in the logs.
After Creation as you type this part of code give a error -function not defind.
" CreateTrade(Symbol(), InpVolume, InpMagicNumber, InpTradeComment); "
any advise please
The function is CreateTrades
@@OrchardForex The error after compiling is ('InpMagicNumber' - undeclared identifier) the coding error is from the web site not from youtube codes.
@@nadimkhalife The code on the web is for the function, not a complete EA. You have to work some things out for yourself.
OrderSend error 138. 😕
Hi,
MT4 offers two ways to allow users to set the properties, input and extern.
I notice that you seem to prefer to use input. Can you tell us why this is please?
Cheers,
John
Hi, I see you've asked this several times. The difference is not a simple one extern and input will both perform the input function but extern can be used for more. Short answer to why I use input is because input variables cannot be modified later, makes them safe. And so far I have had no need of the other applications for extern.
extern is not an alternative to input. It is something else that just happens to do the same function as input.
@@OrchardForex My apologies for asking it multiple times. I didn't realise that I had.
John
@@johnskinner3145 no problem
Whenever I try to compile the create trades and applyttrailing stop it says the function is not defined, how do I define it or what do I define it as?
Hard to say without knowing what you have or exactly which function is not defined but the error message will tell you what it is looking for.
@@OrchardForexfrom lines 48-51 it says 'create trades' 'applytrailingstop' and 'stoploss' function not defined those are the only errors i have from it and i copied it the exact same way
@@mikelim4520 The line numbers will depend on the rest of your code so I'm making an assumption based on the nearest line numbers from the video. 'create trades' should be CreateTrades, applytrailingstop should be ApplyTrailingStop and stoploss should be StopLoss.
@@arthurmcalister1454 yes it's the exact same, i just copied it from the video
@@mikelim4520 If it is exactly the same then you would not have an error. You haven't included the exact error message, one of the lines you mention is blank and another is a comment, so I can only guess at your problem. The CreateTrades and ApplyTrailingStop functions are shown immediately after the functions are used, at 7:15 and 9:12. ApplyTrailingStop is also shown on the web page mentioned in the description. StopLoss is not a function and if you are getting an error telling you stoploss is an undefined function then I assume you have added brackets after the variable name, which is not exactly as the video.
Should have added. Conditional upon another event eg a second order hitting take profit.
yes nice to have a clean accent are you aussie ?
Yes I am! Happily living in the harbour city.
Hi can you use this trailing stop on a meta 4 mobile app?
No, you can't run any custom code in the mobile app.
@@OrchardForex thanks for replying
'Symbol_Bid' -improper enumerator cannot be used
'Symbol_Ask' -improper enumerator cannot be used
when i compile it. .it gives this error. .plz help
I did not use Symbol_Bid or Symbol_Ask, but you may have added the underscores. You are missing parentheses Symbol_Ask()
🙏
Hamdy Houssien:
Looking for someone who can make an expert advisor
with these options
anyone ever tell you that you look like colin powell?
I prefer to think that Colin Powell looks like me
@@OrchardForex right!!! lol
нема болияптыку, ошангай аитияпканедыку