Любые вопросы новичков по MQL4 и MQL5, помощь и обсуждение по алгоритмам и кодам - страница 1614
Вы упускаете торговые возможности:
- Бесплатные приложения для трейдинга
- 8 000+ сигналов для копирования
- Экономические новости для анализа финансовых рынков
Регистрация
Вход
Вы принимаете политику сайта и условия использования
Если у вас нет учетной записи, зарегистрируйтесь
вызывает вопрос только эта строка
-50 лишние и массивЭто чтобы рисовало выше/ниже "0"
но можно и без этого, мне сама суть нужна, как пользоваться хендлами.
Настоятельно рекомендую:
Иначе упс получится)))
Плюсую, сразу до целого привести правильно после деления. Иначе двоичное счисление может много чего наделать)))
Это чтобы рисовало выше/ниже "0"
но можно и без этого, мне сама суть нужна, как пользоваться хендлами.
хендл это указатель на файл индикатора, создается в OnInit() обычно
дальше по коду
хендл это указатель на файл индикатора, создается в OnInit() обычно
дальше по коду
Спасибо, но это похоже на справку и к сожалению мне не понятно(
я поэтому и попросил перевести мой код в mql5 чтобы самому разобрать логику работы
я пока делаю так
но ощущение, что что-то не так, а iMAOnArray вообще не нашел в справке.
добрый день.
не могу решить проблему с зацикливанием мартина,
отключается после исполнения :(n>=OrdersClose)- и далее мартин не включается пока не произойдет прибыльная сделка,
а мне нужно, чтобы после исполнения : (n>=OrdersClose) происходил - return(dLots)и мартин запускался снова если следующая сделка снова убыточная.
подскажите пожалуйста как организовать?
Всем доброго времени суток!!!
Подскажите пожалуйста в коде сеточного советника прописал отображение средней цены на графике. Всё бы ничего но не корректно удаляется линия после закрытия сетки то есть средой цены нет. пожалуйста подскажите что я сделал не так. Вот код и картинка.
//+----------------------------------------------------------------------------+
//| Модификация групповых ордеров |
//+----------------------------------------------------------------------------+
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) && (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("Ордера успешно модифицированы!");
else Print("Ошибка модификации ордеров!");
}
}
}
}
Всем доброго времени суток!!!
Подскажите пожалуйста в коде сеточного советника прописал отображение средней цены на графике. Всё бы ничего но не корректно удаляется линия после закрытия сетки то есть средой цены нет. пожалуйста подскажите что я сделал не так. Вот код и картинка.
Попробуй так
А лучше прописать,
если нет открытых ордеров селл, то удалить линию селл...
аналогично для бая
Добрый вечер, как сбрасывать состояние графической кнопки при клике, чтобы она не была потом нажатой всё время пока ещё раз не кликнешь?