Errors, bugs, questions - page 1009

 
TheXpert:

Is there a software analogue of the button call ?

ChartRedraw does not work.

Not with MQL5, and I don't know any other way. There is already a request in Service Desk, but nothing yet.
 

OK, I'll ask the question another way, maybe there's a normal answer.

There is an indicator that is calculated on the arrival of a timer event.

If there are no ticks, then even after the indicator data is updated, it is not shown on the chart until the chart is forced to be updated.

Is there a normal way to do an automatic display of new data without ticks?

 
TheXpert:

OK, I'll ask the question another way, maybe there's a normal answer.

There is an indicator that is calculated on the arrival of a timer event.

If there are no ticks, then even after the indicator data is updated, it is not shown on the chart until the chart is forcibly updated.

Is there a normal way to automatically show new data without ticks?

There is a problem when the whole data set is not displayed until a new tick comes. And you can either press the Refresh button or switch the timeframe. I made call OnCalculate() in timer for such cases, but it doesn't help. The data from indicator buffers can be received, but they aren't displayed until a new tick or forced update or timeframe switch.

I consider it a bug.

Is it the same case with you or it is only the latest new data that is not displayed?

 
tol64:

Is it the same for you or is it just the latest new data that isn't showing?

It's probably the same. I'm currently writing the logic for offline and weekend work.

Apparently it is very expensive in terms of resources to give software access to this function. But it would be worth doing an update if the indicator has changed more than (x) values.

 
Does ChartRedraw not help?
 
Renat:
Doesn't ChartRedraw help?
Checked it first thing -- alas.
 
TheXpert:

OK, I'll ask the question another way, maybe there's a normal answer.

There is an indicator that is calculated on the arrival of a timer event.

If there are no ticks, then even after the indicator data is updated, it is not shown on the chart until the chart is forcibly updated.

Is there a normal way to do an automatic display of new data without ticks?

The tried and tested ancient way is to switch the timeframe, for lack of a better one.

By clicking the button is done here: https://www.mql5.com/ru/code/224

ChartReinit
ChartReinit
  • votes: 7
  • 2010.11.29
  • Vladimir Gomonov
  • www.mql5.com
Кнопочная переинициализация чарта с перерасчетом всех индикаторов, а также простенький и прозрачный объектно-ориентированный пример обработки всех чартов из одного эксперта.
 

build 821

when using the standard library(CTrade class) when opening a buy market position, it can be selected to change the stop or profit after 2.5 seconds (no less)

PositionSelect(_Symbol)

returns false

there is no such situation with a sell position


//+------------------------------------------------------------------+
//|                                                test_open_buy.mq5 |
//|                                                         olyakish |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "olyakish"
#property link      "http://www.mql5.com"
#property version   "1.00"
#include <Trade\Trade.mqh> 
CTrade trade;
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {

   double Ask=SymbolInfoDouble(_Symbol,SYMBOL_ASK); // лучшее предложение на покупку

   bool res=trade.PositionOpen(_Symbol,// инструмент
                               ORDER_TYPE_BUY,// 
                               0.1,// количество лотов для торговли
                               Ask,// последняя цена bid
                               0.0,// Stop Loss
                               0.0,// Take Profit 
                               " ");
// без комментариев  
   Print("res=",res);
   Print(PositionSelect(_Symbol));
   Sleep(2500);
   Print(PositionSelect(_Symbol));

  }
//+------------------------------------------------------------------+
2013.07.01 14:49:57     test_open_buy (EURUSD,M1)       res=true
2013.07.01 14:49:57     test_open_buy (EURUSD,M1)       false
2013.07.01 14:49:59     test_open_buy (EURUSD,M1)       true
Документация по MQL5: Стандартная библиотека / Торговые классы / CTrade
Документация по MQL5: Стандартная библиотека / Торговые классы / CTrade
  • www.mql5.com
Стандартная библиотека / Торговые классы / CTrade - Документация по MQL5
 
void GetHistoryProperties()
  {
// Узнаем, есть ли позиция
 
   HistorySelect(t1,t0);
   ulong    ticket=0;
   uint     total=HistoryDealsTotal();
   
   for(uint i=0;i<total;i++){
  if((ticket=HistoryDealGetTicket(i))>0){
  bool ss=HistoryOrderGetString(ticket,ORDER_SYMBOL,symbol1);//не работает
  Print(symbol1," ---",Symbol()," ",ss," ",ticket);
    //пустое значение symbol1
  //или так
  symbol1=myhistory.Symbol();
  Print(symbol1," ---",Symbol()," ", ticket);
  //пустое значение symbol1
 if (Symbol()==symbol1)   {  //Без этого условия всё работает




     }}}

//---
   SetInfoPanel(); // Установим/обновим информационную панель
  }  
Can't get order symbol on history bug or error?
 
zfs:
Can't get the order symbol on the order history a bug or an error?

I thought the answer to this question was yes. You select the ticket from the trade history, and you try to get the property from the order history. They are different lists.

P.S. There isalso an article with examples: MQL5 Recipes - Trade History and Library of Functions for Getting Position Properties