
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
MQL4:
MODE_LOTSTEP
24
Step for changing lots
MQL5:
SYMBOL_VOLUME_STEP
Minimal volume change step for deal execution
double
So it informs you about the smallest step up or down in lotsize if it is 0.01 then your lots have to agree to 0.01, 0.02, 0.03, 0.04 etc.
If it would be 0.1 then your change in lotsize would have to meet 0.1 next 0.2 next 0.3 etc.
So i do not understand your:
{
lotstep=lotstep*100;
Print("lot step: ",lotstep);
}
Maybe you mean a different lot step ?
Normally you would not change the value because it is fixed for each symbol.
if(sparam==lotbuttonplus)
{
if(lotsize>=(lotstep*100))
{
lotstep=lotstep*100;
Print("lot step: ",lotstep);
}
Things can get confusing if you change the value of an intuitively-named variable. I would suggest lotstep is always lotstep, nothing else.
How about something like this?
lotmaxdivide=lotmax/lotmax *(lotvalue*10);
lotsize=fmin(lotmaxdivide,lotsize+(( ctrlfalse) ? increment*10 : increment));
Marco vd Heijden:
So i do not understand your:
{
lotstep=lotstep*100;
Print("lot step: ",lotstep);
}
Maybe you mean a different lot step ?
Normally you would not change the value because it is fixed for each symbol.
Yeah! I mean different lot step, so when lot size reached to lot size 1.00 for EURUSD. Then I need to lot size increase by 1.00. Before lot size reached 1.00 - lot size increase 0.01, 0.02 etc. ( which one I want ) - but after lot size reached 1.00 - then lot size increase 1.00, 2.00, 3.00, etc.
That is what I want to do in this subtopic.
Thanks so much more.
Things can get confusing if you change the value of an intuitively-named variable. I would suggest lotstep is always lotstep, nothing else.
How about something like this?
lotmaxdivide=lotmax/lotmax *(lotvalue*10);
lotsize=fmin(lotmaxdivide,lotsize+(( ctrlfalse) ? increment*10 : increment));
( I just little changed not - ... ? lotstep : lotstep*100 - ...? lotstep : lotstep*10 )
Yeah! In my original code things confuses.
After your great help, I solve my issue. Thanks a lot.
Also I wish lot size increase like this.
So lot size increases like this 0.99, 1.00, 1.01, 1.11.
But I need like this 0.99, 1.00, 1.10, 1.20 etc.
Thanks in advance.
I think 0.99, 1.00, 1.01, 1.02. would be the best idea.
Stick to the smallest available step i guess.
Why do you want to take these ULTRA LARGE steps?
Have you tried it?
Please try it.I think 0.99, 1.00, 1.01, 1.02. would be the best idea.
Please try it.Stick to the smallest available step i guess.
Why do you want to take these ULTRA LARGE steps?
Have you tried it?
I already tried it, think if I need to reach lot size 5.00 I should 40 times click lot plus button ( + ctrl ).
Wow and why five ?
You can just use + and - in stead of *
But there is one line in my robot that saves it from total destruction and it's this:
But there is one line in my robot that saves it from total destruction and it's this:
That is absolutely true, also of course I respect that setting.
But this is just a issue - I mean I can adjust it anytime.
Maybe I need a little experience about that lot size.
I think this subtopic could close for now.
Thanks @Marco vd Heijden and @honest_knave
#Lot Step - Closed
#Lot Size Max - Open
@Marco vd Heijden - thanks so much more for your latest comment, which is I inspired to write this part of code for my EA's. ( I just stopped to write other functions - that I try to write this one before others )
So, as usually I try to test something for lot size max.
When lot size better then lot size max, print function does not let me about trade mode.
After I solve this issue, I need to put this function Sell and Buy button functions.
Q: How can I do print function let me about trade mode either? ( - lot size better then lot size max or less then it )
Q: Is this method useful for lot size max?
Thanks in advance.
{
string trademode;
ENUM_ACCOUNT_TRADE_MODE accounttype=(ENUM_ACCOUNT_TRADE_MODE) AccountInfoInteger(ACCOUNT_TRADE_MODE);
if(accounttype==ACCOUNT_TRADE_MODE_DEMO)
{
switch(accounttype)
{
case ACCOUNT_TRADE_MODE_DEMO:
if( lotsize > ( lotstep * lotsizemax ) ) return;
trademode="demo";
break;
case ACCOUNT_TRADE_MODE_CONTEST:
trademode="contest";
break;
default:
trademode="live";
break;
}
}
Print("Trade Mode: ",trademode);
}
No thats for verifying if it's a demo account or a live account, contest is rarely used.
Lot max can be very easy.
// calculate lotsize here
//---
// check if lotsize is not too high
if(lotsize>lotsize_max)
{
lotsize=losize_max;
}