Please write a script (mt4) to open positions, the task is as follows:
Throw it on the chart, input parameters appear and there are three lines:
Buy/Sell
Lot size
Item quantity
Then we should enter lot=1.86 and quantity=25
The script counts and rounds the lot to the possible, if the lot is less than allowed, for example, lot 0.12, and the amount of 20, then opens min.lots the maximum possible amount, until it will collectively 0.12 = = 0.12/20 = 0.006, min.lot 0.01, then open at 0.01 lots 12 positions.
If we type in 2.87 lot and number of 25, then 2.87/25=0.1148, rounded down, then open 25 units of 0.11 lot
Optimisation a bit: the main code should be moved to OnTimer()... i.e. you should not depend on someone else's mood, exchange/DC/no-exchange working... :-)
Please write a script (mt4) to open positions, the task is as follows:
Throw it on the chart, input parameters appear and there are three lines:
Buy/Sell
Lot size
Item quantity
Then we should enter lot=1.86 and quantity=25
The script counts and rounds the lot to the possible if the lot is less than the allowable, for example lot 0.12, and the amount of 20, then opens min.lots the maximum possible amount, until it will collectively 0.12 = = 0.12/20 = 0.006, min.lot 0.01, then open at 0.01 lots 12 positions.
If we type in 2.87 lot and number of 25, then 2.87/25=0.1148, rounding down, then open 25 units of 0.11 lot
Expert Advisor. x=, y=, z=. if x-y>=z then buy, stoploss, trailing stop. if y-x>=z then sell, stoploss, trailing stop. otherwise x=y. loop it. That's it.
Expert Advisor. x=, y=, z=. if x-y>=z then buy, stoploss, trailing stop. if y-x>=z then sell, stoploss, trailing stop. otherwise x=y. loop it. That's it.
couldn't resist...
When a Pithecanthropus joked like that, the tribesmen threw stones at him).
I couldn't resist...
Good, you see, Yuri was able to write, and you're all jokes for three hundred, jokes for three hundred...
Please write a script (mt4) to open positions, the task is as follows:
Throw it on the chart, input parameters appear and there are three lines:
Then we should enter lot=1.86 and quantity=25
The script counts and rounds the lot to the possible, if the lot is less than allowed,
for example, lot 0.12, and the amount of 20, then opens min.lots the maximum possible amount, until it will collectively 0.12 = = 0.12/20 = 0.006, min.lot 0.01, then open at 0.01 lots 12 positions.
If we type in 2.87 lot and number of 25, then 2.87/25=0.1148, rounded down, then open 25 units of 0.11 lot
Thank you!
couldn't resist...
Please write a script (mt4) to open positions, the task is as follows:
Throw it on the chart, input parameters appear and there are three lines:
Then we should enter lot=1.86 and quantity=25
The script counts and rounds the lot to the possible if the lot is less than the allowable,
for example lot 0.12, and the amount of 20, then opens min.lots the maximum possible amount, until it will collectively 0.12 = = 0.12/20 = 0.006, min.lot 0.01, then open at 0.01 lots 12 positions.
If we type in 2.87 lot and number of 25, then 2.87/25=0.1148, rounding down, then open 25 units of 0.11 lot
Thank you!
The hard drugs have gone in.
Vitaly, shall we write the script?The hard drugs have gone to work.
Vitaly, shall we write the script?Yes, of course write, if you don't mind!
Yes, of course write it down, if it's not too much trouble!
If we enter lot 2.87 and quantity 25, then 2.87/25=0.1148, rounded down, then open 25pcs at 0.11 lot
I will do it tomorrow.
If you enter lot 2.87 and quantity 25, then 2.87/25=0.1148, rounded down, then open 25pcs at 0.11 lot
I'll do it tomorrow.
Great, thanks, I'll be waiting!
P.S. If you put in 2.49 lot and number 9 ->>> 2.49/9=0.277 we get 9 positions with 0.27 lotExpert Advisor. x=, y=, z=. if x-y>=z then buy, stoploss, trailing stop. if y-x>=z then sell, stoploss, trailing stop. otherwise x=y. loop it. That's it.
can anyone help? it would be appreciated.
Expert Advisor. x=, y=, z=. if x-y>=z then buy, stoploss, trailing stop. if y-x>=z then sell, stoploss, trailing stop. otherwise x=y. loop it. That's it.
can anyone help? would appreciate it.
x y z who can help))