Calculate Lotsize (Percent of Account) In MT5 Programming | Easy Function Explained

  Рет қаралды 16,848

René Balke

René Balke

Күн бұрын

Пікірлер: 110
@magnusbestest
@magnusbestest Жыл бұрын
I'd say you're the best person to explain MT5 coding on KZbin right now.
@allanregista4422
@allanregista4422 Жыл бұрын
I 💯% agree with u mate.. hat's off for Rene...
@rzgakademi5036
@rzgakademi5036 2 жыл бұрын
I was looking at calculating lots from the internet right now :) thank you very much :) :)
2 жыл бұрын
Perfect timing! You are welcome :)
@jesjan7031
@jesjan7031 Жыл бұрын
Hi, Rene, Thank you very much! I love everyone of your videos because it is very clear and concise and I have learnt a lot from you. Thanks!😊
@RobotInnovationandAI
@RobotInnovationandAI Ай бұрын
This has done marvelous job
@hagenlubbers7035
@hagenlubbers7035 Жыл бұрын
René Balke, du bist mein Held.
@MaximSTP
@MaximSTP 11 ай бұрын
Hi, Rene, greatly appreciate your video. Very simple very clear and short. I wish you put those small code in the notes to video, but is is a good way to practice too.
@horizon_brasil
@horizon_brasil 4 ай бұрын
You are an angel, you saved my life!
@abel6515
@abel6515 2 жыл бұрын
Rene the main man💪🏿
@oscarcalle4234
@oscarcalle4234 3 ай бұрын
Great video, thanks!.. One thing I'd like to see different about your video and perhaps you can make another video on it is risk percentage of maximum balance always whether trades are lost or won... so if one starts with $10k and 5 or 10 trades are lost consecutively, the EA will remember to risk 1% or $100 until a new maximum balance is reached.
@josephkorte9741
@josephkorte9741 11 ай бұрын
Das Video hat mir sehr geholfen. Vielen Dank. Mach weiter so!
@J.P.Satrio
@J.P.Satrio 5 ай бұрын
Clear explanation. Thank you!
@brainblood3674
@brainblood3674 2 ай бұрын
Very well explained.
@bosonmez
@bosonmez 8 ай бұрын
You are perfect Rene! Tahnk you.
@bazilokello5791
@bazilokello5791 4 ай бұрын
Hi Rene, I am glad for every bit of the video you deliver here, thanks a lot for the kind sacrifice! I have an issue at hand..., my EA trades for minimum 14 days(two weeks) in the tester But now I have realise that in the real environment, my EA is failing to track the recent status when I reboot my VPS over the weekend! My humble request is, if u don't mind... Please can you make one video on how to write and save the basic MQL4 EA parameters(like ticket number, magic numbers, trailing stop levels etc) to a file and then the EA will load and read these basic saved parameters from this file during EA initialization to track its previous status and continues trading seamlessly as if nothing has happened? Thanks a lot in advance!
@koolermactrez6014
@koolermactrez6014 2 жыл бұрын
Great video man. Very Nice!
@supermonkey161
@supermonkey161 Ай бұрын
Hi, your lot calculation method is good for the EUR as the Base currency for the account but when you want to use USD or GBP or any other currency the EA will still use the same lot size which is where the risk amount will deviate from the input risk (1%) amount specified. How can you resolve this issue so you can have different base currency accounts which are adjusted for to ensure 1% risk is linear across those accounts? Backtest your own range breakout EA you sell and you will see what I mean. I've tested it myself.
@BeastZzoBeast
@BeastZzoBeast 4 ай бұрын
Thank you for this video
@LordFury83
@LordFury83 2 жыл бұрын
thanks for an amazing tutorial!
@farbeyondtrading
@farbeyondtrading Жыл бұрын
incredible. Thank you for this clear explanation :)
@anypuppet
@anypuppet 6 ай бұрын
What if we want to trade a pair that do not have USD in it, like for example CHFJPY? Then we must add some conversion logic to make it work, right? How about making a follow up video about this?😊
@percivalbuenvenida1925
@percivalbuenvenida1925 2 жыл бұрын
thank you, this is very helpful
@1rodne
@1rodne Жыл бұрын
Hi Rene will it work if i only copy the (on tick) function and paste it on the other( on tick) program function or i will also have to copy the (on int) calculate ?
@elvisdjabia7626
@elvisdjabia7626 2 жыл бұрын
Hi René, can you please make a video (if possible) for this kind of case ? - RSI (1000), levels 10 and 85 - EMA (5) in the RSI window How to retrieve the value of EMA(5) when it crosses the 10 or 85 level of the RSI ? Exple : EMA value is 6869.85402, so how to prove that the EMA is above the level 85 of the RSI or below the level 10 of the RSI?
@atNguyen-wd4fe
@atNguyen-wd4fe 2 жыл бұрын
Thanks for this
@abelzhuwao4761
@abelzhuwao4761 Жыл бұрын
Hello sir great video , thank you . I have a question though , i have seen that the function only works on currency pairs when I try to use it on boom and crash instruments it generates an error invalid Volume both for the lotsize and the SL could you advice me how I can rectify this error
@akshaysundaresan2418
@akshaysundaresan2418 4 ай бұрын
Hai Rene !! I have a question !! Is it possible to Risk 0.1% of the balance using this code .I tried it and doesn’t work and it’s by default risking only 1% as low .Why is it so ?
@hollywoodshortscreen9958
@hollywoodshortscreen9958 Жыл бұрын
Hi Rene. I am your big fan and i learnt lot from your videos. Thank you so much for these videos. I created my first ea. And it is working very good. And i have few questions if you can hel me it would be great friend. Few of my friends are interested to use my ea(looking the performance of the ea) but i want to give them for certain period of time. So my question is how to set expiry date on source code so that they can use for certain period of time
@e11fxtrading71
@e11fxtrading71 2 жыл бұрын
THANK YOU FOR SUCH GREAT WORK, WOULD YOU PLEASE SHOW US HOW TO CODE AN EA WHICH HAS A MAGIC NUMBER IF POSSIBLE. THANKS
@tristanwalters
@tristanwalters 10 ай бұрын
Hi Rene, Great channel, I am really enjoying watching your videos and it is helping me a lot. The lot size calculation works really well for me, however, on JPY pairs the code does not work for me. It continually comes back with 0 lots and I can’t work out why. Can you let me know if you have any ideas on why this maybe happening? Thanks
@tradewithtuan
@tradewithtuan 4 ай бұрын
i got the same problem with jpy pairs. I do not know how to fix that
@MohammadrezaAlikhani
@MohammadrezaAlikhani Жыл бұрын
Hi sir. Thank you for your hard work and awesome contents. Unfortunately, this does not work for indices like S&P500 or NDQ100 or XAUUSD. I mean, it opens positions with way more than percentage of my account! Can you please help me with this?
@TheEcherriman
@TheEcherriman 2 жыл бұрын
Hi René, thanks for this. I am having problems writing a robust trading module, i.e. checking for success within a loop and retrying until the trade is successful. Do you think you could cover this topic please as I think a lot of people will be trusting to luck that the code they write will work ? Many thanks
@andresgiraldo2723
@andresgiraldo2723 2 жыл бұрын
Hi René, thanks for sharing. Great content. Questions 1: (min 24) to calculate the sl you substract entry - 280 points, and then to calculate the lots you do the substraction again. Is this correct? Question 2: Since your account is in USD, does this calculator still works with currency pairs that don't have the USD in it? I.e. EUR/AUD or NZD/CAD Thanks
2 жыл бұрын
Hey, thanks for the kind words :) Question 1: Yes, that is correct:D Question 2: Yes, this should work. The tickvalue should always be the accurate value in your account currency.
@andresgiraldo2723
@andresgiraldo2723 2 жыл бұрын
I did some tests and you are right. It works with any pair.
@donaldrubio8735
@donaldrubio8735 11 ай бұрын
Hi Rene, will this be applicable on a 3-4 digit value pairs? If not, then what needs to be chamged? Thanks
@apathyreview3964
@apathyreview3964 11 ай бұрын
Just round to the nearest 0.1 that way you can run it anywhere and it makes very little difference.
@vikrant260
@vikrant260 Жыл бұрын
brother I like this system of yours, but what if I don't want to have slDistance and only want the riskPercentage parameter in my function...plz help me to cross my boat across this river...
@ATD2.00
@ATD2.00 Жыл бұрын
hi thanks how can calculate both for buy and sell because here we cant add another value for function calclots 2 entry price or maybe i have to create a new function calclots for sell like calclotssell haha
@chittaranjansahu581
@chittaranjansahu581 2 жыл бұрын
I am from India, Always see you video which is very educative. Thank🙏🙏. Sir please make a video of crossover moving average based on crossover of a special symbol moving crossover. e. g. if 14 ema cross 50 ema in USTECH and also if 14 ema > 50 ema of US500 than buy.
2 жыл бұрын
Hey, thanks for the kind feedback :) Check out the other videos on this channel. I already made one on crossing moving averages ;) Also I made one about multi currency trading systems I think. Maybe you can combine them.
@martinsengbusch33
@martinsengbusch33 9 ай бұрын
Seems to work correctly on EURUSD, but when I tried to use it for example EURJPY, then lot size was way off?
@indexfxcreed8389
@indexfxcreed8389 2 жыл бұрын
Hey Rene...I have an EA which works in spiking markets such as BOOM and CRASH...Problem is that my BUYSTOPS which are meant to be activated by the spike in BOOM indices but they only get activated after the spike occurs and not where the EA set them....Can you please do a video explaining how to solve the problem
@sultansarvaiya1664
@sultansarvaiya1664 2 жыл бұрын
Thanks Bro
@kensmith2280
@kensmith2280 2 жыл бұрын
Thank You. You're, so smart that you make my head hurt... Ha Ha!
2 жыл бұрын
Haha :D Thank you!
@eggelisback
@eggelisback 2 жыл бұрын
LOVE YOU RENE
2 жыл бұрын
@eggelisback
@eggelisback 2 жыл бұрын
@ Will you be doing an orderblock video in the coming weeks?
2 жыл бұрын
I don't even know what that is :D Can you explain what you mean with orderblock?
@eggelisback
@eggelisback 2 жыл бұрын
@ do you have an email I can send you a link or reference? Would be amazing :)
2 жыл бұрын
@@eggelisback You can just post the link here or describe it really short. I am pretty sure I will know what you mean. I just don't really know the term orderblocks.
@machielvandertoorn8758
@machielvandertoorn8758 Жыл бұрын
Works, but for a currency pair like EURZAR, they maounts arent as straigt forward with TickValue, LotSize and LotStep having many digits after the zero. Ill rewatch the video, maybe I missed something out
@apathyreview3964
@apathyreview3964 11 ай бұрын
Why. Why would you trade ZAR. And I'm from SA. The spreads are the worst and the ROI is terrible. Just trade EURJPY or EUR USD.
@thatoabbiesima7810
@thatoabbiesima7810 2 жыл бұрын
thank you so much for your videos.i cannot thank you enough for the insight. i can code different trading robots. recently i coded a robot based on a powerful indicator called ADX. Manually it trades very well after changing settings higher than the default. but then after i programmed it it compiles without any error but then when i try to test it it closes..it says thread finished and then shutsdown..
@thatoabbiesima7810
@thatoabbiesima7810 2 жыл бұрын
i am willing to send you the file in word document because i have been very profitable with it on a life account just that i wanted to automate it.
@brezi2620
@brezi2620 Жыл бұрын
Hi Rene, thanks for the great video! I have a question, by implementing this lot size calculator i chose to risk 1% per trade, but when it hits SL/TP i lose some times 0.02% or 0.4% more than it should (total 1,42% risking 1%) any advice? Keep up the great content !
@rybalchenkofamily
@rybalchenkofamily Жыл бұрын
this is called slippage....this is unavoidable especially on shorter timeframes. Make sure to take into account the spread.
@dixitkhosla5219
@dixitkhosla5219 3 ай бұрын
I have been using this function, but now it is giving wrong result, moneyperLotStep is not right, I don't understand what changed. How come different result
@haydenlyon6056
@haydenlyon6056 2 жыл бұрын
Hi Rene, first of all I would like to thank you for all of the great content you are providing, you have no idea how good it is to follow your videos and learn! I know that you are asked many many many questions and usually I can figure out my mistakes, its half of the enjoyment! But... for the last week and a half I have been trying to use this code and keep getting the same errors when sending orders, it keeps giving me many.. 'no money', 'not enough money' and 'invalid volume' errors. Have you had this before? Any ideas where I should be looking in my code? I'm at a loss! Love your content! Hayden
2 жыл бұрын
Hey, thanks for the kind feedback :) No money or not enough money usually means what it says ;) You most likely do not have enough money in the account for the margin requirement. And invalid volume often means that you try to trade a either too big or too small volume or maybe any invalid volume like 1.012 (three digits after the decimal points are not allowed).
@haydenlyon6056
@haydenlyon6056 2 жыл бұрын
@ Hey mate! Found the issue in my expert by watching another of your videos, quite simply it was placing too many trades! An error in my programming! Thank you once again, I'm saving for your course, you deserve the coin!
@Willbrse
@Willbrse Жыл бұрын
Hi Rene, I have a weird problem with this code... it only works with buy. Been trying to make it sell for hours and I can't understand what is wrong. It just won't run, I don't get any warnings even when I add a wrong math on purpose (with buy it gives me the proper warnings). Does it work on your side? All the other code works fine with instand sell or pending sell orders. This ony completely refuses to work and I'm lost xD
@Willbrse
@Willbrse Жыл бұрын
Relpying here to say that I fixed it by adding the SL in points to the calc lots function rather than that "entry - sl", this way only works with buy *In the ea I made I put entry price and target price and the program does all the rest. Thanks again for these tutorials
@cedricmataso2446
@cedricmataso2446 Жыл бұрын
Hello brother for gold it is not really giving the same result
@runbama1013
@runbama1013 Жыл бұрын
informative
@MrHumbleOne
@MrHumbleOne Жыл бұрын
Hi René I am trying to implement a TP with the and I’m adding TPPoints inputs then double tp = entry + TPPoints * _Point; and normalizing same as done with Sl but it is now not trading :( can you help me?
Жыл бұрын
You can use the print function to show the calculated TP and SL value in the journal. Maybe you can find the problem if you see the values.
@dropout6043
@dropout6043 Жыл бұрын
Hi Rene, first of all, thanks for sharing! A small question about this piece of code: It is indeed possible to calculate lots with forex pairs, but when it comes to calculating (for example) XAUUSD, DAX30, etc... Nothing works anymore. Indeed, the lots are much too big, as you could see by doing a test on your side. Would you have a way to solve this problem? Thanks again for your work!
Жыл бұрын
Hey, it should also work for indices or metals. This is weird. Are you sure the ticksize, tickvalue, lotstep values etc. coming from your broker are correct for these symbols? You can check them using the Print function.
@dropout6043
@dropout6043 Жыл бұрын
@ Yes I am sure, I have printed all the elements... Look, for EURUSD, no problem: ticksize = 0.00001, tickvalue = 0.8790, lotstep=0.01 & riskMoney=150€, slDistance=0.002. Then, moneyLotStep = (0.002/0.00001)*0.8790*0.01=1.758 & finally lots = (150/1.758)*0.01=0.85. So IT WORKS with EURUSD. But when we look at XAUUSD or GDAXIm... XAUUSD : ticksize = 0.01, tickvalue = 0.1, lotstep=0.01 & riskMoney=150€, slDistance=2.0. Then, moneyLotStep = (2.0/0.01)*0.1*0.01=0.2 & finally lots = (150/0.2)*0.01=7.5. GDAXIm: ticksize = 0.1, tickvalue = 0.1, lotstep=0.1 & riskMoney=150€, slDistance=20.0. Then, moneyLotStep = (20.0/ 0.1)*0.1*0.1=2 & finally lots = (150/2)*0.1=7.5 So as you can see, if you only want to lose 150€ with EURUSD you have to take 0.85 lots (and it does work). On the other hand, still for 150€ of authorized loss with GDAXIm and XAUUSD it specifies 7.5 lots, (which is moreover impossible with GDAXIm because the maximum lot is 5.0) but let's suppose that we take 5.0 GDAXIm and 7.5 XAUUSD, well in the end we do not lose 150€ but... >1000€...
@ayeshasam2971
@ayeshasam2971 Жыл бұрын
I have the same question is ve been trying to use it on xauusd, but it simply gives out huge lots. Did you find the solution @dropout6043 and can you pls help @ReneBalke
@stefanventer575
@stefanventer575 2 жыл бұрын
Hi René, can you please make a video (if possible) of how to create a Heikin Ashi indicator and display it on the charts. And maybe also how to determin a buy signal when there is no candle wick at the bottom and a sell signal when there is no wick at the top.
@koolermactrez6014
@koolermactrez6014 2 жыл бұрын
Can you make one that is based on opening trades at specific time. like open positions every day at 1200hrs and close after 5minutes
2 жыл бұрын
Check this out: kzbin.info/www/bejne/gZ24eKSBlrGel7M&ab_channel=Ren%C3%A9Balke
@moiazahmad1299
@moiazahmad1299 2 жыл бұрын
Hey Bro, any easy method to set TP on price. I know you are expert
2 жыл бұрын
Hey, have a look at some of the tutorials on this channel. I showed it several times there :)
@moiazahmad1299
@moiazahmad1299 2 жыл бұрын
@ Please share the link to share some one expert
@moiazahmad1299
@moiazahmad1299 2 жыл бұрын
Hey, Expert Pls, , link of video to share.
@rayzamani4714
@rayzamani4714 2 жыл бұрын
Pls sir i studied your lecture on how to build ea but after am don't seem like the ea does not open trade on my desktop i don't know why
2 жыл бұрын
Did you copy everything from the videos? Did you include the CTrade class and call the Buy and Sell function? If you did so check out the journal. You should find some error message there.
@rayzamani4714
@rayzamani4714 2 жыл бұрын
@ yes i try to modify is on awesome oscillator (can u creat ea that trend only the cross over
@rayzamani4714
@rayzamani4714 2 жыл бұрын
@ can u do ea on awesome oscillator
@rayzamani4714
@rayzamani4714 2 жыл бұрын
@ the problem has been solve pls creat an ea with it just a quick view(awesome oscillator based on the crossing)
@rayzamani4714
@rayzamani4714 2 жыл бұрын
Pls i look forward to this sir
@raomadhav7375
@raomadhav7375 Жыл бұрын
How did SL 280 points became 0.00280? how is that calculated for SL distance?
@winfrednyankpani4617
@winfrednyankpani4617 2 ай бұрын
280x 0.00001
@hasa4628
@hasa4628 Жыл бұрын
why explain how to code in every video
@sksksk1598
@sksksk1598 Жыл бұрын
How do you file your tax return? This matter bothers me
Жыл бұрын
You can just tell your tax authority how much money you made trading ;) I use ic markets as a broker and I just ask them for a list of my trades for the last year. This was accepted by the German tax authority so far.
@sksksk1598
@sksksk1598 Жыл бұрын
@ Thank you, enthusiastic blogger. I wish you a beautiful day
@hassanov056
@hassanov056 Жыл бұрын
Hi Rene what about ml4,hhhhhhh.😂
My Daughter's Dumplings Are Filled With Coins #funny #cute #comedy
00:18
Funny daughter's daily life
Рет қаралды 34 МЛН
Seja Gentil com os Pequenos Animais 😿
00:20
Los Wagners
Рет қаралды 39 МЛН
버블티로 부자 구별하는법4
00:11
진영민yeongmin
Рет қаралды 22 МЛН
Smart Sigma Kid #funny #sigma
00:14
CRAZY GREAPA
Рет қаралды 48 МЛН
MT5 News (Calendar) Expert Advisor Programming Tutorial
27:39
René Balke
Рет қаралды 10 М.
How to Read Candlestick Charts (with ZERO experience)
55:18
Ross Cameron - Warrior Trading
Рет қаралды 2,2 МЛН
Trading Psychology | Why Normal Doesn’t Make Money | Part 1
18:39
The Rise of India's Private Space Firms | Momentum
24:02
Bloomberg Originals
Рет қаралды 308 М.
Gold Midnight Flow Scalping Strategy Programming Tutorial for MT5
1:17:20
iCustom for MT5 - Writing experts using iCustom
30:04
Orchard Forex
Рет қаралды 18 М.
My Daughter's Dumplings Are Filled With Coins #funny #cute #comedy
00:18
Funny daughter's daily life
Рет қаралды 34 МЛН