Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1204
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
What does the time scale mean in the trading story?
X scale. What do the values on the scale mean?
Tell me, what do the numbers on the chart in the trading statement mean?
What do these numbers on the chart in the trading statement mean?
The number of the trade which led to the change in the balance.
You may try to open the window"Strategy Tester", tab "Settings" - press the button next to the symbol and correct the symbol - set the spread to "0".
MT5
Please advise how to implement lot increase depending on balance.
But not by %, but by step by balance growth value.
With each $1000 balance increase I want to increase lot by a step of 0.1
My initial data is thepair EUR/USD
Deposit (initial balance) 1000$
Initial lot 0.1
Need.
If the deposit:
1000 then lot 0.1
2000 then lot 0,2
3000 then lot 0,3
Etc.
I now use this method:
Etc.
But instead of this endless enumeration, I would like to have a function.
I tried to make it up myself, but it didn't work so well.
Perhaps because of problems with normalization...
Please advise, maybe someone has a ready-made solution or an example.
MT5
Please advise how to implement lot increase depending on balance.
But not by %, but by step by balance growth value.
With each $1000 balance increase I want to increase lot by a step of 0.1
My initial data is thepair EUR/USD
Deposit (initial balance) 1000$
Initial lot 0.1
Need.
If the deposit:
1000 then lot 0.1
2000 then lot 0,2
3000 then lot 0,3
Etc.
I now use this method:
Etc.
But instead of this endless enumeration, I would like to have a function.
I tried to make it up myself, but it didn't work so well.
Perhaps because of problems with normalization...
Maybe someone has a ready solution or an example.
Pay attention to the quotient when dividing the deposit by 1000. At a deposit < 2000 there will be 1 integer and some tenths, hundredths... which we are not interested in. The deposit of 2000 will be 2 and so on. It turns out that it is enough to multiply the integer part of this fraction by 0.1 and get what we want.
And in your list there is a mistake, though insignificant. The correct way is as follows
MT5
Please advise how to implement lot increase depending on balance.
But not by %, but by step by balance growth value.
With each $1000 balance increase I want to increase lot by a step of 0.1
My initial data is thepair EUR/USD
Deposit (initial balance) 1000$
Initial lot 0.1
Need.
If the deposit:
1000 then lot 0.1
2000 then lot 0,2
3000 then lot 0,3
Etc.
I now use this method:
Etc.
But instead of this endless enumeration, I would like to have a function.
I tried to make it up myself, but it didn't work so well.
Perhaps because of problems with normalization...
May be someone has a ready solution or example.
Find rounding using MathCeil,MathRound or MathFloor.
See example how they work:
and result.
I recommend to useMathFloor.
Pay attention to the quotient when dividing the deposit by 1000. If the deposit < 2000 will be 1 integer and some tenths, hundredths. which are not of interest. The deposit of 2000 will contain 2 and so on. It turns out that it is enough to multiply the integer part of this fraction by 0.1 and get what we want.
And in your enumeration, albeit minor, there is a mistake. Correct is
Alexey
Thanks. I got the idea of dividing by 1000 and reducing to integer, I'll try to implement it.
<= was set to automatically, not from the code. Writing with my hands, and pens are such ...))
Select the rounding operation from MathCeil , MathRound or MathFloor.
An example of how they work:
and result.
I would recommend usingMathFloor.