Errors, bugs, questions - page 1631

 
fxsaber:
mt5, 1375, it happened after the upgrade. vinhp32

Updates on what and on what? Please, if you are pointing out a possible glitch - don't save your ink and state the circumstances in as much detail as possible.

Forum on trading, automated trading systems and strategy testing

Errors, bugs, questions

Karputov Vladimir, 2016.08.07 14:11

  1. What is the build of MetaEditor?
  2. Do you run it from MT4 or MT5?
  3. Did you open files in this MetaEditor before?
  4. What is the situation with the rights to the MetaEditor's file?
  5. Did it happen recently or immediately after the terminal installation?
  6. In what operating system do you start it (Windows, under Wine)?

 

Error in execution

Sequence of operations:

1. Run the Test.ex5 expert, which displays the same type of text on the chart line by line until an error occurs

2. On the same chart run the simplified script demonstrating the error

//Test.ex5 //Проверочный скрипт void OnStart() {         string text1 = NULL;                        ::ChartGetString( 0, CHART_COMMENT, text1 ); //(1)         string text2 = ::ChartGetString( 0, CHART_COMMENT ); //(2)         if ( text1 != text2 )                 Print( ::StringLen( text1 ), "-", ::StringLen( text2 ));         else                 Print( "OK" ); }

We get the result

2016.08.08 02:21:25.979 Test (EURUSD,M15) 120-136

... and should be "OK"

Files:
Test.ex5  13 kb
 
A100:

Error in execution

Sequence of operations:

1. Run the Test.ex5 expert, which displays the same type of text on the chart line by line until an error occurs

2. On the same chart run the simplified script demonstrating the error

We get the result

2016.08.08 02:21:25.979 Test (EURUSD,M15) 120-136

... and should be "OK"

I don't see an error, between ChartGetString calls, the chart comment has been changed, that's why there is a 16 character difference between the lines, just the size of the line added to the chart comment.
 
Ilyas:
I don't see any error, between ChartGetString calls, the chart comment has been changed, that's why there is a 16 character difference between the lines, just for the size of the line added to the chart comment.

Expert is unloaded (i.e. can no longer affect the graph). Load the test script (10 lines). Question: which of given lines changes chart comment?

There is no code between calls of ::ChartGetString()

Files:
Test.ex5  6 kb
 

What's wrong with the mobile version of the forum?

When I press "Reply", a quote appears with crocodiles of htlm code. And you can't get the cursor out of it.

Android 2.3.4


 
A100:

Expert is unloaded (i.e. can no longer affect the graph). Load the test script (10 lines). Question: which of given lines changes chart comment?

There is no code between calls of ::ChartGetString()

By action (for chart operations are synchronous/sequential, EA and script work in their own threads):

  1. the script calls the first ChartGetString
  2. the Expert Advisor calls ChartSetString
  3. the Expert Advisor terminates
  4. the script calls the second ChartGetString
 
Ilyas:
By actions (for a chart, operations are synchronous/sequential, Expert Advisor and script work in their threads):

  1. script calls first ChartGetString
  2. expert calls ChartSetString
  3. Expert finishes
  4. the script calls the second ChartGetString

The Test.ex5 expert cannot call anything (point 2), since by the time the script runs, it has already been unloaded beforehand,

i.e. step 3 is obviously before step 1

Below is the result of the Test.ex5 script

2016.08.08 02:21:25.979 Test (EURUSD,M15) 120-136

...and should be "OK".

 
A100:

The Test.ex5 expert cannot call anything (point 2), because by the time the script runs, it is already unloaded beforehand,

i.e. step 3 is obviously before step 1

Below is the result of the Test.ex5 script

2016.08.08 02:21:25.979 Test (EURUSD,M15) 120-136

...and should be "OK".

ExpertRemove does not remove the Expert Advisor from the chart instantly, but only upon completion of OnTick. And it is not analogous to the exit() function

The quote in the log illustrates only the fact of calling the ExpertRemove() function. The fact of removing the Expert Advisor will be reflected in the client terminal log as "expert removed".

Show source code of the Expert Advisor

 
Slawa:

The quote in the log illustrates only the fact of calling the ExpertRemove() function. The Expert Advisor will be removed from the client terminal log as "expert removed".

Detailed sequence of actions:

  1. Open a new chart
  2. Run Test.ex5 on the chart of the Expert Advisor (in a few seconds the following message will appear in the Experts tab: '2016.08.08 15:40:47.267 Test (EURUSD,M15) ExpertRemove() function called' and the EA is unloaded from the chart
  3. Make sure the Log tab displays a message of the following form: '2016.08.08 15:40:47.286 Experts expert Test (EURUSD,M15) removed'
  4. Run script Script1.ex5 on the same chart (the name of the script here does not correspond with the name of the Expert Advisor)

As a result, a message of the following form will appear in the Experts tab: '2016.08.08.08 15:52:43.173 Scripts1 (EURUSD,M15) 120-136'
It should be:'2016.08.08 15:52:43.173 Scripts1 (EURUSD,M15) OK'

//Script1.mq5
void OnStart()
{
        string text1 = NULL;
                       ChartGetString( 0, CHART_COMMENT, text1 ); //(*)
        string text2 = ChartGetString( 0, CHART_COMMENT );
        if ( text1 != text2 )
                Print( StringLen( text1 ), "-", StringLen( text2 ));
        else
                Print( "OK" );
}
Files:
Test.ex5  13 kb
Script1.ex5  7 kb
 
A100:

It should be:'2016.08.08 15:52:43.173 Scripts1 (EURUSD,M15) OK'

This can be easily seen by replacing the line (*) in Script1.mq5 with

               text1 = ChartGetString( 0, CHART_COMMENT );
Reason: