Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1614

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
only this line raises the question
-50 extra and an arrayIt's to draw above/below "0"
But you can do without it, I need the gist of it, how to use handles.
I highly recommend it:
Otherwise you get an oops.))
Plus, get it right down to a whole right after division. Otherwise binary counting can do a lot of things.)
This is to draw above/below "0"
but you can do without it, I need to know how to use handles.
a handle is a pointer to the indicator file, it is usually created in OnInit()
further in the code
a handle is a pointer to the indicator file, it is created in OnInit() usually
further in the code
Thanks, but it looks like the help and unfortunately it is not clear to me(
That's why I asked to translate my code into mql5 in order to understand the logic of work
I do it this way
But i have a feeling something is wrong and iMAOnArray is not mentioned in help.
Good afternoon.
I can't solve the problem with martin looping,
I can't solve the problem with the looping of the martin. it gets disconnected after execution :(n>=OrdersClose)- and then the martin is not triggered until a profitable trade occurs,
I need to havereturn(dLots) after (n>=OrdersClose) and Martin will start again if the next trade is again losing.
Could you please advise how to do this?
Good day to all!!!
Please advise me in the grid advisor code prescribed the display of the average price on the chart. It would be OK, but not correctly deleted the line after closing the grid, that is, the average price is not. Please tell me what I did wrong. Here is the code and picture.
//+----------------------------------------------------------------------------+
//| Modify group orders |
//+----------------------------------------------------------------------------+
void ModifyOrders(int otype)
{
double avg_price, AveragePriceBuy, AveragePriceSell, order_lots = 0;
price = 0;
for(int i = OrdersTotal()-1; i>=0; i--)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if(OrderSymbol() == Symbol() && OrderMagicNumber() == Magic && OrderType() == otype)
{
price += OrderOpenPrice() * OrderLots();
order_lots += OrderLots() ;
}
}
}
avg_price = NormalizeDouble(price / order_lots, Digits);
AveragePriceBuy = NormalizeDouble(avg_price + Spread, Digits);
AveragePriceSell = NormalizeDouble(avg_price - Spread, Digits);
{
ObjectDelete(0, "AveragePriceLine");
ObjectCreate("AveragePriceLine" ,OBJ_HLINE, 0, 0 ,AveragePriceBuy);
ObjectCreate("AveragePriceLine" ,OBJ_HLINE, 0, 0 ,AveragePriceSell);
ObjectSet("AveragePriceLine",OBJPROP_COLOR,Blue);
}
if ((otype == OP_BUY) && (Drawdown <= DrawdownClosingTakeprofitZero))
tp = NormalizeDouble (AveragePriceBuy + TakeProfitGroupOrder*Point, Digits);
if ((otype == OP_SELL) && (Drawdown <= DrawdownClosingTakeprofitZero))
tp = NormalizeDouble (AveragePriceSell - TakeProfitGroupOrder*Point, Digits);
if ((otype == OP_BUY) && (Drawdown > DrawdownClosingTakeprofitZero))
tp = NormalizeDouble (AveragePriceBuy, Digits);
if ((otype == OP_SELL) &/or& (Drawdown > DrawdownClosingTakeprofitZero))
tp = NormalizeDouble (AveragePriceSell, Digits);
for(int i = OrdersTotal()-1; i>=0; i--)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if(OrderSymbol() == Symbol() && OrderMagicNumber() == Magic && OrderType() == otype)
{
if(OrderModify(OrderTicket(), OrderOpenPrice(), 0, tp, 0))
Print("Orders successfully modified!");
else Print("Error modifying orders!");
}
}
}
}
Good day to all!!!
Please advise me in the grid advisor code prescribed the display of the average price on the chart. It would be OK, but not correctly deleted the line after closing the grid, that is, the average price is not. Please tell me what I did wrong. Here is the code and picture.
Try it like this
Or better prescribe,
if there are no open Sell orders, delete the Sell line
the same for the bai
Good evening, how do you reset the status of a graphic button when you click, so that it is not pressed all the time until you click it again?