Custom symbol data still even after deleting from the list.

 

Well I've just been doing some testing and experienced some very strange behaviour.

I was expecting 1 min OHLC and Open Prices to give very similar results as I had created two custom symbols, both with a spread of 1 point. What I got was two curves that diverged from each other (The red line and green line in the figure below). I spent ages trying to figure out why and debugged through the code, checked the input data. The input data was fine and when I debugged I found that the spread when running the 1min OHLC case was 24....curious!! as I have another custom symbol that I forced the spread to be 24. I deleted the cache but that didn't seem to make a difference. Then I deleted the symbol and recreated it with a different name and ran it and got the blue line below which is very similar to the red and what I was expecting.


Can anyone explain what was happening? I checked the symbol and it displayed the correct data in the viewer but was obviously picking up data from elsewhere or previous? I did create a custom symbol based on another one but I thought that just pulls across the specification and not a link to the data etc?

I will try and replicate it.

It's making me very nervous that it's ease to do analysis with incorrect data.


**further update. I deleted the symbol named "AUDCHF.custom.spread=1" from the symbol list, shut down MT5 then reopened it, created a new symbol with the same name as before and it gave the same (incorrect) results. Still picking up the file with a spread of 24 rather than the spread=1.

If you create a symbol with a completely unique name that hasn't been used before it works correctly. Seems like there's a pointer to an old file somewhere. Any ideas?


Creating and testing custom symbols in MetaTrader 5
Creating and testing custom symbols in MetaTrader 5
  • www.mql5.com
Creating custom symbols pushes the boundaries in the development of trading systems and financial market analysis. Now traders are able to plot charts and test trading strategies on an unlimited number of financial instruments.
 
EdFuk:

Well I've just been doing some testing and experienced some very strange behaviour.

I was expecting 1 min OHLC and Open Prices to give very similar results as I had created two custom symbols, both with a spread of 1 point. What I got was two curves that diverged from each other (The red line and green line in the figure below). I spent ages trying to figure out why and debugged through the code, checked the input data. The input data was fine and when I debugged I found that the spread when running the 1min OHLC case was 24....curious!! as I have another custom symbol that I forced the spread to be 24. I deleted the cache but that didn't seem to make a difference. Then I deleted the symbol and recreated it with a different name and ran it and got the blue line below which is very similar to the red and what I was expecting.


Can anyone explain what was happening? I checked the symbol and it displayed the correct data in the viewer but was obviously picking up data from elsewhere or previous? I did create a custom symbol based on another one but I thought that just pulls across the specification and not a link to the data etc?

I will try and replicate it.

It's making me very nervous that it's ease to do analysis with incorrect data.


**further update. I deleted the symbol named "AUDCHF.custom.spread=1" from the symbol list, shut down MT5 then reopened it, created a new symbol with the same name as before and it gave the same (incorrect) results. Still picking up the file with a spread of 24 rather than the spread=1.

If you create a symbol with a completely unique name that hasn't been used before it works correctly. Seems like there's a pointer to an old file somewhere. Any ideas?


you could include cache deletion in between . 

  • So , delete "old symbol"
  • Shutdown mt5 and ide
  • Delete cache from the backtester
  • Reopen 
  • Create new symbol 
 
Lorentzos Roussos #:

you could include cache deletion in between . 

  • So , delete "old symbol"
  • Shutdown mt5 and ide
  • Delete cache from the backtester
  • Reopen 
  • Create new symbol 
I don’t think the cache is the problem. I will see if deleting the custom symbol data file solves the problem. Seems clunky though. 

And dangerous!
 
EdFuk:

Well I've just been doing some testing and experienced some very strange behaviour.

I was expecting 1 min OHLC and Open Prices to give very similar results as I had created two custom symbols, both with a spread of 1 point. What I got was two curves that diverged from each other (The red line and green line in the figure below). I spent ages trying to figure out why and debugged through the code, checked the input data. The input data was fine and when I debugged I found that the spread when running the 1min OHLC case was 24....curious!! as I have another custom symbol that I forced the spread to be 24. I deleted the cache but that didn't seem to make a difference. Then I deleted the symbol and recreated it with a different name and ran it and got the blue line below which is very similar to the red and what I was expecting.


Can anyone explain what was happening? I checked the symbol and it displayed the correct data in the viewer but was obviously picking up data from elsewhere or previous? I did create a custom symbol based on another one but I thought that just pulls across the specification and not a link to the data etc?

I will try and replicate it.

It's making me very nervous that it's ease to do analysis with incorrect data.


**further update. I deleted the symbol named "AUDCHF.custom.spread=1" from the symbol list, shut down MT5 then reopened it, created a new symbol with the same name as before and it gave the same (incorrect) results. Still picking up the file with a spread of 24 rather than the spread=1.

If you create a symbol with a completely unique name that hasn't been used before it works correctly. Seems like there's a pointer to an old file somewhere. Any ideas?


No one can explain anything unless they know exactly what you're doing.

This is a technical forum, we need technical data and procedure.

 
EdFuk #:
I don’t think the cache is the problem. I will see if deleting the custom symbol data file solves the problem. Seems clunky though. 

And dangerous!

You can also use the Custom symbol commands offered in mql5 , expecially if you suspect something is wrong .

You don't want to be testing the wrong thing that's suicide .

If the tickstory structure is simple (it could be) a script that takes it in , applies your spread and spits out a symbol won't be that hard to do .

 
Alain Verleyen #:

No one can explain anything unless they know exactly what you're doing.

This is a technical forum, we need technical data and procedure.


In summary this is what is happening

1) create custom symbol called “abc” and import 1min bar data using a particular tickstory csv 
2) run EA using symbol
3) delete that custom symbol from MT5. 
4) close MT5 and delete tester cache
5) reopen MT5 and do items 1) and 2) but using a different tickstory data file which has a different spread. I call the custom symbol the same name as I used before “abc”

The results are the same and it is clear that the first data set is being used. 

I’m not at home atm as I said I will try and replicate and link the input data. I thought I’d see if it’s a known issue first, obviously not. 



2) 
 
EdFuk #:

In summary this is what is happening

1) create custom symbol called “abc” and import 1min bar data using a particular tickstory csv 
2) run EA using symbol
3) delete that custom symbol from MT5. 
4) close MT5 and delete tester cache
5) reopen MT5 and do items 1) and 2) but using a different tickstory data file which has a different spread. I call the custom symbol the same name as I used before “abc”

The results are the same and it is clear that the first data set is being used. 

I’m not at home atm as I said I will try and replicate and link the input data. I thought I’d see if it’s a known issue first, obviously not. 

Thanks, clear. Please confirm once you replicated it.

Though I would say the workaround is simple, just don't use the same name for different data, it's looking for trouble.

 
Alain Verleyen #:

Thanks, clear. Please confirm once you replicated it.

Though I would say the workaround is simple, just don't use the same name for different data, it's looking for trouble.

Well I'm back at home and tried to replicate but annoyingly have had no luck and everything is working as I would expect now with symbols anything other than one called "AUDCHF.custom.spread=1". With any other name I can load data freely ad-hoc  and it appears to be correct.


There seems to some form of problem when I use the name "AUDCHF.custom.spread=1" and I must have somehow corrupted a file and it is pointing to an old dataset. I tried deleting all same named folders in MT5\Tester\bases\Darwinex-Demo\history and also in MT5\Bases\Custom\history. Are there any other files I could try to delete?


It's annoying I can't replicate it but it's happened somehow.


Any ideas appreciated.


E

 

**** update....


OK so I may have found the issue. I searched the MT5 folder for any file with the same name ( *AUDCHF.custom.spread=1) and found a file called AUDCHF.custom.spread=1.txt in MT5\MQL5\Profiles\Tester\Symbols. Inside the file is a line as follows:


Now I'm not sure but at one point I was playing around with Spread value specified in the specification. It is normally set to floating but I changed this to 24. For some reason I didn't think it was working correctly, maybe as the spread values on the chart appeared to be showing what they were before and not 24. So I then changed the value back to "floating" and carried on. What seems to be happening is that during testing this file is overriding any spread values in the datafile, hence why I am seeing a value of 24 rather than 1. It's slightly worrying that it's still doing this even though I set it back to floating. The file doesn't seem to have been deleted.

When I remove the file from the folder and rerun it runs as expected. Is there any information on what's happened here?

Anyone else seen this?

 

If you change the data of a custom symbol that was previously used in the tester, then you need to delete its old data by deleting these two folders.

Tester\bases\ServerName\history\SymbolName
Tester\bases\ServerName\ticks\SymbolName
 
fxsaber #:

If you change the data of a custom symbol that was previously used in the tester, then you need to delete its old data by deleting these two folders.

Hi,


Thanks I will do that now. It doesn't actually appear that that was the issue in the end, it was the presence of the .txt profile file for the symbol in the 

MT5\MQL5\Profiles\Tester\Symbols\ directory.


Any idea on this?