![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
How to add int b to string Time2 minutes now or how to plus minus make it random
Please advise on the existing methods to limit the number of orders:
1) how to link the number of orders to the available balance, so that there is a dynamic, for example, if available funds are less than half the balance, then the limit is triggered
2) How to limit the number of simultaneous orders to a fixed value, e.g. 10
It's very simple and easy to code, like all the professionals.
Only, I never thought I'd be unable to explain it in words, let alone write the code.
What I need is for random shift to come from one oscillator but randomly in both directions.
For example, like pointer oscillating near zero (going down then up).
And this my zero, or the average value will be my set time.
How do I divide all randomness into two parts in the middle?
int a=MathFloor(MathRand()/32767.0*300);
if (a > 150) a=-a;
Comment("a=",a,"\n",
"plus or minus ",TimeToStr(TimeLocal()+a, TIME_SECONDS) );
}
Will TimeToStr(TimeLocal()+a,TIME_SECONDS) be correct or should TimeToStr(Time[i] +a,TIME_SECONDS) or TimeToStr(iTime(NULL,0,i)+a) or ????
I need random shift to happen from one oscillator but in both directions randomly.
It's like the oscillating hand near zero (going up and down).
And this my zero, or the average value will be my set time.
Somehow everything must be divided into two parts by chance in the middle or what?
Then it's like this:
Would TimeToStr(TimeLocal()+a,TIME_SECONDS) be correct or should TimeToStr(Time[i] +a,TIME_SECONDS) or TimeToStr(iTime(NULL,0,i)+a) or ????
How do I know what is right and what is wrong? Only you can know that. I will only explain which code means what, and you decide for yourself what you need and what is right for you.
You add a seconds to the local time in seconds and the result is converted into a string.
We add a seconds to the opening time of the i-th bar and the result is converted into a string.
A seconds is added to the opening time of the i-th bar on the current chart in seconds and the result is converted into a line.Please advise on the existing methods to limit the number of orders:
1) how to link the number of orders to the available balance, so that there is a dynamic, for example, if available funds are less than half the balance, then the limit is triggered
2) How to limit orders number to a fixed amount, for example 10
Can you please tell me which methods to use to limit orders number:
2) how to limit the number of simultaneous orders to a fixed value, e.g. 10
>> Then it's like this:
>> Thank you,
>> a monument to you.
You need a monument.
Not yet :))
How kind everyone is! You might as well shoot yourself
Well, at least the bust is a good thing...
They should have put it up for two heroes of the USSR in their lifetime.
At the expense of the state... :)))