Extremely helpful and easy to follow. I have no coding experience and was able to muddle my way through. Now I have a "Close All" button for those times I need to exit quickly. Thanks
Moin René. Vielen dank für deine zahlreichen und super erklärten Videos. Die sind sehr interessant anzuschauen (vor Allem wenn die verschiedene EA´s testest). Gerade dieses hier war für mich besonders hiflreich, da ich mehrere Accounts gleichzeitig trade (als Scalper) und es unendlich nervig war mehrere Trades gleichzeitig mit der Maus zu schließen. Vor allem weil in den paar Sekunden indem ich die Trades schließe der Markt sich gerne mal schon wieder bewegt (ich trade in M1), das war alles sehr stressig :D Du hast es sehr klar und deutlich erklärt und ich konnte es sofort umsetzen und es bringt mir eine super Erleichterung beim traden. Vielen vielen dank und mach weiter so :) MfG, Finn
I never thought I'd be able to have my own Button Coded too. Thank you very much On the next Button - Perhaps you can make it do a Break Even so that it can protect an Entry point
Hey Rene thank you for a great video. Really helped me. What would the code be to have a Stop Loss = Break even function for the second button? I am busy with a close all positions button but want the second one to have a Stop Loss = Break even function so to move the stop loss to break even. Thank you in advance for your reply.
Hi, I made another tutorial where I showed how you can change the sl of your open positions. You can find it here: ruclips.net/video/3l8RyeQNmNo/видео.html You learn pretty much all you need there ;)
Thank you for your efforts and commitment, would it be possible to create a EditButton + button to update the stop lost like trailing stop, the editbutton will allow to type the SL et and button to update the position.
Thank you so much!!!! You have no idea how much this has helped me!!!! How can I add a (Move All to Breakeven) function to the second button??? Thanks again!!
Thank you for the video! I have the button working but would like it to close only positions on the chart or symbol it's loaded on. Would I need to use PositionGetSymbol for that some how?
Hi Rene, Thank you very much> it is very helpful. Btw, i have to remove word "_FUNTION_" then it works. I would like to ask that if i am scalping 10 position. Then, i would like to have button so call "SL" Once, i click SL button. Then, it is given me the box to fill constant figure for stop loss. Once i close the box, then all positions got same stop loss. i already create the button for both SL and TP by follow your tutorial. Thank you in advance.
hi bro can give the code how to set the close button to activate by pressing C at the key board to make an option of close position by clicking it tq sooo much
hello, Thank you for these valuable informations, Trades are closed sequentially and take time to close Can you modify the program so that it closes all trades at the same moment, as happens when you click on Close All Positions in metatrader thank you
Hey Rene, great tutorials. I really like them and they help me a lot. I copied your code as you said but my EA isnt deleting the button on DeInit.... there is no Error. Anny clue what the problem could be?
Rene can you please make the second button, pause and run thr trades. Lets say if ny expect advisor has opened some trades and i want it not to open more trades i can then click the pause button anf when all thr trades have reached stop loss or take profit i can click the same button to start running the expert advisor to allow trades to open
Hey, this is really easy. Just declare a global bool variable and make it true, if the button is clicked. If it is clicked again you can store false inside the variable. Before the EA opens a position you can then check the state of the variable. Just give it a go maybe you can implement it this way :)
This is a great tutorial. Thank you for sharing it. I have managed to create my buttons, but I am trying to get them to work with the bulk operations (Close All Positions & Delete All Orders) since they are much faster, but I cannot seem to figure it out. Any chance you can cover this? Thanks.
@@bitestonk0618 I figured it out. Bulk operations is not supported yet, but you can use asynchronous mode, which functions the same way. m_trade.SetAsyncMode(true)
It works for me if I add the expert advisor to a chart. But if I run it in the strategy tester, no. Why would it be? I also have the Algorithmic Trading button enabled. Regards
Hallo Rene, krasser deutscher Akzent aber sympatisch.. :D Ist es irgendwie möglich, dass die Positionen sofort gleichzeitig geschlossen werden und nicht nacheinander, was ja nach Menge leider einige Sekunden dauern kann... Also alle sofort geschlossen wäre für Scalping noch besser! Ist das einfach umzusetzen? Danke!
About the BUY & SELL button, i meant buttons that can be positioned anywhere on the screen such as above the running open positions bottom right !!! , MT5 market execution buttons are opposite side !!
Hy. Wie kann ich eine Hot Key EA erstellen. Sodass ich zb. die Num-Tasten zuordnen kann. um Positionen zu managen. (Buy, Sell, Close 50% oder Stop Loss to Break Even. usw...)
Please can you also do a video on how to program objects like S&R on HTF for signal confirmation, entry on STF plus even Fibonacci strategy for sniper entry on MT5
Hey, this would be kinda complex and time consuming implement. On RUclips I show the basics so you can understand the mql5 framework. Building complex EAs like this is in most cases time consuming but not really hard. So just go ahead and follow the tutorials and you will learn how to work with objects and stuff like that :)
Hii, I was following your tutorial and everything was fine, but when I click my button, nothing happens. I got only info "The ButtonClose was clicked". Idk how to fix this, I watched the end of your video several times, but everything seems okay to me :(
Hy I'll like throw something on the suggestion box plis .... An EA that can open trades on multiple symbols once the signal appear on tht symbol while other trades are running.
Hey, that is hard to tell without seeing the code. Please double check if you copied everything correctly from the video. Also have a look at the Experts Journal of your mt5 and check for possible errors.
I got there in the end BUT it would have been soooooooo much easier had you stuck to the original script (write a "Close All" button) rather than keep going off on tangents. ALSO, if you had left the comments IN for newbies like me. (it's not about how YOU would do it) (that comes later) Would have been nice if the final code was shown in it's entirety at the end ... THEN you could offer alternatives. I seemed to be forever going backwards and forwards looking for a specific line :(
Thanks for the feedback! I really appreciate it. If you are searching for a detailed and structured course you will like my complete mql5 masterclass: en.bmtrading.de/mt5-masterclass/
Can you also please help on creating a password protected expert advisor. Example: to enter the password after dragging expert advisor on the chart. 🙏🙏
Hey, that is really easy. You can just create a input string variable. Then in the OnInit function you will have to compare it to any string like if(InputString != "Password") ExpertRemove();
If possible one of the days kindly show us, how to write an expert advisor which uses 61.8% and 50% fibobacci level retracement to place entries. If possible one of the days.
What you was saying "I don't bother with comments" ... You should be encouraging your students to keep them and even add their own until they become masters ... Even then there are an asset for anybody else who is less skilled but has to work on it
Fantastic channel, thanks for very much for the wonderful useful applications. Please do an application for BUY & SELL buttons with programmed lot values, so a $10 BUY Button (1lot) and a 0.1c Buy Button(0.1 lot), for scalping it will be amazing.
Thank you! :) I receive a lot of requestes lately and cannot handle all of them. That is why I always recommend to learn the basics. But maybe I can cover this in the future.
Hey, by default the chart events do not trigger the event handler in the tester. But you can check the button state in the OnTick function and close positions if the button is closed. Do not forget to set the button state to false afterwards. ;)
Hey, I believe that you have the best learning effect if you write the code on your own. If you just copy and paste code from the internet you will never be able to write your own programs.
You should not create excessively long videos; many people will feel reluctant to watch them. Instead, you should make shorter, concise videos and keep your narration minimal, focusing on what's necessary
Extremely helpful and easy to follow. I have no coding experience and was able to muddle my way through. Now I have a "Close All" button for those times I need to exit quickly. Thanks
Sounds great :)
Great video mentor... I'm growing each day by repeating all the contents in this channel...by practical application as well...
Moin René. Vielen dank für deine zahlreichen und super erklärten Videos. Die sind sehr interessant anzuschauen (vor Allem wenn die verschiedene EA´s testest). Gerade dieses hier war für mich besonders hiflreich, da ich mehrere Accounts gleichzeitig trade (als Scalper) und es unendlich nervig war mehrere Trades gleichzeitig mit der Maus zu schließen. Vor allem weil in den paar Sekunden indem ich die Trades schließe der Markt sich gerne mal schon wieder bewegt (ich trade in M1), das war alles sehr stressig :D Du hast es sehr klar und deutlich erklärt und ich konnte es sofort umsetzen und es bringt mir eine super Erleichterung beim traden. Vielen vielen dank und mach weiter so :)
MfG,
Finn
Danke für das nette Feedback :) Es freut mich, dass Du etwas darauf mitnehmen kannst!
I am very thankful for this video. Everything is explained in great detail. Greetings back and also a successful trading.
Thank you very much. That's what I've been trying to add on my trading robot and now it's easy to do it. Very much appreciated
Very helpful and professional tutorial, thank you so much,I hope you will keep posting stuff like such in future.
I never thought I'd be able to have my own Button Coded too. Thank you very much
On the next Button - Perhaps you can make it do a Break Even so that it can protect an Entry point
I am glad you liked the video :)
Hey Rene thank you for a great video. Really helped me. What would the code be to have a Stop Loss = Break even function for the second button? I am busy with a close all positions button but want the second one to have a Stop Loss = Break even function so to move the stop loss to break even. Thank you in advance for your reply.
Hi, I made another tutorial where I showed how you can change the sl of your open positions. You can find it here: ruclips.net/video/3l8RyeQNmNo/видео.html
You learn pretty much all you need there ;)
Rene, you always provide valuable information. 👍
thank you, sir. this function is very useful and your explanation is also very detail and clear. i want to make a simulator with this button function.
Great tutorial. How can I create a nestled buttons and be able to move them around on the chart as a group?
Excellent ... Just what I have been looking for ... How would I make the button round ?
Not sure if there is a good function for it. Maybe you have to use another object for it (some circle) and react on clicks on this object.
@@ReneBalkeNow I have actually made it 75*75 is growing on me ... Looks good :)
How would I write a second line of text on my button ... CLOSE ALL wouldn't wrap
Thank you for your efforts and commitment, would it be possible to create a EditButton + button to update the stop lost like trailing stop, the editbutton will allow to type the SL et and button to update the position.
Thanks for the kind comment :) yes that is possible in the MetaTrader ;)
@@ReneBalke Would you like to make a video for that
Thank you so much!!!! You have no idea how much this has helped me!!!! How can I add a (Move All to Breakeven) function to the second button??? Thanks again!!
... As well as taking partials or take profits???
Thanks. Glad you liked it :)
Amazing video, very clear and helpful. Thank you.
Can I create close all button on Ipad too? Thank you sir!
Very nice tutorial, and very beginner friendly. Thank you!
Glad you like it :)
This is amazing,is there any way to integrate it within a EA
Thank you for the video! I have the button working but would like it to close only positions on the chart or symbol it's loaded on. Would I need to use PositionGetSymbol for that some how?
Yes. PositionGetString(POSITION_SYMBOL) == _Symbol
Thanks for the video! Can I modify this to use a keystroke instead of a button?
Hey, should be possible but I never did such a thing. But I think you will find something in forums about this :)
Tq Very much sir, i manage to do the button!
Hi Rene, Thank you very much> it is very helpful.
Btw, i have to remove word "_FUNTION_" then it works.
I would like to ask that if i am scalping 10 position.
Then, i would like to have button so call "SL"
Once, i click SL button. Then, it is given me the box to fill constant figure for stop loss.
Once i close the box, then all positions got same stop loss.
i already create the button for both SL and TP by follow your tutorial.
Thank you in advance.
or just give me the link of video, if you already have it.
Maybe because it is __FUNCTION__ with two _ before and after. With this adjustment it should work ;)
Hello sir, Thank you very much. And I need close all profitable button or close or close all loss button
How to trigger click event on Buy/Sell buttons on Metatrader Chart window?
Best way is to use the OnTradeTransaction event handler if you want to work with trading operations.
hi bro can give the code how to set the close button to activate by pressing C at the key board to make an option of close position by clicking it tq sooo much
hello, Thank you for these valuable informations,
Trades are closed sequentially and take time to close
Can you modify the program so that it closes all trades at the same moment, as happens when you click on Close All Positions in metatrader
thank you
Hey Rene, great tutorials. I really like them and they help me a lot. I copied your code as you said but my EA isnt deleting the button on DeInit.... there is no Error. Anny clue what the problem could be?
Rene can you please make the second button, pause and run thr trades. Lets say if ny expect advisor has opened some trades and i want it not to open more trades i can then click the pause button anf when all thr trades have reached stop loss or take profit i can click the same button to start running the expert advisor to allow trades to open
Hey, this is really easy. Just declare a global bool variable and make it true, if the button is clicked. If it is clicked again you can store false inside the variable. Before the EA opens a position you can then check the state of the variable. Just give it a go maybe you can implement it this way :)
Okay Rene I will try that
Thank you very much for the excellent explanation.
Very good... How to include more btn like close on BE, CloseBuy, CloseSell etc
Hey, today I will publish another video where I show how to add multiple buttons.. you should watch it ;)
This is a great tutorial. Thank you for sharing it. I have managed to create my buttons, but I am trying to get them to work with the bulk operations (Close All Positions & Delete All Orders) since they are much faster, but I cannot seem to figure it out. Any chance you can cover this? Thanks.
same question, bulk is faster
@@bitestonk0618 I figured it out. Bulk operations is not supported yet, but you can use asynchronous mode, which functions the same way.
m_trade.SetAsyncMode(true)
@@NSAKEY but bulk operation still faster cmiiw
@@bitestonk0618 Not that I can tell. I can close out 100 positions in about 1 second. If there is a difference, it is negligible.
Thank you very much, excellent content as always
It works for me if I add the expert advisor to a chart. But if I run it in the strategy tester, no. Why would it be? I also have the Algorithmic Trading button enabled. Regards
Chart objects do not work in the strategy tester unfortunately
@ReneBalke Very much thanks for your answer. 👍 Regards !
Nice info but What about sound effect on click? Can you show that?
Check out the PlaySound function in the documentation ;)
@@ReneBalke I tried but was unsuccessful... Can I email you my file and you put it in? Or tell me how to thanks.
@@ReneBalke anyway to contact you bro?
Hallo Rene, krasser deutscher Akzent aber sympatisch.. :D
Ist es irgendwie möglich, dass die Positionen sofort gleichzeitig geschlossen werden und nicht nacheinander, was ja nach Menge leider einige Sekunden dauern kann... Also alle sofort geschlossen wäre für Scalping noch besser! Ist das einfach umzusetzen? Danke!
How can I make the text ArielBold and wrap the text OR create a second line ?
You can use ObjectSetString(,,OBJPROP_FONT,); to change the font. Second line is easiest to achieve with a second object.
Thanks for the tutorial, could you please create one on how to close partial positions?
Hey, maybe I will do this in the future. It is really similar but you use the PositionClosePartial function :)
About the BUY & SELL button, i meant buttons that can be positioned anywhere on the screen such as above the running open positions bottom right !!! , MT5 market execution buttons are opposite side !!
Is it possible to display pnl in the button instead of "Close".
sure
Is there a way to have this "close all" as a hot key function rather than a button?
Video for this will be on the channel in 2 hours ;)
Great video with good information, thank you very much
Hy. Wie kann ich eine Hot Key EA erstellen. Sodass ich zb. die Num-Tasten zuordnen kann. um Positionen zu managen. (Buy, Sell, Close 50% oder Stop Loss to Break Even. usw...)
Hey, das habe ich tatsächlich selber noch nicht gemacht. Aber ich meine mich zu erinnern, dass es dazu im mql5 Forum einige Beiträge gibt.
Please can you also do a video on how to program objects like S&R on HTF for signal confirmation, entry on STF plus even Fibonacci strategy for sniper entry on MT5
Hey, this would be kinda complex and time consuming implement. On RUclips I show the basics so you can understand the mql5 framework. Building complex EAs like this is in most cases time consuming but not really hard. So just go ahead and follow the tutorials and you will learn how to work with objects and stuff like that :)
Hii, I was following your tutorial and everything was fine, but when I click my button, nothing happens. I got only info "The ButtonClose was clicked". Idk how to fix this, I watched the end of your video several times, but everything seems okay to me :(
Thanks dear 🙏
Hy I'll like throw something on the suggestion box plis .... An EA that can open trades on multiple symbols once the signal appear on tht symbol while other trades are running.
Hey, i put it on the list. But i cannot say if/when i will make a video about it. Maybe in the future :)
And also maybe add a button that opens multiple positions at the same price.
Super ❤❤ ...
Would it be possible to create a button to close all profitable trades?
Yeah sure that is possible. You can simply modify this program and check if a trade is in profit.
i followed along with you but my button is not closing trades, what might be a problem?
Hey, that is hard to tell without seeing the code. Please double check if you copied everything correctly from the video. Also have a look at the Experts Journal of your mt5 and check for possible errors.
@@ReneBalke there is no way you can send the link of the button u made?
@@thabisothabzafxntshiliba4682 Hey, I cannot share the code if you are asking for that. I usually delete it after I finished the video recording..
@@ReneBalke ohk thanks
I got there in the end BUT it would have been soooooooo much easier had you stuck to the original script (write a "Close All" button) rather than keep going off on tangents.
ALSO, if you had left the comments IN for newbies like me. (it's not about how YOU would do it) (that comes later)
Would have been nice if the final code was shown in it's entirety at the end ... THEN you could offer alternatives.
I seemed to be forever going backwards and forwards looking for a specific line :(
Thanks for the feedback! I really appreciate it. If you are searching for a detailed and structured course you will like my complete mql5 masterclass: en.bmtrading.de/mt5-masterclass/
Please tutorial for closed positive and negative.
Can you also please help on creating a password protected expert advisor. Example: to enter the password after dragging expert advisor on the chart. 🙏🙏
Hey, that is really easy. You can just create a input string variable. Then in the OnInit function you will have to compare it to any string like
if(InputString != "Password") ExpertRemove();
Excellent video
If possible one of the days kindly show us, how to write an expert advisor which uses 61.8% and 50% fibobacci level retracement to place entries. If possible one of the days.
Fibos were requested frequently so I just recorded a video on this. It will be available tomorrow :)
Thank you very much Rene
What you was saying "I don't bother with comments" ... You should be encouraging your students to keep them and even add their own until they become masters ... Even then there are an asset for anybody else who is less skilled but has to work on it
Yeah right comments can be really useful :) Maybe I should use them more...
Fantastic channel, thanks for very much for the wonderful useful applications. Please do an application for BUY & SELL buttons with programmed lot values, so a $10 BUY Button (1lot) and a 0.1c Buy Button(0.1 lot), for scalping it will be amazing.
Thank you! :) I receive a lot of requestes lately and cannot handle all of them. That is why I always recommend to learn the basics. But maybe I can cover this in the future.
Please would this work in the strategy tester
Hey, by default the chart events do not trigger the event handler in the tester. But you can check the button state in the OnTick function and close positions if the button is closed. Do not forget to set the button state to false afterwards. ;)
@@ReneBalke thanks
i followed all of this to a T (i think) and when i click close nothing happens:( idk what i did wrong ?
Great
Thank you for good vdo
the problem with your tutorials is that uyou dont share the codes from the tutorial which could be a very good reference point
Hey, I believe that you have the best learning effect if you write the code on your own. If you just copy and paste code from the internet you will never be able to write your own programs.
You should not create excessively long videos; many people will feel reluctant to watch them. Instead, you should make shorter, concise videos and keep your narration minimal, focusing on what's necessary
Great video but today there is chatgpt for these things
fucking hell why do i have to watch a 43min tutorial just to get a simple button that should be included by default
:D