Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 40 1...333435363738394041424344454647...1965 New comment Vitalie Postolache 2016.12.20 00:34 #391 trader781: CorrectingThere is no other way to put it anywhere else, it will be wrong parametersIt should take into account the most recent one.I'll try to change it.I tried to use standard OrderModify() but it gets banned if I move a lot of orders simultaneously and constantlyThanks for the critique.Declare it WITHOUT ARGUMENT, is it really that hard?int Counts(){код функции}And call an empty one too, and put the elza from there behind curly brackets:if(Counts()==0){че там нужно когда нет ордеров}else {когда есть ордера}And now you have this:if(Counts()==0){че там нужно когда else {когда есть ордера} нет ордеров} else and else if? Questions from Beginners MQL5 R-Portfolio - a diversification [Deleted] 2016.12.20 06:25 #392 Alekseu Fedotov: Try it ^_~ It's not working ...There's still no deal. Alekseu Fedotov 2016.12.20 08:16 #393 Movlat Baghiyev: It's not working... No trades, no trades...Does it at least put out the pending orders, no, what are the errors?...I fixed it. Files: 0.mq4 8 kb Mickey Moose 2016.12.20 10:35 #394 Finished the arguments. the terminal hangs tight. Files: count.mq4 19 kb Vitalie Postolache 2016.12.20 18:11 #395 trader781: Finished arguments. terminal hangs tight.So some sort of loop is flailing around endlessly.Write #property strict at the beginning of the code and fix it, lots of warnings.It is quite possible division by 0 in the last function.After else only the first line will be executed, the braces block is left orphaned.In general, write out the logic on paper with words first, otherwise it's wobbly. Any rookie question, so Running more than one Tool to save data Mickey Moose 2016.12.20 18:53 #396 Vitalie Postolache: It is supposed to execute a command with a floating decimal point depending on decimals on the chartNormalizeDouble(Ask+TakeProfit*Point(),Digits)and how did you see that some lines were not executed? Vitalie Postolache 2016.12.21 00:13 #397 trader781: It is supposed to execute a command with a floating decimal point depending on decimals on the chartNormalizeDouble(Ask+TakeProfit*Point(),Digits)How do you know that some lines are not executed?Yep. I have big problems with logic. And what would be left of the result if it is written into an integer variable? What's the point of this code?int lastlot,tp; lastlot=NormalizeDouble(lastlot*Martin,3); tp=NormalizeDouble(avg_price+TakeProfit*Point(),Digits); Here, is it so hard to understand that part of the code is orphan and will be executed regardless of the condition?else//+-------------если ордера уже есть otype=FindLastOType(); //код, исполняющийся для else{ код-сирота} [ARCHIVE!] Any rookie question, Ea order correct tp Any rookie question, so Mickey Moose 2016.12.21 00:38 #398 Vitalie Postolache: Yeah, that's a big problem with logic. And what's left of the result if it's written to an integer variable? What is the point of this code?int lastlot,tp; lastlot=NormalizeDouble(lastlot*Martin,3); tp=NormalizeDouble(avg_price+TakeProfit*Point(),Digits); Is it so hard to understand that part of the code is an orphan and won't be executed?else//+-------------если ордера уже есть otype=FindLastOType(); //код, исполняющийся для else{ код, который никуда не идёт, сирота}Stopif there are orders The order type is{then operations are executed for that order type}not? Can't figure out where zero divide comes from Vitaly Muzichenko 2016.12.21 00:52 #399 trader781: Stopif there are ordersis the order type{then operations are carried out for this order type}no?Yes, you're right, it's just that the code is written in such a style that the previous speaker misinterpreted it.Added:zero div ide is a division by zero, and it tells you in the log what line Multi Timeframe Indicators Bitcoin and everything associated [ARCHIVE] Any rookie question, Vitalie Postolache 2016.12.21 01:36 #400 trader781: Stopif there are ordersis the order type{then operations are carried out for this order type}no?Corrected above. What comes after else is executed depending on the condition. Block of curly brackets is separate, so it has nothing to do with else.I can't figure out where zero divide comes from.That's wherevoid ModifyOrders() //+------------модификация ввод тип { double avg_price; //+------------средняя цена price=0;//+------------цена bool z;//+------------выход в переменную double orderlots=0; //+------------лоты avg_price=NormalizeDouble(price/orderlots,Digits);//+------------то средняя ценаравна цена деленная на лот@Vitaly Muzichenko Where is "misinterpreted" here? Use your brain. Any rookie question, so Calculating Take Profit to Where can I buy 1...333435363738394041424344454647...1965 New comment
Correcting
There is no other way to put it anywhere else, it will be wrong parameters
It should take into account the most recent one.
I'll try to change it.
I tried to use standard OrderModify() but it gets banned if I move a lot of orders simultaneously and constantly
Thanks for the critique.
Declare it WITHOUT ARGUMENT, is it really that hard?
{код функции}
And call an empty one too, and put the elza from there behind curly brackets:
else {когда есть ордера}
And now you have this:
Try it ^_~
It's not working... No trades, no trades...
Does it at least put out the pending orders, no, what are the errors?
...I fixed it.
Finished arguments. terminal hangs tight.
So some sort of loop is flailing around endlessly.
Write #property strict at the beginning of the code and fix it, lots of warnings.
It is quite possible division by 0 in the last function.
After else only the first line will be executed, the braces block is left orphaned.
In general, write out the logic on paper with words first, otherwise it's wobbly.
It is supposed to execute a command with a floating decimal point depending on decimals on the chart
NormalizeDouble(Ask+TakeProfit*Point(),Digits)
and how did you see that some lines were not executed?
It is supposed to execute a command with a floating decimal point depending on decimals on the chart
NormalizeDouble(Ask+TakeProfit*Point(),Digits)
How do you know that some lines are not executed?
Yep. I have big problems with logic. And what would be left of the result if it is written into an integer variable? What's the point of this code?
lastlot=NormalizeDouble(lastlot*Martin,3);
tp=NormalizeDouble(avg_price+TakeProfit*Point(),Digits);
Here, is it so hard to understand that part of the code is orphan and will be executed regardless of the condition?
otype=FindLastOType(); //код, исполняющийся для else
{
код-сирота
}
Yeah, that's a big problem with logic. And what's left of the result if it's written to an integer variable? What is the point of this code?
lastlot=NormalizeDouble(lastlot*Martin,3);
tp=NormalizeDouble(avg_price+TakeProfit*Point(),Digits);
Is it so hard to understand that part of the code is an orphan and won't be executed?
otype=FindLastOType(); //код, исполняющийся для else
{
код, который никуда не идёт, сирота
}
Stop
if there are orders
The order type is
{
then operations are executed for that order type
}
not?
Can't figure out where zero divide comes fromStop
if there are orders
is the order type
{
then operations are carried out for this order type
}
no?
Yes, you're right, it's just that the code is written in such a style that the previous speaker misinterpreted it.
Added:zero div ide is a division by zero, and it tells you in the log what line
Stop
if there are orders
is the order type
{
then operations are carried out for this order type
}
no?
Corrected above. What comes after else is executed depending on the condition. Block of curly brackets is separate, so it has nothing to do with else.
That's where
{
double avg_price; //+------------средняя цена
price=0;//+------------цена
bool z;//+------------выход в переменную
double orderlots=0; //+------------лоты
avg_price=NormalizeDouble(price/orderlots,Digits);//+------------то средняя ценаравна цена деленная на лот