Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 466
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
That's a nice touch. Removed from the code.
Stop is now twitching at every tick )))))
Add it.
Good evening again. Full gist of the question.
I am putting an EA (working) in the Market. MT4 platform. I can display a single file. A file of the Expert Advisor. It should pass the validity, but it cannot because it is an EA without indicators. They are in separate files. The Expert Advisor works with four indicators. They have to be somehow attached to the Expert Advisor. You have to specify the path, i.e., write them in the Expert Advisor. What? and Where? Please advise which form and how to do this.
From what I understand, we have to use the "Resources" . I do not know how to register it correctly in the Expert Advisor. Maybe you know some other solutions.
Thank you .
Here's what it says when validity fails
Good evening again. Full gist of the question.
I am putting an EA (working) in the Market. MT4 platform. I can display a single file. A file of the Expert Advisor. It should pass the validity, but it cannot because it is an EA without indicators. They are in separate files. The Expert Advisor works with four indicators. They have to be somehow attached to the Expert Advisor. You have to specify the path, i.e., write them in the Expert Advisor. What? and Where? Please advise which form and how to do this.
From what I understand, we have to use the "Resources" . I do not know how to register it correctly in the Expert Advisor. Maybe you know some other solutions.
Thank you .
Here is what it says if validity is not passed
I think it's sad that you have written an EA and cannot add indicators to it.
It's sad that you wrote an EA and can't add indicators to it to make it work.
Greetings.
A new tick should assign the value of input parameterSlippage to the variableSlippage1,outputthe value ofSlippage1 in a comment and show"Parameters changed"in the log.
What it does not work with: WhenSlippage1!=Slippage, the"Parameters changed" option is not printed in the log.
Question: What am I doing wrong?
Greetings.
A new tick should assign the value of input parameterSlippage to the variableSlippage1,outputthe value ofSlippage1 in a comment and show"Parameters changed"in the log.
What it does not work with: WhenSlippage1!=Slippage, the"Parameters changed" option is not printed in the log.
Question: What am I doing wrong?
If an input parameter is changed, then the Slippage1 variable is assigned the value of Slippag in OnInit.Accordingly, they cannot be unequal.
If the input parameter is changed, the Slippage1 variable is set to Slippag in OnInit.Accordingly, they cannot be unequal.
Yes, thank you. I just got it.
Hello, please help me with the error that occurs in the tester when I try to modify an order (transfer to Breakeven): I put the OrderOpenPrice() function instead of SL, but the tester shows error1 (according to the documentation it means that there is an attempt to passunchanged values as parameters to the function). I attach the code! Thank you in advance!
void DeleteOrderFunction2() //function that deletes the second pending order and saves the second order to Breakeven on a certain evening
{
bool flag = false;
if (FlagDeleteSecondOrder2 == true)
{
if(DayOfWeek() == DAYOFWEEK && //if a weekday is selected
Hour() == 22 //if evening
)
{
if(BuyCount() == 1 && if(there is an open Buy order
SellStopCount() == 1 //and there is a sell pending order
)
{
for( int i = 0; i < OrdersTotal(); i++) //create orders
{
OrderSelectX(i, SELECT_BY_POS, MODE_TRADES;)
switch(OrderType())
{
case OP_BUY: if(OrderProfit() > 0 &&
Bid > OrderOpenPrice()
)
{
OrderModifyX(OrderTicket(),OrderOpenPrice(),OrderTakeProfit(),0,Arrow_Color);
flag =true;
}
break;
case OP_SELLSTOP: if(flag==true)
{
OrderDeleteX(OrderTicket(), Arrow_Color);
}
break;
}
}
}
if(SellCount() == 1 && // if there is an open Sell order
BuyStopCount() == 1 //and there is a Buy pending order
)
{ Print("IS!!!!");
for( int i = 0; i < OrdersTotal(); i++) //create orders
{
OrderSelectX(i, SELECT_BY_POS, MODE_TRADES;)
switch(OrderType())
{
case OP_SELL: if (OrderProfit() > 0 &&
Ask < OrderOpenPrice()
)
{
OrderModifyX(OrderTicket(), OrderOpenPrice(),OrderTakeProfit(),0, Arrow_Color);
flag = true;Print("flag =", flag);
}
break;
case OP_BUYSTOP: if(flag == true)
{
Print("flag =", flag);
OrderDeleteX(OrderTicket(), Arrow_Color);
}
break;
}
}
}
}
}
}