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 order and sets 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
assume that OP_BUY is first encountered among the orders, you modify it and set flag =true and when it is encountered the pending order will be deleted. And see what happens if the pending order is first encountered...
The question is what will "load more": at each defined InChartEvent redefine indicator handle or define all possible handles as an array beforehand in OnInit?
Roman Sharanov: The question is what will "load more": at each defined InChartEvent redefine the indicator handle or define all possible handles as an array beforehand in OnInit?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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 order and sets 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;
}
}
}
}
}
}
Help me convert the indicator into a script!
If iHigh(NULL,PERIOD_H1,[i+2]) and iLow(NULL,PERIOD_H1,[i+2]) are written instead ofHigh [i+2] andLow[i+1], then you can control the timeframe?
If Hai matched SELL, if Loh BUY!
Help me convert the indicator into a script!
If iHigh(NULL,PERIOD_H1,[i+2]) and iLow(NULL,PERIOD_H1,[i+2]) are written instead ofHigh [i+2] andLow[i+1], then you can control the timeframe?
If Hai matched SELL, if Loh BUY!
three coincidences will have to wait a long time
three hits will have to wait a long time.
I'm not a scalper, I'll wait. We can normalise on the 4 digits.
in mql5 we have open positions, I find all trades in this position and determine whether they were opened by market or pending orders
in mql4, how can i find out if an open position was opened by market or pending orders and its tickers change when a pending order triggers?
Yes and the result is weak ...
in mql5 we have open positions, I find all trades in this position and determine whether they were opened by market or pending orders
in mql4, how can i find out if the open orders were opened by market or pending orders and their tickers change when a pending order triggers?
give them different magiks
give them different magiks
Orders are opened by a user, I need to define their type when they are opened
The question is what will "load more": at each defined InChartEvent redefine the indicator handle or define all possible handles as an array beforehand in OnInit?