Questions from Beginners MQL5 MT5 MetaTrader 5 - page 402
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
Then open a separate topic for questions about your code. Maybe with hints, you'll be able to master your code.
Complicated code for me, and freelancers have a big appetite - a message like "we'll write from scratch for lots of money"...
It's fine ... the code is complicated and making it even more complicated is easier, isn't it?
You may also want to read a textbook, documentation... The road is travelled. Well... or go freelancing in the jaws of some greedy, ugly freelancers ;)
if (OrdersTotal() == 0 && RSl <= 70 )
why the condition is not met what did I write wrong?
if (OrdersTotal() == 0 && RSl <= 70 )
why the condition is not satisfied, what have I written incorrectly?
Use code styler - errors will be visible.
Use the Code Styler - errors will be visible.
The styler didn't help, the processing condition there was .
There were 25 warnings and 5 errors and still there are. yep)))
I searched the internet and couldn't find a fix. Help.
I recalculated the equal number of brackets in all functions
I searched the internet and couldn't find a fix. Help.
I counted the equal number of brackets in all the functions.
Not good with English?
First:
Compile it, and then you will see, since you don't want to show the code in full.
Not good with English?
First of all:
Next: Somewhere in your code, Ask is set as a variable, which you can't do at all. Name it otherwise, because Ask is a predefined variable. And then you'll see, since you don't want to show the code in full.
Oops . Asc as a variable was not. added brackets and such errors went away. 5 , and 6 warnings left . let's sort it out)))
That's why I tweaked my original post. Because the lack of brackets is exactly what could have caused such errors - morning, half past six, sleepless night ...
It's normal for me not to sleep for 24 hours.
Help
There's a drop left. the legs are growing from this "Modifi order" function I think
//----------------------------------
void ModifyOrders()
{
double avg= 0;
int count = 0;
for(int i=OrdersTotal()-1; i>=0; i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
{
if(OrderType()==OP_BUY || OP_SELL)
{
avg+=OrderOpenPrice();
count++;
}
}
}
}
avg=NormalizeDouble(avg/count,Digits);
for(int i=OrdersTotal()-1; i>=0; i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
{
if(OrderType()==OP_BUY)
{
TP=NormalizeDouble(avg+TakeProfit*Point,Digits);
OrderModify(OrderTicket(),OrderOpenPrice(),0,TP,0);
}
else
if(OrderType()==OP_SELL)
{
TP=NormalizeDouble(avg-TakeProfit*Point,Digits);
OrderModify(OrderTicket(),OrderOpenPrice(),0,TP,0);
}
}
}
}
}
//+------------------------------------------------------------------+