Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 247
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
Made up a formula to calculate the lot, can you tell me where the error might be? The order does not open because of some incorrectness.
The formula is still valid for a deposit of 100$ and above, with a leverage of 1-100 and above. And if the deposit without leverage 1 000$ it turns out that the formula does not work because we have FreeMargin/Contract = 0.01 and we cannot deduct from this value because we will not meet the trading conditions.
On the other hand, why should we deduct it if FR&Margin already takes into account open positions? Then it would look like this
I will go and test it.
Greetings)) What is 0.65? Where did it come from?
I was thinking about leverage, but I came to the conclusion that the balance is in theory already set with the leverage. Or am I wrong?
Is 0.65 a reserve for 35% slippage or what? By the way, it is a good idea, because if you set the lot in such a way, you will lose a position and that will be the end of the line!
I like it! The formula worked after I removed losing, it's cool)) in short, the lot was 0.02, then when three positions went into drawdown, the emergency lot was calculated as 0.1, that is, 5 times! However, my function is sensitive to further losses when an emergency order is opened so there should not be any problems.
Colleague, thanks for the valuable thoughts! I will go and test it!
I have also decided to check trading conditions. How do you like this code?
If you flip it over - BUY instead of SELL and SELL instead of BUY - it will be better
Try it, Colleague!!!
The robot, instead of stating a fact, has to issue a recommendation: Boss, add money. I've already wasted those...
If we reverse it - BUY instead of SELL and SELL instead of BUY - it will be better
Try it, Colleague!!!
The robot, instead of stating a fact, should give recommendations: Boss, add money. You've already wasted them...
It's ok, there were specially left settings to trigger an emergency order - I had to see what lot would pick up.
I've left this one for now. I've tried it with balance, I believe it will be more accurate in terms of margin, but the result is the same. Let's analyze the test results later.
Internet's back on! Can I write to an email?
Is this how it should be? Levels -0.75 and +0.75.
It is easier to use one variable. First 0. Then +1 -1 +1 -1
Yes, like this. How should I write it in the Expert Advisor in such a way, that when it is launched, if we are in a gap between levels, it takes the value of the last one from which we have bounced?
How do you mean "fought off"? Did it attack us? Fought back when - before the launch? How could we fight back if we'd just launched? Read before you send it - does it all make sense?
What do you mean by fighting back? Did it attack us? Were we beaten back before the launch? How could we fight back if we just launched? Read it before you send it - does it make sense?
OK, not rebounded, but produced a bounce from the line. Provided that the EA is placed on another machine/terminal or in case of computer shutdown, restarting the terminal, it (the EA) started working immediately by calculating at what level the price was last and setting the right variable value, rather than waiting for the price to reach the desired level. I hope I've described it clearly.
What does it have to do with another machine or terminal? Or shutdown - restart. Do you mean to switch the computer on or to restart the Expert Advisor? Why does it have to be a bounce, but if it leaves the level line and crosses back? And if it waits - it's just skipping one opportunity when switching on. You can discard that at first, and come back to it when you're done. And then where do the lines come from, when do they appear, who puts them in, or how does the EA calculate them. If they are placed on another computer or before the computer is switched off, the price can go far away. If the levels are calculated by the Expert Advisor itself, that's another matter. Look now: the price has bounced from the upper level and wandered between the levels for an hour. And then we have switched on the computer and activated the Expert Advisor. Obviously, we have to attribute the time of action to this bounce. An hour has passed and the rebound is forgotten. You see, there are a lot of questions! And you are clear. It is clear to you, you know the essence of the matter. But from the outside it is darkness. The art of programming is the ability to ask a lot of questions and find answers. Take a look at the script - maybe there's a rational point here