Huge different equity between SQX and MultiCharts. It could be serious mistakes.

131 dev2,



I just make a quick test, but find many huge difference.  


Very disappointed that this occured again.

Attachments
Strategy 221180.sqx
(40.53 KiB)
Instruments.xml
(578 B)
202131SHFE_Rb98_Day-D1-NoSession.csv
(126.49 KiB)
Strategy 221104.sqx
(51.58 KiB)
Screenshot 2021-03-01 162400.png
(9.73 KiB)
Strategy 227161.sqx
(59.40 KiB)
Build.cfx
(32.10 KiB)
Strategy 19147.sqx
(40.13 KiB)
Strategy 32137.sqx
(35.18 KiB)
  • Votes +1
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

e
#1

eastpeace

01.03.2021 09:32

Task created

TB
#2

Tomas Brynda

01.03.2021 18:41

Status changed from New to Waiting for information

Hi Eastpeace, 

I took a look at the strategy 221180 and in Strategy Config, I can see you used NoSession in trading options.

The strategy uses CloseWeekly which is sensitive to session settings. Please try to set the session in trading options accordingly to your Multicharts settings.


Let me know if it helped.


Best regards,

Tomas

b
#3

beppil

02.03.2021 00:19
Voted for this task.
MF
#4

Mark Fric

02.03.2021 08:18
as usual, this is most likely a difference in backtesting/session settings between SQ and MC. Please make sure you are testing it on exactly the same data.
e
#5

eastpeace

02.03.2021 13:03
The data is exactly same. And it's daily bar, so no session setting here.


Setting in MC as below, 


Commission is 1%% of contract value, slippage is 10 per contract, and the reserved bars is 100

TB
#6

Tomas Brynda

02.03.2021 13:09
Please set the session in SQ according to the data symbol from Multicharts.

It does not matter what timeframe it is.

e
#7

eastpeace

03.03.2021 01:45

Attachment Retest.cfx added

Attachment Sessions.xml added

Attachment Sessions2.xml added

Sessions.xml
(1.33 KiB)
Retest.cfx
(4.02 KiB)
Sessions2.xml
(7.91 KiB)
I get this error after using the setting session.



Error while running project 'Retester'. Cannot invoke "com.strategyquant.tradinglib.backtest.LoadedData.getMarketData()" because "this.loadedData" is null


And I have 6 sessions for different symbols groups, Sessions2.xml


SQ X can run with the sesstions N0230 and N0100,


But get the same error with others, N2300, N2330, dayc, dayif, dayT.


 



TB
#8

Tomas Brynda

03.03.2021 12:25
Thank you for the files. I tried to simulate it and the backtest failed, because the computed data is empty.

The problem is the backtester can't prepare the backtest data using the session from D1 data you have provided.


Please try to import minute data into SQ instead of daily, then it should work. 

I tried on a different symbol which was imported as minute data and there was no problem

e
#9

eastpeace

03.03.2021 14:09

Attachment Strategy 42153.sqx added

Attachment Strategy 421104.sqx added

Attachment Build.cfx added

Attachment SHFErb HOT 1 Minute.7z added

Strategy 421104.sqx
(51.57 KiB)
Build.cfx
(32.24 KiB)
SHFErb HOT 1 Minute.7z
(3.38 MiB)
Strategy 42153.sqx
(46.16 KiB)
Thanks for your woking, Tomas,


I  tested the minute data from Multicharts. The result is still very frustrating.



But I want to trade on the daily bars for some reason. And the sessions setting should only affect the higher timeframe data generating from minute data. Because the test precision for Multicharts is only selected timeframe only, so I would like use the daily bar directly. This makes it easier to deal with gaps when contracts rolling.  (https://www.tradesignal.com/adjusted-futures-contracts/?lang=en)






e
#10

eastpeace

04.03.2021 02:30

Attachment 202131SHFE_Rb98_Day-D1-NoSession.csv added

Attachment Strategy 32167.sqx added

Strategy 32167.sqx
(33.53 KiB)
202131SHFE_Rb98_Day-D1-NoSession.csv
(129.32 KiB)
Hello, Tomas, sorry for the misleading information about sessions setting.


I would like to do more testing and find that it's actually a data reason. I use the daily bar without time column field. And SQ would fill the time filed with 0:00 when set the sessions.


When I correct the data with time column as 15:00, it works.


But this is not the main reason for the difference in SQ and Multihcarts.  Another strategy for example. trades  in SQ is 82 and that is 318 in multicharts.

TB
#11

Tomas Brynda

04.03.2021 11:59

Status changed from Waiting for information to Fixed

Hi Eastpeace,

there was a problem that SQ couldn't handle complicated session patterns. 

It assumed every day session is defined on a single line. 


I have added support for multiline day session patterns. I was testing on various timeframes and session settings (including your N2300) and now it looks much better.

There's no big differences between SQ and MC, the equity charts are well aligned.


This change will be included in B131 final release.


Best regards,

Tomas

e
#12

eastpeace

04.03.2021 13:26

Attachment compare.png added

Attachment signal 139113.png added

Attachment Strategy 137145.sqx added

Attachment Strategy 139113.sqx added

Attachment Strategy 139115.sqx added

Attachment Strategy 140167.sqx added

Attachment Strategy 21104.sqx added

Attachment Strategy 325139.sqx added

Strategy 137145.sqx
(34.05 KiB)
Strategy 325139.sqx
(37.97 KiB)
compare.png
(7.18 KiB)
signal 139113.png
(66.83 KiB)
Strategy 139113.sqx
(43.36 KiB)
Strategy 21104.sqx
(47.32 KiB)
Strategy 139115.sqx
(49.16 KiB)
Strategy 140167.sqx
(53.55 KiB)
The issue is still not solved.


1, Now the sessions works well with Multicharts regular data, except the volume. But all the strategy didn't use volume.


2, The difference still exists, even I use the higher timeframe data exported from Multicharts directly. There are many differences in trading signals in some strategy. It's not sessions matter, I guess.


I do this with this setting.

In SQ,

commision  0.04% the equity

spread 0

slippage 0

reserved bars 100


In MC,

commision  0.02% of the equity

slippage 0

reserved bars 100



The profit will be slightly different since the decduction method of the commission or slippage are not exactly the same. But the trading signals should be exactly the same, or 99.99%.  In fact the number of trades in many strategies differs too much. You will find a lot of differences on the trading signal charts.


Please check this again. Thank you.




TB
#13

Tomas Brynda

04.03.2021 14:22
Just tested all of the strategies you attached. Every one of them gives very similar results.

Please wait for B131, you should be able to get matching results.


By the way are you sure the session N2300 in SQ is correctly defined compared to Multicharts session?

I had to remove the last session element Fri 21:00 - Fri 23:00, otherwise Multicharts won't let me save the session.

KL
#14

kainc301

04.03.2021 18:00


Tomas, Can you check if this fixed this error here https://roadmap.strategyquant.com/tasks/sq4_7066


Because I have had strategies produced for multicharts that dont work at all in the platform. If not can this be looked at seriously for B131 or 132? I dont know why it was removed previously

e
#15

eastpeace

05.03.2021 01:36

Attachment sessions eod in MC.png added

Attachment sessions in SQ adjust.png added

sessions in SQ adjust.png
(30.99 KiB)
sessions eod in MC.png
(34.68 KiB)
Thank you, Tomas, You pointed out a very good question.  


Since there are sessions templates in my MC and I cannot scroll through them, I have never noticed this detail before.


I try to set it from scratch and find something. 

 

You should set the last session of Friday as EOD. It's not the exchange's rule, but by the Multicharts's method. The 15 minutes bar in MC shows that.


It may not affect the timeframe lower than 60 minute from 1 minute data, I guess. I have checked this, the 60 minutes data's price generated by SQ and MC is the exactly same.  It could affect the 2 hours, 4hours, or Day timeframe bar data generated.  



e
#16

eastpeace

13.03.2021 14:10

Attachment SHFErb HOT 30 minute.txt added

Attachment Strategy 487101.sqx added

Attachment Strategy 148112.sqx added

Attachment Strategy 481178.sqx added

Attachment Data.xml added

Attachment Sessions.xml added

Attachment Instruments.xml added

Attachment 1.png added

Attachment 2.png added

Data.xml
(918 B)
2.png
(108.93 KiB)
Strategy 487101.sqx
(39.50 KiB)
SHFErb HOT 30 minute.txt
(674.97 KiB)
Sessions.xml
(1.33 KiB)
Strategy 148112.sqx
(37.15 KiB)
Strategy 481178.sqx
(41.71 KiB)
1.png
(113.45 KiB)
Instruments.xml
(587 B)
This seems to get worse in dev3. I just tested it so I have to point it out.


1, Sessions works well except for the volume.  Fortunately, I just use the price part in strategy. I have compared the 60 minutes, 1 hours, 30 minutes, the OHLC prices are exactly the same with Multicharts's.


2,   These strategies, no matter whether they are generated from 1 minute data, or on the trading time frame data directly from Multicharts, their performance is extremely different from that in the Multicharts. Few of them are the similar.


Votes: +1

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please