Errors, bugs, questions - page 2818

 
Stanislav Korotky:

By the way, I remembered that you are a fan of Renko.
Judging by your question, you have already come close to realizing that your previous statement about the impossibility of applying indicators and overlaying EAs on the reno formed on the canvas is wrong.
Hurrah!

 
Nikolai Semko:

Yes, I can.

A test script is attached.

The result of the script:

This will only work for interface indicators (manually imposed by user), but will not work for those created from EAs. The task at most is to enable virtual auto-optimization by including one inlude in the source code of the EA. Now this is only possible with a tambourine dance (additional editing of the source code or some default settings (only the current _Symbol/ Period), which will not always work).

And, in principle, it's not clear why the IndicatorParameters function doesn't return the two most important meta-parameters.

As for indicators and Expert Advisors on canvas, everything can be done technically, but the question is why should we bother with it? The purpose of a canvas is different. For custom quotes, there is a ready-made solution where indicators and experts are integrated in a standard way.

 

advise - how are the profits in widgets and signals calculated correctly...

last week - or rather in the first 5 days of trading I made 1000%, then the next day


i made another 1000% - it was all right in the signals and widgets

so... then came the second week of trading - and then bam... and it's only +39%

OK - I think I'll trade a bit more... and I'll call it a day - I finished 0 and bam... it's not +39% but 98%... on the upside, I got +4000%...



so how much percentage do i have??? 39 or 98 or should I believe my eyes - it's all 4000%

 
Stanislav Korotky:

This will only work for interface indicators (manually imposed by the user), but will not work for those created from the Expert Advisors. The task at most is to enable the virtual auto-optimization by including an include in the source code of the Expert Advisor. Now this is only possible with a tambourine dance (additional editing of the source code or some default settings (only the current _Symbol/ Period), which will not always work).

And, in principle, it's not clear why the IndicatorParameters function doesn't return the two most important meta-parameters.

As for indicators and Expert Advisors on canvas, everything can be done technically, but the question is why should we bother with it? The purpose of a canvas is different. For custom quotes, there is a ready-made solution where indicators and experts are integrated in a standard way.

Yes, if the indicator was created using the functions IndicatorCreate, iCustom, iMA, iMACD, i... and is unsupervised, i.e. it is not attached to any chart using ChartIndicatorAdd, then you really cannot know the TF and symbol of this indicator, if this indicator was not created by you. If you did, then you must know the symbol and the TF at the time you created the indicator and got the handle.
If the indicator is not yours, then it's not logical to interfere in someone else's plot, especially when this indicator is not in the charts and it is a service.
But if the indicator, the symbol and the TF of which should be controlled by its handle, is written by you, but it isn't used by you or is used unsupervised, you can create an additional buffer in it, in which (through the union for example) its current TF and symbol are embedded. Then even at simple handling of handles with your special functionusing the CopyBuffer, you can find out if it is your indicator, and if it is yours, you can read its current symbol and TF.
But I agree with you, if IndicatorParameters had a possibility to read TF and symbol, it would be much easier. Clearly this function lacks it. It is unlikely the lack of it is related to security, because the unknown handle already has full access to the contents of the indicator except TF and symbol.

 
Aleksander:

advise - how are the profits in widgets and signals calculated correctly...

last week - or rather in the first 5 days of trading I made 1000%, then the next day


i made another 1000% - it was all right in the signals and widgets

so... then came the second week of trading - and then bam... and it's only +39%

OK - I think I'll trade a bit more... and I'll call it a day - I finished 0 and bam... it's not +39% but 98%... on the upside, I got +4000%...



so how much percentage do i have??? 39 or 98 or should I believe my eyes - it's all 4000%

The answers to such naive questions are so obvious that one can't help but wonder about self-promotion. Believe me, I would love to be wrong, but .....

 
Sergey Voytsekhovsky:

The answers to such naive questions are so obvious that suspicions of self-promotion involuntarily come to mind. Believe me, I would love to be wrong, but .....

nah - this is really the first time I've used the Signals service... and what do I see? One week the percentages are counted this way and that way... and next week what should I expect in the widget? 0% again?

i get cognitive dissonance - when i see one thing here - and then i see another - and what should i believe then????

how do you calculate percentages in a widget???

Торговые сигналы для MetaTrader 5
Торговые сигналы для MetaTrader 5
  • www.mql5.com
Выберите подходящую торговую систему и оформите на неё подписку в пару кликов. Замониторенные счета сопровождаются подробной статистикой и торговой историей. Посмотрите обучающий видеоролик о том, как подписаться на Сигнал...
 

The function has stopped working after the update

ChartSetInteger(0,CHART_BRING_TO_TOP,0,true)

Doesn't switch to 0 chart, what could be the error?

void OnStart()
  {
   long currChart,prevChart=ChartFirst();
   int z=0,limit=100;
     while(z<limit)
     {
      currChart=ChartNext(prevChart);
      string __simvol=ChartSymbol(currChart);
      ENUM_TIMEFRAMES __period=ChartPeriod(currChart);
      if(currChart==-1)
        {
         __simvol=Symbol();
         currChart=0;
        };
         if(!ChartSetInteger(currChart,CHART_BRING_TO_TOP,0,true))
        {
         //--- выведем сообщение об ошибке в журнал "Эксперты"
         Print(__FUNCTION__+", Error Code = ",GetLastError());
         //return(false);
        };
      Print(currChart, "  ", __simvol);

      Sleep(2000);
      if(currChart==0)
         {break;};
     prevChart=currChart;
      z++;

     };
  }
 

Please help.

How do I know the price of a market order on the left symbol?


Using the example of an EA.

#include <MT4Orders.mqh> // https://www.mql5.com/ru/code/16006

input int inTP = 100; // Размер тейка.

#define  Bid SymbolInfoDouble(_Symbol, SYMBOL_BID)
#define  Ask SymbolInfoDouble(_Symbol, SYMBOL_ASK)

void OnTick()
{
  if (!OrdersTotal()) // Если нет текущих ордеров
  {
    OrderSend(_Symbol, OP_BUY, 0.1, Ask, 0, 0, Ask + inTP * _Point);  // Купили с тейком.
    OrderSend(_Symbol, OP_SELL, 0.1, Bid, 0, 0, Bid - inTP * _Point); // Продали с тейком.
  }
}


Backtest result.

You need to know the prices of the marked zeros. When it comes to SL/TP, you can get them from the comment. But when you make a market order (not the green zeros on the screenshot), where do we get them?


You need it to estimate slippages. For example, in the terminal you see a good price, click buy. The deal is executed. Then we want to understand how much the deal price is different from the one that was in the Terminal when we pressed. It feels like MT5 doesn't allow you to do the simplest analysis!


Or for example you want to investigate the effect of the Tester's lag functionality on the EA's result. To do that you need to estimate what the slippage has become. And it cannot be done. More specifically, I cannot do it.


My question is, how do I know my market order price if it has been set non-zero in MqlTradeRequest?

 
fxsaber:

Question, how do I know the price of a market order if it was set to non-zero in MqlTradeRequest?

replacing the market with a limit with a fixed margin will not help?

 
SEM:

The function has stopped working after the update

it does not switch to 0 chart, what could be the problem?

I have a similar function - changing the pattern on the chart. before the update it worked fine, now it changes but, on one chart it can happen, several windows with a pattern

//+------------------------------------------------------------------+
//| start function                                                   |
//+------------------------------------------------------------------+
void DeleteChart(void)
  {
   long currChart,prevChart=ChartFirst();
   int i=0,limit=100;
   bool errTemplate;
   while(i<limit)
     {
      currChart=ChartNext(prevChart);
      if(TimeFrame!=PERIOD_CURRENT)
        {
         ChartSetSymbolPeriod(prevChart,ChartSymbol(prevChart),TimeFrame);
        }
      errTemplate=ChartApplyTemplate(prevChart,Template+".tpl");
      if(!errTemplate)
        {
         Print("Error ",ChartSymbol(prevChart),"-> ",GetLastError());
        }
      if(currChart<0)
         break;
      Print(i,ChartSymbol(currChart)," ID =",currChart);
      prevChart=currChart;
      i++;
     }
  }
//+------------------------------------------------------------------+
Reason: