Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (TipmyPip, AndrewAMD, NewbieZorro), 16,655 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Huge difference in zorro results #485657
04/10/22 12:47
04/10/22 12:47
Joined: Apr 2022
Posts: 7
capi48 Offline OP
Newbie
capi48  Offline OP
Newbie

Joined: Apr 2022
Posts: 7
There is a very big difference in the result when using the set(BINARY) mode compared to the result from tradingview (pine-script)

What is the difference?
In the number of orders, in the results of %winRate, in the number of losses and winnings.

General testing logic that works in pinescript:
1. If we have received a condition for entering a trade, the result will be counted after the candle is completed.
For example: we entered the transaction 00:00 exit 00:15 (15 minute bar)
2. If at the time of the formation of the candle from point 1 we receive a new signal, at the end of the formation, namely at 00:15, there will be an entry into a new order again until (00:30).
3. If the closing price of the bar was greater than the opening price of this bar, then the signal is considered correct and is counted as + (and vice versa if minus (let me remind you that the system is only for long))

What I noticed was strange:
In addition to different results, I noticed in the logs that there is no coincidence in the expiration time, namely, when the expiration time is 15 minutes - the time of entry and the time of exit in the log (entry at 00:00 exit 00:30):
Code
[579: Mon 22-03-21 00:00] (1.07434)  < -------- Also if 1.07434 is entry price, i can't find that in price in tradingview fxcm chart ?
[AUD/NZD::L57906] Long 1@1.07422 x at 00:00:00 < --------- * Long at 00:00:00 *

[580: Mon 22-03-21 00:15] -1.00 -1.00 0/1 (1.07365) ** Or Maybe Long at 00:15 ?? :)
[AUD/NZD::L57906] Expired 1@1.07357: -1.00 at 00:30:00 < -------------- * Expired at 00:30 ?? * 


If we talk about the correctness of the signals and the correctness of the data, then I compared the signals looking at the Zorro Chart and noticed that the charts 100% match, even some signals are exactly in the same places as on tradingview (specifically in the same places visually on the graph), but to be precise, I noticed that some signals that are on TV are not in the zorro chart.

Extensions:
Q:Which currency pair/timeframe/broker did I test on?
A: AUD/NZD/15M/FXCM (tradingview)

Q: Are you sure you have the same data?
A: Yes, the data was downloaded from FXCM (1M)
A2:
[Linked Image]


Q: Are you sure that tradingview has an accurate result?
A: Yes, I started from there and tested this system there several times, I created the code and tested it on many scripts, both using the replay function on tradingview and in real time.

Q: Is the result from zorro completely opposite to the result of tradingview or are there similar results?
A: If you test for several years, if zorro shows a result above 56%, then the same code and logic on tradingview will result in about 60-62%, this is about the difference.

In conclusion:

I have been testing zorro for about 2 days, two days ago I started using it, read the documentation and tried to figure out why there is such a difference, but after unsuccessful results I decided to ask a question here
I will be glad of any help, thank you!

Last edited by capi48; 04/15/22 12:00.
Re: Huge difference in zorro results [Re: capi48] #485658
04/10/22 14:40
04/10/22 14:40
Joined: Apr 2008
Posts: 594
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 594
Austria
If the trades are identical but their result is different, then the tv trade cost or slippage simulation is likely wrong. Find out which it is and fix it.

If also the trades are different then check the reasons of differences listed in the manual under Conversion.

Re: Huge difference in zorro results [Re: capi48] #485662
04/10/22 17:23
04/10/22 17:23
Joined: Apr 2022
Posts: 7
capi48 Offline OP
Newbie
capi48  Offline OP
Newbie

Joined: Apr 2022
Posts: 7
In the documentation, I found the Verbose parameter by setting its value to 15 (as recommended) now in the logs ohlc values are displayed, comparing them, I see that they do not match those on tradingview.

How ohlc values cannot match with same candle formations?

I also tried using Fill = 8; this changed %win but did not change the overall picture.

Let's summarize the results:

1. Judging by the log, there is a discrepancy in ohlc values.
2. There is also a discrepancy in open orders, they are very different.
3. The time of each bar and its formation are identical.

But unfortunately I do not understand why and how it can be solved.
Please help.. crazy

Upd:

Maybe I need to download a different date type (before that I used Ask/Bid) I wonder what will happen if I use Unadjusted, i'll update comment after test.

Tested result:
Fail, Unadjusted type doesn't solve discrepancy in ohlc values and the problem as a whole.

Last edited by capi48; 04/10/22 21:55.
Re: Huge difference in zorro results [Re: capi48] #485663
04/11/22 02:27
04/11/22 02:27
Joined: Oct 2018
Posts: 98
7
7th_zorro Offline
Junior Member
7th_zorro  Offline
Junior Member
7

Joined: Oct 2018
Posts: 98
I think you need this line of codes.

Spread = RollLong = RollShort = Commission = Slippage = 0;

Re: Huge difference in zorro results [Re: capi48] #485664
04/11/22 02:39
04/11/22 02:39
Joined: Apr 2008
Posts: 594
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 594
Austria
The manual is your friend!

"Compare historical price data. Print out several candles with the same time stamps and check. Have they the same OHLC prices? Are they from ask, bid, or trade prices? Is the timestamp from the open, the center, or the close of the bar? UTC or a local time zone? When using tick data, does it contain the same quotes? Candles with different price types or time zones will produce different results."

Some platforms like MT4 use a local time zone instead of UTC, so their results are always different dependent on location. You must set Zorro to the same time zone for simulating this.

Forex prices are anyway different with any broker.

Re: Huge difference in zorro results [Re: Petra] #485668
04/11/22 15:45
04/11/22 15:45
Joined: Apr 2022
Posts: 7
capi48 Offline OP
Newbie
capi48  Offline OP
Newbie

Joined: Apr 2022
Posts: 7
Originally Posted by 7th_zorro

Spread = RollLong = RollShort = Commission = Slippage = 0;

Of all the variables, only slippage works, only it affects the result, but does not solve the problem.

Originally Posted by Petra
The manual is your friend!

"Compare historical price data. Print out several candles with the same time stamps and check. Have they the same OHLC prices? Are they from ask, bid, or trade prices? Is the timestamp from the open, the center, or the close of the bar? UTC or a local time zone? When using tick data, does it contain the same quotes? Candles with different price types or time zones will produce different results."

Earlier I found this explanation in the reference book, it is clear that the result depends on the time zone and prices, the question is how to get Zorro to adapt to this.

So far, after rereading the entire manual and still trying to achieve the same (or at least with an average error) result similar to tv - I can't do anything.

The result I get is not even close to what is on tradingview.

For the purity of the experiment, I did the following:
1. From the reference book in the "migration" section, I took the given SMA code of the function for zorro and tv.
2. Set the same parameters, set the same time frame and the same conditions for entry.
3. Compared the charts and additionally set the same time zone.

Result:
Tradingview:
Trades: 232
Win: 48.7%
Zorro:
Trades: 15
Win: 40%

How to solve it?

Last edited by capi48; 04/15/22 12:00.
Re: Huge difference in zorro results [Re: capi48] #485678
04/13/22 11:51
04/13/22 11:51
Joined: Apr 2008
Posts: 594
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 594
Austria
Well if the price candles are already different as you told above, then it is obvious that trades and returns will be also totally different, so neither your Zorro code nor your TV code makes any sense at this point. You scripts also look way to complicated.

First determine why and in which way the candles are different, and fix it, either in TV or in Zorro. When they are 100% identical, next step is a small script that opens a single trade. Compare entry and exit price, trading cost, slippage, and return. If they are different, find the reason and fix it. Only then you are ready for comparing simple SMA systems and the like.

Re: Huge difference in zorro results [Re: capi48] #485699
04/15/22 12:10
04/15/22 12:10
Joined: Apr 2022
Posts: 7
capi48 Offline OP
Newbie
capi48  Offline OP
Newbie

Joined: Apr 2022
Posts: 7
And so, after long tests and unsuccessful attempts, I decided to find out why the data differs directly from tradingview itself.

I wrote to tech support and received this response.
Here is the response of technical support:

Quote
Due to the peculiarities of FXCM API, FXCM sends us different data in real-time streaming and in history, therefore FXCM data can be different every time the chart was opened or refreshed.
We are working in cooperation with FXCM to show the same data.


The solution at the moment:

In tradingview, there is an option "export data", the only disadvantage, since tradingview has limitations, for example, on a 1-minute timeframe, you can get data in just 2-4 months.

The data export option is also available for a pro, premium subscription.

Re: Huge difference in zorro results [Re: capi48] #485707
04/16/22 10:54
04/16/22 10:54
Joined: Apr 2008
Posts: 594
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 594
Austria
I do not believe that reason. Yes FXCM live data is normally different because it depends on the source and has outliers, but for FXCM historical data they combine their price sources and remove outliers, so it should be always the same. Even if not, the differences should be irrelevant on bar periods above 60 minutes.

Anyway can you not save Zorro historical data in CSV format and then import it in TV? Or is import also only for premium subscription?

Or you test not Forex but stocks or ETFs, they should have no data differences.

Re: Huge difference in zorro results [Re: Petra] #485728
04/18/22 11:05
04/18/22 11:05
Joined: Apr 2022
Posts: 7
capi48 Offline OP
Newbie
capi48  Offline OP
Newbie

Joined: Apr 2022
Posts: 7
Originally Posted by Petra
Anyway can you not save Zorro historical data in CSV format and then import it in TV? Or is import also only for premium subscription?


There's no option to import data to TV chart, only export.

Originally Posted by Petra
Or you test not Forex but stocks or ETFs, they should have no data differences


I'll try to test stocks, thank you!

Also i have another question, i tried to import data from TV throught csvtohistory script and also checked it with ZhistoryEditor, all data/time/timezone and prices seems to be the same, but when i do backtest i got absolutely different results even with exact same data.

As i know spread and slippage in TV is 0, so setting to this values doesn't helps.

Is there any errors that probably i did, which can cause this issue?

Thanks.

Page 1 of 2 1 2

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1