Errors, bugs, questions - page 283

 

Can I change the MAGIC of an open position (=magic1) on a rollover

(to magic2) i.e. I put magic1 when open and magic2 when reversed

magic2, put in Print (after the flip) but magic2=0.

i used magic1=97 magic2=198

But for 2 counters to work magic2=198 instead of 0.

How can I do it?

Thanks.

 

if anyone can help with this, here's the code

   HistorySelect(0,TimeCurrent());
   uint total=HistoryDealsTotal();
   for(uint i=HistoryDealsTotal()-1;i<total;i++)
          {
                  ulong ticket=HistoryDealGetTicket(i);
                  long type  =HistoryDealGetInteger(ticket,DEAL_TYPE);
                  double profit=HistoryDealGetDouble(ticket,DEAL_PROFIT);
                  Print ("profit=",profit,"type",type,"ticket",ticket);
          }        

profit - outputs 0

type - prints 0

ticket - counts correctly

Doesn't the logic break anywhere?

 

It's either a glitch or a bug or something I'm doing wrong...

I am trying to write a multi-currency indicator. I cut everything out for it during analysis. It should just show High Low and MA for the specified symbol. It works fine if the symbol is the same as the chart it has been placed on. But if the instrument is different, it refuses to work.

CopyBuffer and CopyClose return -1. The chart of the instrument, on which the indicator is plotted, is open next to it in the same timeframe. It means that the history should be loaded. But the indicator doesn't work, and the history is not trying to load (as it happens when running the Expert Advisor). I cannot see that the program is loading.

Here is a summary of what I do:

   if (CopyHigh(Symbol1,0,0,to_copy,HighBuffer)<to_copy){f_comment("Ждите..."+Symbol1+" High");return(0);}
   if (CopyLow(Symbol1,0,0,to_copy,LowBuffer)<to_copy){f_comment("Ждите..."+Symbol1+" Low");return(0);}
   if (CopyBuffer(maHandle,0,0,to_copy,maBuffer)<to_copy){f_comment("Ждите..."+Symbol1+" MA");return(0);}

   for(j=to_copy-1;j>=0;j--){
      ExtBuffer1[j]=HighBuffer[j];
      ExtBuffer2[j]=LowBuffer[j];
      ExtBuffer3[j]=maBuffer[j];
   } 


I attach the complete code of indicator that works for my instrument and does not work for another one.

Is it a glitch or crooked hands? Help me to understand.

Построение мультивалютного индикатора с применением множества промежуточных индикаторных буферов
Построение мультивалютного индикатора с применением множества промежуточных индикаторных буферов
  • 2010.05.17
  • Alexey Klenov
  • www.mql5.com
В последнее время возрос интерес к кластерному анализу рынка FOREX. MQL5 открывает новые возможности исследования закономерностей движения валютных пар. Важным преимуществом MQL5, по сравнению с MQL4, является возможность использования неограниченного количества индикаторных буферов. В данной статье описан пример построения мультивалютного индикатора.
Files:
ind.mq5  5 kb
 

alexluek:

type - outputs 0

ticket - counts correctly.

Isn't the logic broken anywhere?

I don't know about the profit, but the type seems to be correct, it's just that there's a trick...

It goes something like this

ENUM_DEAL_TYPE type  = (ENUM_DEAL_TYPE)HistoryDealGetInteger(ticket,DEAL_TYPE);

As for your version - What do you think the value of DEAL_TYPE_BUY would be if we present it as a number?

Correct, DEAL_TYPE_BUY is 0 and DEAL_TYPE_SELL is-1.

Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства сделок
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства сделок
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства сделок - Документация по MQL5
 
ALozovoy:
Specify build number, OS and attach screenshot.

Build: 384

OC: WinXP SP3

... The "Save as picture" menu item is occasionally missing...

 
gisip:

Build: 384

OC: WinXP SP3

... The "Save as picture" menu item occasionally disappears ...

That's right - you have no open charts, so the "File - Save as Picture" command is missing.

You must use "Export to PNG (Picture)" command from context menu to save trading strategy's optimization chart.

 
Serj_Che:

An error appears intermittently when starting the tester:

2011.01.27 18:35:55 Core 1 connect closed

2011.01.27 18:35:54 Tester tester agent failed

2011.01.27 18:35:49 Core 1 connecting to 127.0.0.1:3000

2011.01.27 18:35:49 Core 1 agent process started


It does not show up on next start.

Is it supposed to be like this? And what should I do to not get this error?

It happens. Some random network problem and you're good to go. Actually, we have a situation where the only local agent works. It should not be killed. It should be reinitialized immediately. We'll see. Maybe something is broken.
 
Interesting:

I don't know about the profit, but the type seems to be right, it's just that there's a trick...

It goes something like this

What do you think the value of DEAL_TYPE_BUY would be if it was represented as a number?

Right, DEAL_TYPE_BUY is 0 and DEAL_TYPE_SELL is-1.

thanks - let's do some experiments
 

build 384. it seems i found another bug... When viewing the history, orders - the set Stop Loss and Take Profit levels are not displayed, which is called cAvSEM...

No S/L &amp; T/P levels in history...

 
Voodoo_King:

build 384. it seems i found another bug... When viewing history, orders - the set Stop Loss and Take Profit levels are not displayed, which is called "avsem"...



How are the stops and take-profits set?

Do you first open a position and only then modify it, or do you set the appropriate SL and TP immediately?

Reason: