Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 711
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
Quicker to figure out and understand
write down the prices, how to take them afterwards, when what?
to insert in this loop instead of rHello, I have made a function which should increase the stop loss after the last order has closed in minus.
Increases it by the set step, until it reaches the maximum. As a result, it always sets the original value of stop loss.
What is wrong? Thank you!
//+------------------------------------------------------------------+
double SL()
{
double sL;
if(OrdersHistoryTotal()==0)
{
sL=StopLoss;
}
if(OrderSelect(OrdersHistoryTotal()-1,SELECT_BY_POS,MODE_HISTORY))
{
if(OrderProfit()>=0)
{
sL=StopLoss;
}
if(OrderProfit()<0 && OrderType()==OP_BUY)
{
sL=OrderOpenPrice()-OrderStopLoss()+SLStep;
}
if(OrderProfit()<0 && OrderType()==OP_SELL)
{
sL=OrderStopLoss()-OrderOpenPrice()+SLStep;
}
}
if(sL>maxStep)
{
sL=StopLoss;
}
return(sL);
}
//+------------------------------------------------------------------+
What am I writing it wrong?
It should go like this http://prntscr.com/lu1kb9
Tried to insert the data under the current template
But it's still not the same. help meGood afternoon.
I am mastering emq-el by Sergei Kovalev's tutorial.
I downloaded the Expert Advisor from there, compiled it, it even seems to work, but when compiling it displays some comments, not errors, but warnings.
What should I change to make it compile without any errors? Thank you in advance.
Where can I find the error codes? Where is this documentation?
In the menu of this website - look up
In the menu of this site - look up
Artem, there is documentation on mql5, and the questions are in the mql4 section
Sergey Branin:
Where can I find the error codes? Where is this documentation?
Here is mql4 documentation. You may also press F1 in MetaEditor
Artyom, is the mql5 documentation there? and the questions are in the mql4 section
There is a documentation on mql4. And it is better to press F1 while in the MetaEditor
Ahh... Well all the same - it's not so complicated either - it's faster to put your finger on F1 and find everything you need than to wait 24 hours for an answer on the forum. I don't understand ...
I do not know how to do it, may any programmer write a simple code block for an example. c/o Denis