[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 405

 
Max2000 >>:

Здравствуйте,

Как сделать чтобы советник не закрывал сделку раньше 3 мин.??

Может кто подскажет, что и где прописать?

if ((TimeCurrent()-OrderOpenTime())<3*60)
return; //or something similar, depends on existing code.

 
splxgf >>:

if ((TimeCurrent()-OrderOpenTime())<3*60)
return; //или что-то в этом роде, зависит от существующего кода.

if the closing condition is later than 3 minutes after order opening, then the order will not close before that (of course, if it is not a pending order, but even that one is deleted by itself no earlier than 10 minutes)

 
Noterday >>:

double Lots;
double m = 0.1;


for (m = 0.1; AccountFreeMarginCheck(Symbol(),OP_SELL,m)>150; m = m + 0.1)
{
Lots = m;
}

Почему у меня Lots всегда оказывается равен нулю?

So, can anyone tell me what's wrong with the code?

 
What do you mean, show me?)
 
Noterday >>:
Всмысле покажи?)

dumbfounded ))

 
Noterday >>:

Ну что, подскажет кто-нибудь что не так в коде?

AccountFreeMarginCheck(Symbol(),OP_SELL,m)>150 this expression is initially false

 
Shit.... exactly...I'll be thinking! Thank you!
 
Comment(AccountFreeMarginCheck(Symbol(),OP_SELL, m));


вот эту строчку поставь перед циклом и посмотри что выводит на экран
 

Outputs -1000000000000

I.e. with a deposit >10K, after opening an order with a volume of 0.1 there will be (based on this function) -1000000000000 :)))


In general, it does not work...

 
Noterday >>:

Выводит -10000000000

Т.е. при депо >10K, после открытия ордера объемом 0.1 останется (исходя из этой функции) -1000000000000 :)))


Вобщем не получается...

https://forum.mql4.com/ru/14675

Reason: