New Zorro version 2.30

Posted By: jcl

New Zorro version 2.30 - 07/18/20 09:38

Zorro 2.30 is now available:

http://opserver.de/down/Zorro_230.exe

This version will become the official release when no bugs are found in the next time. New features: realtime chart generation, interactive payoff diagrams for options, emails on errors, new indicators, and many more new features. The full list can be found on http://manual.zorro-project.com/new.htm.

Please test everything and report any issues here! If you're the first one to find a serious bug of this release candidate, you can get a free Zorro S subscription. Details on https://manual.zorro-project.com/restrictions.htm.
Posted By: danatrader

Re: New Zorro version 2.30 - 07/19/20 09:25

http://manual.zorro-project.com/new.htm
Spearman correlation with arbritrary functions.

https://zorro-project.com/manual/en/transform.htm
Spearman(vars Data, int TimePeriod): var
Spearman's rank correlation coefficient; correlation between the original Data series and the same series sorted in ascending order within TimePeriod (1..256). Returns the similarity to a steadily rising series and can be used to determine trend intensity and turning points. Range = -1..+1, lag = TimePeriod/2. For usage and details, see Stocks & Commodities magazine 2/2011. Source available in indicators.c.


What are those "arbitrary functions"? Already listed above?
Posted By: Morris

Re: New Zorro version 2.30 - 07/19/20 11:53

The arbitrary function is whatever you use to generate vars Data. Spearman is just a type of correlation (based on rank, not distances of data points)...
Posted By: AndrewAMD

Re: New Zorro version 2.30 - 07/19/20 13:47

jcl,

You should run diff-checks on all of your manual pages between the online version and the distributed helpfile version, because I am finding lots of differences!

Online but not in help file:
* From what's new page: "Spearman correlation with arbritrary functions. New Ehlers indicators: CTI, CCYI, CCYIR, CCYIState."
* correl() function description

In help file but not online:
* assetSelect() function description
* updated MarginCost description

Originally Posted by danatrader
http://manual.zorro-project.com/new.htm
Spearman correlation with arbritrary functions.
The "What's New" page does not clarify it is referring to correl() and not to Spearman().
Quote
var correl(vars Data, int Length, function)
Spearman correlation of the Data series with an arbitrary function. Used for the CTI, CCYI, and CCYIR indicators. Source in indicators.c; usage and description on Financial Hacker.
Posted By: jcl

Re: New Zorro version 2.30 - 07/20/20 05:51

Thanks, we'll update the docs.
Posted By: Zheka

Re: New Zorro version 2.30 - 07/20/20 16:17

Zorro 'peeks' by one 'tick' when entering trades by returning 2 in a tmf.

This script:
Code
[size:8pt]function stp(var entStp) {
	
	print(TO_LOG,"\n in tmf: %s, high = %.5f, close = %.5f", strdate(HMS,wdate(0) ), priceHigh(0), priceClose(0) ); 
 
   if (TradeIsPending)
   {
	  if (TradeIsLong) 
		if (priceHigh(0)>priceOpen(0)+entStp )   // or priceClose(0)>
		{
			print(TO_LOG,"\n ---- long Entry Stop is hit!----open=%.5f, high=%.5f  close=%.5f  entStp=%.5f", priceOpen(0), priceHigh(0), priceClose(0), priceOpen(0)+entStp);
			
			return 2;
		} 
   }
  
  return 4;
  
}


function run()
{
	set(LOGFILE, TICKS);
		   
	Verbose = 3;
	
	Spread=Slippage = 0;
	
	BarPeriod = 60; 
		
	StartDate = 2019; //2015
	EndDate   = 2020;//0424; 
	
	
	asset("EUR/USD");
	
	var atr = ATR(24);
	
	LifeTime=1;
	
	Entry = 1.5*atr;
	
	enterLong(stp,0.5*atr);
	
}	[/size] 
generates this output:
Quote
[80: Mon 19-01-07 13:00] 1.14407/1.14474\1.14368/1.14394 -0.0
Enter Long EUR/USD Entry 0.0023498 at 13:00:00
(EUR/USD::L) Long 1@1.14629 Entry stop
in tmf: 13:01:00, high = 1.14429, close = 1.14418
in tmf: 13:02:00, high = 1.14450, close = 1.14448
in tmf: 13:03:00, high = 1.14451, close = 1.14444
in tmf: 13:04:00, high = 1.14451, close = 1.14418
in tmf: 13:05:00, high = 1.14451, close = 1.14438
in tmf: 13:06:00, high = 1.14451, close = 1.14444
in tmf: 13:07:00, high = 1.14453, close = 1.14452
in tmf: 13:08:00, high = 1.14453, close = 1.14443
in tmf: 13:09:00, high = 1.14453, close = 1.14440
in tmf: 13:10:00, high = 1.14453, close = 1.14436
in tmf: 13:11:00, high = 1.14453, close = 1.14439
in tmf: 13:12:00, high = 1.14453, close = 1.14424
in tmf: 13:13:00, high = 1.14453, close = 1.14409
in tmf: 13:14:00, high = 1.14453, close = 1.14423
in tmf: 13:15:00, high = 1.14453, close = 1.14449
in tmf: 13:16:00, high = 1.14453, close = 1.14448
in tmf: 13:17:00, high = 1.14462, close = 1.14453
in tmf: 13:18:00, high = 1.14464, close = 1.14462
in tmf: 13:19:00, high = 1.14464, close = 1.14441
in tmf: 13:20:00, high = 1.14483, close = 1.14480
---- long Entry Stop is hit!----open=1.14394, high=1.14483 close=1.14480 entStp=1.14473
[EUR/USD::L08101] Long 1@1.14441 x at 13:20:00
Com 0.0300 Mrg 37.74 Net 0


The correct entry price should be 1.14480.
Posted By: jcl

Re: New Zorro version 2.30 - 07/21/20 05:54

Thanks, we'll look into that, but has it something to do with version 2.30?
Posted By: Zheka

Re: New Zorro version 2.30 - 07/21/20 10:01

I noticed it working on beta 2.28.4 yesterday, then installed 2.30 to see if it might have been corrected.


Posted By: Zheka

Re: New Zorro version 2.30 - 07/22/20 00:43

Coming back to the discussion (https://opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=480527#Post480527), the initial reply was that trades entered with Entry (but missed) have a "TradeIsPending" status,
and then jcl wrote that "Missed Pending trades are not preserved (stored by Zorro)".

In v 2.30, this script:
Code
function run()
{
	set(LOGFILE);
		   
	//Verbose = 3;
	
	BarPeriod = 60; 
		
	StartDate = 2019; 
	EndDate   = 2020;
	
	
	asset("EUR/USD");
	
	var atr = ATR(24);
	
	LifeTime=1;
	
	Entry = 1.0*atr;
	
	enterLong();
	
	if ( (NumWinTotal+NumLossTotal)==4 )
		for(last_trades)
		 //if (TradeIsPending)	//TradeIsMissed
			print(TO_LOG,"\n TradeDate=%.2f, TradePriceOpen=%.5f, TradeProfit=%.2f", (var)TradeDate,(var) TradePriceOpen,(var)TradeProfit );		
	
}
generated this output:
Quote
[117: Wed 19-01-09 07:00] -0.89 0 0/3 (1.14588)
(EUR/USD::L) Long 1@1.14721 Entry stop
(EUR/USD::L) Missed entry 1.1474 after 1 bar
(EUR/USD::L) Entry stop 1.14721 hit by 1.14785 at 07:00:00
[EUR/USD::L11802] Long 1@1.14717 x at 07:00:00

[118: Wed 19-01-09 08:00] -0.89 -0.65 0/4 (1.14659)
(EUR/USD::L) Long 1@1.14798 Entry stop

[119: Wed 19-01-09 09:00] -0.89 -0.95 0/4 (1.14629)
(EUR/USD::L) Long 1@1.14766 Entry stop
[EUR/USD::L11802] Expired 1@1.14617: -1.07
(EUR/USD::L) Missed entry 1.1480 after 1 bar

[120: Wed 19-01-09 10:00] -1.97 0 0/4 (1.14605)
(EUR/USD::L) Long 1@1.14742 Entry stop
TradeDate=0.00, TradePriceOpen=1.14605, TradeProfit=0.00
TradeDate=0.00, TradePriceOpen=1.14630, TradeProfit=0.00
TradeDate=0.00, TradePriceOpen=1.14657, TradeProfit=0.00
TradeDate=43474.29, TradePriceOpen=1.14717, TradeProfit=-1.07
TradeDate=0.00, TradePriceOpen=1.14608, TradeProfit=0.00
TradeDate=0.00, TradePriceOpen=1.14600, TradeProfit=0.00
TradeDate=0.00, TradePriceOpen=1.14543, TradeProfit=0.00
TradeDate=0.00, TradePriceOpen=1.14516, TradeProfit=0.00
TradeDate=0.00, TradePriceOpen=1.14576, TradeProfit=0.00
TradeDate=0.00, TradePriceOpen=1.14560, TradeProfit=0.00
TradeDate=0.00, TradePriceOpen=1.14575, TradeProfit=0.00
TradeDate=43473.96, TradePriceOpen=1.14546, TradeProfit=-0.01
TradeDate=0.00, TradePriceOpen=1.14403, TradeProfit=0.00
TradeDate=0.00, TradePriceOpen=1.14403, TradeProfit=0.00
TradeDate=0.00, TradePriceOpen=1.14423, TradeProfit=0.00.....


Zorro DOES store such missed trades, but their status is undefined (why are they not "Missed"?)

Another issue is wrong "TradePriceOpen" for pending trades.
Posted By: jcl

Re: New Zorro version 2.30 - 07/22/20 08:13

This is the correct code to enumerate pending trades:

for(last_trades)
if (TradeIsPending)
...

A trade can be either pending, open, or closed. So always use an if(...) condition to get the trades that you want. If a trade is neither, it's no valid trade.

And can you please post these questions to another thread? This one is about the new release.
Posted By: Zheka

Re: New Zorro version 2.30 - 07/22/20 10:03

Bug#2:
The manual states:

for(last_trades)
Quote
A for loop that cycles backwards through open, pending, and closed trades with the current asset and algo, starting with the last trade

The provided log shows that it delivers not only "open, pending and closed" trades but also some missed, 'invalid' trades (that are neither) - which - as YOU WROTE - Zorro is not even supposed to store!

Right now, to achieve their stated objective, does one have to write

for(last_trades)
if (TradeIsPending or TradeIsOpen or TradeIsClosed)
.....
???

The same issue is with for(all_trades) and for(past_trades).

I do not believe you meant (and there is any valid purpose) delivering such 'invalid' trades with these macros.

So, let's just make them actually do what they are supposed to.


This is a bug and it is in v 2.30.
Posted By: jcl

Re: New Zorro version 2.30 - 07/22/20 12:21

Ok, I'll improve the wording in the manual. Next posts in this thread please only about real issues with 2.30. Thank you.
Posted By: Zheka

Re: New Zorro version 2.30 - 07/22/20 13:01

Why not just fix the macros?
Posted By: jcl

Re: New Zorro version 2.30 - 07/22/20 13:40

You mean filtering the trades already in the macro? That could break existing scripts.
Posted By: Zheka

Re: New Zorro version 2.30 - 07/22/20 14:09

The macros should deliver only 'real' trades - either pending, open or closed. Without **trades** 'attempted' with Entry but missed.
Bug#2.5
With this bug all functions currently using these macros (like plotTradeProfile(), plotMAEGraph(), etc, possibly results() ) return results with artifacts, processing 'trades' with zero profit/mae/mfe, but counting such as 'trades' .
Code
for(all_trades) 
		{
			var vResult = toPIP(TradeResult);
			var vMAE = TradeMAE/PIP/vStep;
			int n = floor(vMAE);
			plotBar("Profit",n,n*vStep,0,AVG|BARS|LBL2,COLOR_PROFIT);
			if(vResult > 0)
				plotGraph("Win",vMAE,vResult,DOT,GREEN);
			else
				plotGraph("Loss",vMAE,vResult,DOT,RED);
		}



So, either really do not preserve such **trades" (as you confirmed), or make for(..._trades) macros skip those.
Posted By: jcl

Re: New Zorro version 2.30 - 07/22/20 17:08

Indeed. It made probably not much difference, but an if(TradeIsClosed) should be in the plotMAE functions - this will be corrected. It is really a bug.
Posted By: Zheka

Re: New Zorro version 2.30 - 07/24/20 10:19

But what about the macros delivering ONLY REAL trades as intended?

What the use case for getting *attempted but missed* orders (that have no internal status anyway)??
Posted By: jcl

Re: New Zorro version 2.30 - 07/24/20 13:52

That will be unchanged.
Posted By: Zheka

Re: New Zorro version 2.30 - 07/24/20 15:32

Bug#3:
results() does not work correctly:
Code
function run()
{
	BarPeriod = 60; 
		
	StartDate = 2019; 
	EndDate   = 2020;
	
	
	asset("EUR/USD");
	
	var atr = ATR(24);
	
	LifeTime=4;
	
	Entry = -0.5*atr;
	
	if (lhour(ET,0)==15)
		enterLong();
	
	if ( (NumWinTotal+NumLossTotal)==30 )
	{
		var NumWins = results(1+24,30);	// Number of winning and won trades
		var NumLosses = results(1+4+24,30);	// Number of losing and lost trades

		var pipWins = results(2+24,30)/PIP;	   // Total win in pips
		var pipLosses = results(2+4+24,30)/PIP;	// /PIPTotal loss in pips
		
		print(TO_LOG,"\n NumWins=%i, NumLosses=%i, resNumWins=%.0f, resNumLosses=%.0f, pipWins=%.2f, pipLosses=%.2f", NumWinTotal,NumLossTotal,NumWins,NumLosses,pipWins,pipLosses);
		
	}
} 
prints:
Quote
[2825: Thu 19-06-20 00:00] 3.15 -0.60 15/15 (1.12358)
[EUR/USD::L82129] Expired 1@1.12359: -0.59
[2826: Thu 19-06-20 01:00] 2.56 0 15/15 (1.12575)
NumWins=15, NumLosses=15, resNumWins=6, resNumLosses=24, pipWins=52.45, pipLosses=213003.51


Posted By: jcl

Re: New Zorro version 2.30 - 07/27/20 09:55

What is wrong in which way?
Posted By: jcl

Re: New Zorro version 2.30 - 07/27/20 10:09

New version 2.30.1: http://opserver.de/down/Zorro_230.exe

The bugs reported for 2.30.0 have been fixed: dataParse with text strings and storing GTC trades.
Posted By: Zheka

Re: New Zorro version 2.30 - 07/27/20 10:25

At the moment when there are no open or pending trades,
1) results(1+24,30) is 6, while NumWinTotal is 15; same for losing trades
2) results(2+4+24,30)/PIP cannot conceivably be 213003
Posted By: jcl

Re: New Zorro version 2.30 - 07/27/20 13:13

Your results call sums up the last 30 trades. Not the total of all trades.
Posted By: Zheka

Re: New Zorro version 2.30 - 07/27/20 13:30

If it is too difficult to read 2 messages above, here is the piece of code again:
Code
if ( (NumWinTotal+NumLossTotal)==30 )
	{
	var NumWins = results(1+24,30);	// Number of winning and won trades
	var NumLosses = results(1+4+24,30);	// Number of losing and lost trades

	var pipWins = results(2+24,30)/PIP;	   // Total win in pips
	var pipLosses = results(2+4+24,30)/PIP;	// /PIPTotal loss in pips
		
	print(TO_LOG,"\n NumWins=%i, NumLosses=%i, resNumWins=%.0f, resNumLosses=%.0f, pipWins=%.2f, pipLosses=%.2f", NumWinTotal,NumLossTotal,NumWins,NumLosses,pipWins,pipLosses);
		
	}
which gives:
Quote
[2826: Thu 19-06-20 01:00] 2.56 0 15/15 (1.12575)
NumWins=15, NumLosses=15, resNumWins=6, resNumLosses=24, pipWins=52.45, pipLosses=213003.51



Posted By: jcl

Re: New Zorro version 2.30 - 07/27/20 13:37

Ok, we'll check what's wrong with the pips of losses. But for summing up closed trades you must use +16, not +24.

https://manual.zorro-project.com/results.htm
Posted By: Zheka

Re: New Zorro version 2.30 - 07/27/20 14:18

I want to sum up BOTH open and closed trades.

BUT in this specific moment, there are no open trades (have a look at my original message: the log showed that the open trade has just been closed at 19-06-20 00:00.)

So, using +16 or +24 (or not using any) should return a number equal to NumWinTotal over 30 trades.


Addition: just tried this example with +8 (only open trades ) -> It returns exactly the same numbers for # of trades and pips as with +24, - at the moment when there are NO OPEN TRADES (and it should return zeros).

Pls confirm you can replicate this.
Posted By: Zheka

Re: New Zorro version 2.30 - 07/27/20 17:35

Bug#4: when using plot() functions with LOGFILE set, Zorro does not export values for the first and the last "bins" to the ".._plot.csv" file.
Posted By: Grat

Re: New Zorro version 2.30 - 07/28/20 08:07

Script Process.c not work correct.

Attached picture process.jpg
Posted By: jcl

Re: New Zorro version 2.30 - 07/29/20 08:17

Thank you for testing!

- Calling results() with +8: The bug was confirmed. It will be fixed in the next update.
- No first and last bin in the plot.csv: Not confirmed. But it could depend on the script, can you post it?
- Process.c does not work: Not confirmed. Can you contact Support? It can be some PC specific issue, so we'll need more details.
Posted By: Zheka

Re: New Zorro version 2.30 - 07/29/20 16:46

Originally Posted by jcl

- No first and last bin in the plot.csv: Not confirmed. But it could depend on the script, can you post it?
Indeed, it only shows in some very special cases.
Code
#include <profile.c>

function run()
{
	set(LOGFILE);
	set(PEEK);
   	
	BarPeriod = 60; 
		
	StartDate = 2019; 
	EndDate   = 2020;
		
	if (true) {
		var ibs=IBS();
		
		var st = 0.05;
		var Ret = (priceClose(-1)-priceClose(0));
		var Bin = floor(ibs /st) ;  

		plotBar(Asset, Bin , st*(Bin),Ret,AVG+LINE+NEW,GREEN);//
	}
	 else
		 plotDay(priceClose(0),0);
	
}

plotSeason and plotDay/Week/etc functions also have several bugs: one is that 'period one' at the start of a "season" is not counted/always zero.

Attached picture plotDay_tocsv_bug.JPG
Attached File
Attached picture plotBar_tocsv_bug.JPG
Attached File
Posted By: Zheka

Re: New Zorro version 2.30 - 07/30/20 16:21

jcl,

is there an update/feedback on the very first - and very serious - bug I reported?

By using the price of 'tick' (1Min) earlier than Entry stop is hit, Zorro greatly inflates the results of such entries..
Posted By: jcl

Re: New Zorro version 2.30 - 08/03/20 09:45

- Zorro greatly inflates the results: I hope not. At least the result in your post was apparently not inflated, but just random.
Posted By: Zheka

Re: New Zorro version 2.30 - 08/03/20 12:41

Was the report reviewed in earnest? Or at all??
Quote
80: Mon 19-01-07 13:00] 1.14407/1.14474\1.14368/1.14394 -0.0
Enter Long EUR/USD Entry 0.0023498 at 13:00:00
(EUR/USD::L) Long 1@1.14629 Entry stop <- initial entry stop from Entry=1.5*atr
in tmf: 13:01:00, high = 1.14429, close = 1.14418
in tmf: 13:02:00, high = 1.14450, close = 1.14448
in tmf: 13:03:00, high = 1.14451, close = 1.14444
in tmf: 13:04:00, high = 1.14451, close = 1.14418
in tmf: 13:05:00, high = 1.14451, close = 1.14438
in tmf: 13:06:00, high = 1.14451, close = 1.14444
in tmf: 13:07:00, high = 1.14453, close = 1.14452
in tmf: 13:08:00, high = 1.14453, close = 1.14443
in tmf: 13:09:00, high = 1.14453, close = 1.14440
in tmf: 13:10:00, high = 1.14453, close = 1.14436
in tmf: 13:11:00, high = 1.14453, close = 1.14439
in tmf: 13:12:00, high = 1.14453, close = 1.14424
in tmf: 13:13:00, high = 1.14453, close = 1.14409
in tmf: 13:14:00, high = 1.14453, close = 1.14423
in tmf: 13:15:00, high = 1.14453, close = 1.14449
in tmf: 13:16:00, high = 1.14453, close = 1.14448
in tmf: 13:17:00, high = 1.14462, close = 1.14453
in tmf: 13:18:00, high = 1.14464, close = 1.14462
in tmf: 13:19:00, high = 1.14464, close = 1.14441
in tmf: 13:20:00, high = 1.14483, close = 1.14480 <--this is when a trade is entered by a tmf returning 2
---- long Entry Stop is hit!----open=1.14394, high=1.14483 close=1.14480 entStp=1.14473
[EUR/USD::L08101] Long 1@1.14441 x at 13:20:00

The price of entry should be 1.14480 while Zorro's recorded price of entry is 1.14441 - a 4 PIP difference!

And no, it is NOT random. It is 1 tick earlier EACH TIME.

I discovered this when live trading results significantly deviated from a subsequent re-test (and backtesting expectations).

"Hopes" cost dearly. Just run the provided script and - 1.5 weeks since the report - you may as well provide a normal and constructive feedback...
Posted By: jcl

Re: New Zorro version 2.30 - 08/03/20 13:28

Don't worry, we review all reports and are very, very earnest. - Can you then post a log where it is not random, but 1 tick earlier each time?
Posted By: Zheka

Re: New Zorro version 2.30 - 08/03/20 13:54

The first equity curve is from the provided script (entry from a tmf returning 2 as soon as price crosses 0.5*atr),
second is the same script without using a tmf, just with Entry = 0.5*atr.
Slippage=0 in both cases.

See the "inflation"?

The first approach should actually give worse results since price definitely has to cross the stop entry level (maybe by a lot) for an entry to trigger.

Attached picture Zorro_tmf2_entry.JPG
Attached picture Zorro_05atr_entry.JPG
Posted By: jcl

Re: New Zorro version 2.30 - 08/03/20 13:59

Hmm, I see two balance charts, one good, one bad. I was hoping for a log that shows a "1 tick early" bug.
Posted By: jcl

Re: New Zorro version 2.30 - 08/03/20 14:01

New version 2.30.3:

http://opserver.de/down/Zorro_230.exe

The bugs reported so far have been fixed:

- Sometimes no first and last bin in the plot.csv of a histogram
- Wrong plotHeatmap example in the manual
- Wrong PriceDist script
- Missing CuirrencyStrength script
- enterTrade() did not update the LotsPool variable
- Brute Force sometimes printed a wrong result to the window
Posted By: Zheka

Re: New Zorro version 2.30 - 08/03/20 14:24

By asking to post a log - do you mean that the provided script generates a completely different result at your computer?

Here is it anyway (for 2020, to fit attachment size limits).

If you find several cases where entry price is worse than the intended entry ( which is what you mean by "random", right?) - pls point the dates out.

Attached File
ea_tmf2_stopEntry_test.log  (122 downloads)
Posted By: jcl

Re: New Zorro version 2.30 - 08/03/20 14:28

Thank you for the log. Where in it is the bug? Do you have the line numbers?
Posted By: Zheka

Re: New Zorro version 2.30 - 08/03/20 14:29

Is results() +8 bug fixed in 2.30.3?
Posted By: jcl

Re: New Zorro version 2.30 - 08/03/20 14:31

Yes. Sorry, I forgot to mention it in the post.
Posted By: Zheka

Re: New Zorro version 2.30 - 08/03/20 14:56

You cannot reasonably ask for 'each line number with a bug'.

At each bar when an entry triggers, compare the price of "0.5*atr entry stop" (intended) with the actual entry price at "Long1@".
Quote
[99: Wed 20-01-08 14:00] -6.41 -0.0500 3/9 (1.11200)
(EUR/USD::L) Long 1@1.11362 Entry stop
0.5*atr entry stop=1.11254
[EUR/USD::L10002] Long 1@1.11249 x at 14:31:00
Actual entry price is always more favorable.

To demonstrate that this is actually the price from "1-tick earlier", here is a more detailed log with each tick printed.



Attached File
ea_price2_stopEntry_test.zip  (78 downloads)
Posted By: Zheka

Re: New Zorro version 2.30 - 08/03/20 15:24

This is the script used (same as in the very first message).

It's "inflated" equity curve is just an 'automated' way to show that 'peeking' is consistent; and the magnitude is clear by comparing to a benchmark (Entry=0.5*atr; enterLong(); ) where Entry prices are correct.

Attached File
ea_tmf2_stopEntry.c  (159 downloads)
Posted By: jcl

Re: New Zorro version 2.30 - 08/04/20 05:44

Ok, do I understand it right: The problem was not that the entry stop happened 1 tick early, the problem was that your TMF opened the trade 1 tick early?
Posted By: Zheka

Re: New Zorro version 2.30 - 08/04/20 10:02

Sorry, I do not understand the question.

When a price exceeds a certain level (0.5*atr), a trade is entered by the tmf returning 2.

However, Zorro internally records the entry price from 1 tick before the entry time.
Quote
in tmf: 13:18:00, high = 1.14464, close = 1.14462
in tmf: 13:19:00, high = 1.14464, close = 1.14441
in tmf: 13:20:00, high = 1.14483, close = 1.14480 <--this is when a price exceed 1.14473 and the trade is entered by tmf returning 2
---- long Entry Stop is hit!----open=1.14394, high=1.14483 close=1.14480 entStp=1.14473
[EUR/USD::L08101] Long 1@1.14441 x at 13:20:00
Trade :L080101 is entered at 13:20 with the price at 13:19.
Posted By: jcl

Re: New Zorro version 2.30 - 08/04/20 10:14

Ok. I assumed it was an entry stop issue. We cannot confirm a TMF fill price from 1 tick earlier either, so possibly something else is wrong. But I think at least I understand now the problem and we can check it. Sorry for being dull.
Posted By: Zheka

Re: New Zorro version 2.30 - 08/04/20 10:42

The script cannot be simpler, and the logs are what they are.

Quote
We cannot confirm a TMF entry price from 1 tick earlier either
I see 0 downloads of my script; so not sure what exactly has been used to confirm the problem.
May I pls ask you to actually run the provided script and post the same part of the log that I posted, for 19-01-07 13:00?
Posted By: jcl

Re: New Zorro version 2.30 - 08/04/20 11:05

Don't worry about your script. We have our test programs for this. We'll find the problem.

Until this is resolved, use the normal Entry variable for an entry stop, not your TMF.
Posted By: Zheka

Re: New Zorro version 2.30 - 08/04/20 14:23

2 more issues:
Code
function stp(var entStp, var entT) {
	
	print(TO_LOG,"\n in tmf: %s, high = %.5f, close = %.5f", strdate(HMS,wdate(0) ), priceHigh(0), priceClose(0) ); 
 
        watch("#entT=",strdate(HMS,entT));
 
       return 4; //or 0  
}

function run()
{
	set(LOGFILE, TICKS);
		   
	Verbose = 3;
	
	Spread=Slippage = 0;
	
	BarPeriod = 60; 
		
	StartDate = 2020; 
	EndDate   = 2020;		
			
watch("#wdate=",strdate(HMS,wdate(0)));	

	enterLong(stp,10*PIP,wdate(0));		
} 
logs this:
Quote
[80: Tue 20-01-07 19:00c] 1.11425/1.11497\1.11413/1.11435 -0.0
wdate= 19:00:00
[EUR/USD::L08001] Long 1@1.11435 x at 19:00:00

in tmf: 19:01:00, high = 1.11442, close = 1.11440
entT= 19:01:52
in tmf: 19:02:00, high = 1.11443, close = 1.11428
entT= 19:01:52
1) Why would Zorro enter any trade at all?

2) Time passed as a parameter to the tmf becomes some 2 min ahead inside the tmf!??? --see in red
Posted By: Zheka

Re: New Zorro version 2.30 - 08/05/20 10:34

I accidentally deleted LifeTime=1 from the code above; the log is correct.
Posted By: jcl

Re: New Zorro version 2.30 - 08/05/20 12:17

To answer the second question: TMF parameters are for numbers only. They are stored in floats and cannot hold a DATE variable in full precision.
Posted By: Zheka

Re: New Zorro version 2.30 - 08/05/20 15:30

The manual says otherwise:
Quote
If the TMF is passed to an enter command, it can receive up to 8 additional var parameters following the function name: enterLong(MyTMF, parameter1, parameter2...). They must also appear in the function's parameter list and keep their values during the lifetime of the trade. The global manage function has no parameters.
Also, 2-minute difference is 0.00138888. If there is any rounding involved internally, downcasting a var to a float, this shouldn't cause difference up in the 3-rd significant digit.
Posted By: AndrewAMD

Re: New Zorro version 2.30 - 08/05/20 15:44

var are being cast to float here.

It is about 44046 days since January 1, 1900, so your date value of 44046.00138888 vs 44046.00000000 requires more significant digits than you suggest.
Posted By: Zheka

Re: New Zorro version 2.30 - 08/05/20 17:58

I meant 3rd decimal digit, sorry.

But this line:
Quote
print(TO_LOG,"\n wdate as var=%.7f, wdate in float=%.7f, %s", wdate(0), (var)(float)wdate(0), strdate(HMS,(var)(float)wdate(0) ) );
when run in lite-C indeed shows 1:52 min difference after downcasting, but in C++ both values are exactly the same.

The difference is quite significant, how come?
Posted By: AndrewAMD

Re: New Zorro version 2.30 - 08/05/20 18:40

Maybe your recast is incomplete in C++? Declare and initialize a float to the value, and use that instead. Then your floating precision should actually decay.

Also, significant figures are quite relevant:
https://www.geeksforgeeks.org/difference-float-double-c-cpp/
Quote
float is a 32 bit IEEE 754 single precision Floating Point Number (1 bit for the sign, 8 bits for the exponent, and 23* for the value), i.e. float has 7 decimal digits of precision.

double is a 64 bit IEEE 754 double precision Floating Point Number (1 bit for the sign, 11 bits for the exponent, and 52* bits for the value), i.e. double has 15 decimal digits of precision.
Posted By: Zheka

Re: New Zorro version 2.30 - 08/05/20 19:47

If I declare and initialize a var to a value, and then recast to float and back, I indeed see the difference. Why doesn't it happen if recasting the result of wdate()?
Posted By: hast29

Re: New Zorro version 2.30 - 08/05/20 21:28

Hi,

is the 2.30.3 release considered to update the running Z Strategies and their parameters?

If yes, the Z7 strategy has some new PDD algorithm, which behaves strange.

This algorithm has opened and saved into „trades.csv“ long and short trades at the same minute bar with the same asset. It happened several times during the back test.

Attached picture hedge.png
Posted By: jcl

Re: New Zorro version 2.30 - 08/06/20 08:03

-Z7 behaves strange: it now trades 2 PDD variants with different patterns. But they should normally not trade against each other. We'll look into that.

-Zheka's TMF entered at wrong price: Caused by setting an entry stop, but entering via TMF. Set TradeEntryLimit to 0 before returning 2. This will be fixed in the next update.
Posted By: Zheka

Re: New Zorro version 2.30 - 08/06/20 14:09

Originally Posted by jcl
Caused by setting an entry stop, but entering via TMF
Its pretty normal to have some initial Entry, but modified later in a tmf.
I actually needed a 'bracket' order, setting a limit via Entry and then adding a stop in a tmf. Which led to some 'great results' in backtesting, but failed in live.
Would be great if Zorro had a bracket order functionality out of the box.
Quote
This will be fixed in the next update
You mean the entry price will be correct and not 1-tick earlier (without having to set TradeEntryLimit=0 before that)?
Posted By: jcl

Re: New Zorro version 2.30 - 08/06/20 16:11

No, I meant that you can then have an entry limit and enter via TMF at the same time. Modifying limits or bracket orders have nothing to do with that.
Posted By: Zheka

Re: New Zorro version 2.30 - 08/06/20 17:39

Entering with initial Entry and modifying TradeEntryLimit in a tmf works exactly as suggested in the manual.
Quote
TradeEntryLimit
Entry limit; initially calculated from Entry. The trade will be opened when the price reaches this value. Can be modified by the TMF by setting it to the desired price (not to a distance!).
So, you mean that this tmf functionality:
Quote
return 4: Don't use Entry, Stop, or TakeProfit for automatically entering or exiting. Exit or enter only when the TMF returns 1 or 2.
will work as expected
i.e. entering a trade with "return 2" in a tmf will not conflict with a TradeEntryLimit set and will occur at the correct price?
Posted By: Zheka

Re: New Zorro version 2.30 - 08/06/20 17:40

In v 2.30.1, watch() is not recognized/ cannot be used in C++ under VS.
Posted By: Petra

Re: New Zorro version 2.30 - 08/07/20 02:09

Originally Posted by your friend the manual:
Use printf() or print(TO_WINDOW,...) instead. https://manual.zorro-project.com/dlls.htm

smile
Posted By: Zheka

Re: New Zorro version 2.30 - 08/07/20 08:54

Indeed, sorry.
Posted By: jcl

Re: New Zorro version 2.30 - 08/07/20 11:23

-Z7 behaved strange on Sep 22 2011: No, that 's intentional. Look for the details in the log. "PD" opened a short position, and "PDD" immediately closed it and opened a long position. This happens very rarely, but it can happen. You can prevent shortlived positions when you set Hedge to 5.
Posted By: hast29

Re: New Zorro version 2.30 - 08/07/20 13:26

Thank you JCL, I can not set Hedge 5, because the MT4 (or borker) does not support partial position closing. I have Hedge 4 though. Nevertheless, good that you checked, the short live positions do not bother me. I was afraid, there is some serious issue/mistake in the new release of Z7. Cheers, Jaroslav
Posted By: Grat

Re: New Zorro version 2.30 - 08/09/20 18:51

I found problem with version laugh .
During install I don't see any information which version I instaled.
All is "Zorro_230" - but no info about updates.
Posted By: jcl

Re: New Zorro version 2.30 - 08/10/20 14:20

That's true. The installation software knows the version number, but there's apparently no place where it is displayed.

The latest version, 2.30.5, contains a new MQL5 library that supports 64-bit order tickets. This supposedly fixes the longstanding problem of a certain broker whose MT5 order tickets exceed the int size.
Posted By: Zheka

Re: New Zorro version 2.30 - 08/11/20 15:49

sftoa (1,1) returns 1.0
sftoa(1.0,1) returns 1.0

while sftoa(2,1) correctly returns 2
Posted By: danatrader

Re: New Zorro version 2.30 - 08/12/20 13:01

plot (string Name, var Value, int Type, int Color) accepts non-string values for "string Name" resulting in (potentially) unhappy plots.
Posted By: Grat

Re: New Zorro version 2.30 - 08/13/20 10:47

Other appoitment for setup file.
Is a possible update without data in history? I have verificate history data, but after update I must run verificate again. frown
Posted By: jcl

Re: New Zorro version 2.30 - 08/13/20 11:04

-sftoa (1,1) returns "1.0": This is indeed a bug, and there are also other tiny inconsistencies with that function. It will be fixed, but not anymore for the current release, because the function is from a library and replacing it had side effects.

- plot(Name..) is unhappy when Name is not a string: lite-C functions indeed normally accept any 32-bit address for a string pointer. Same as above - it will be eventually fixed, but not anymore for the current release because this had to be done with most functions that use strings.

- update without data in history: EUR/USD data is included because the update is a normal installation. For avoiding that your history is overwritten, install it in a temporary folder, then copy over all folders except History.


Posted By: AndrewAMD

Re: New Zorro version 2.30 - 08/13/20 11:27

It seems a new error has crept into the release candidate.
https://opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=481209#Post481209
Posted By: danatrader

Re: New Zorro version 2.30 - 08/13/20 18:23

ScholzTax not in performance report.

if(is(INITRUN) || year(0) != year(1))
ScholzBrake = 30000;

is above the loss limit active for germans next year.

I would assume in the performance report the Tax is calculated.
Posted By: jcl

Re: New Zorro version 2.30 - 08/14/20 09:14

Pulling the scholz brake eliminates the Scholz Tax. At least that's the intention.

https://manual.zorro-project.com/performance.htm
Posted By: danatrader

Re: New Zorro version 2.30 - 08/14/20 10:01

I see, still would be good to calculate it live?
Could decide to let run longer as long as performing well?
Posted By: jcl

Re: New Zorro version 2.30 - 08/14/20 12:48

That's right, but what you see in the performance report is just an approximation by subtracting 10,000 * years from the gross profit. For the decision whether to pay tax or not, you had to really calcculate it separately for any year. This is best done by script.
Posted By: danatrader

Re: New Zorro version 2.30 - 08/14/20 20:11

Unhappy plots -->> maybe should not change that, maybe just point it out in the manual, more efficient and may not break things people already developed.
Posted By: YG8

Re: New Zorro version 2.30 - 08/19/20 11:43

I am having issues testing the Z13 system.

I still have an older version of Zorro 2.20 which I have no problem testing the system on.

I have check several times that the data is available (downloaded the resent data from Zorro), that the asset list is correct and cant find any issues. Anyone else experiancing this?

Zorro S 2.30.7
(c) oP group Germany 2020
Zorro S Subscription


Z13 .x ..PH H 4 B 0 V 1
Error 055: No bars generated
Error 047: No bars to plot
Posted By: Zheka

Re: New Zorro version 2.30 - 08/19/20 15:42

There is a bug in plot() when StartDate is set in the format YYYYMMDD.

This script:
Code
function run(){
	
	set(PLOTNOW);
		
	StartDate = 20190201; 
	EndDate   = 2020;
	
	BarPeriod = 60;

	var K=ifelse(!(Bar%120),1,0);
	
	plot("WHL",K,BARS+NEW,RED);	
}
with StartDate=2019 plots as expected (screen 1) . But when StartDate is set as StartDate=20190201, plot() drops most items to be plotted (pic 2), even after enlargement of the plot area.

The problem can be reliably replicated for Bar%120 ( nothing is plotted), but is intermittent for lower values of the divisor (e.g. 24) (and can work for GBPUSD but not for EURUSD)



Attached picture Z_plot120barBug_StartDate2019.JPG
Attached picture Z_plotKbarBug_StartDate20190201.JPG
Posted By: jcl

Re: New Zorro version 2.30 - 08/21/20 09:50

- Backtesting Z13: Yes, a wrong history was loaded. You can either rename "SPYa.t8" to "SPYb.t8", or download 2.30 again. It now contains a Z13 with the correct history name.
- Bug in plot when the StartDate is set in the format YYYYMMDD: If you cannot fix it, contact support. They'll help.
Posted By: Zheka

Re: New Zorro version 2.30 - 08/21/20 10:05

Originally Posted by jcl
- Bug in plot when the StartDate is set in the format YYYYMMDD: If you cannot fix it, contact support. They'll help.
Before I do that pls confirm that 1) this was indeed checked and/or 2) the issue in the script is obvious to you
Posted By: jcl

Re: New Zorro version 2.30 - 08/21/20 10:45

No, the issue is not obvious. I see nothing wrong at quick glance when I run your script. But if a plot does not look right, follow first the bug fixing instructions in the manual. In your case, that would be printing the plot values in the log and checking them against the plot, by zooming at a certain date if needed. If you cannot fix it this way, the final solution is getting a support ticket and asking my colleagues for help. That will always work.

If you contact support and it turns out that the issue is caused by something amiss in the manual or by a Zorro bug, we refund the support ticket of course. But I must tell that this does not happen often.



Posted By: Zheka

Re: New Zorro version 2.30 - 08/21/20 11:12

jcl, c'mon!

The script is 3 lines, and it does not plot as expected (at least on my end).
Before posting here, I do the homework: the _plot.csv file contains all the correct values and zooming into an area reveals the correctly plotted values as well.

BUT the Total view doesn't show anything, as in the pic I attached.

Can you just spend 1 min and either confirm it or not?
Posted By: jcl

Re: New Zorro version 2.30 - 08/21/20 11:36

No, I can not confirm it. You posted a trivial script that did not show me any bug or tell anything about that problem. Why must such an issue always cause discussions? You have a problem, you report it, I suggest that you contact the support - that's it. They can do a lot more than I, like checking your logs or your historical data or whatever might cause the problem. They will find it. If you do it or not is of course completely up to you.
Posted By: ozgur

Re: New Zorro version 2.30 - 08/22/20 21:22

Originally Posted by Zheka
There is a bug in plot() when StartDate is set in the format YYYYMMDD.

This script:
Code
function run(){
	
	set(PLOTNOW);
		
	StartDate = 20190201; 
	EndDate   = 2020;
	
	BarPeriod = 60;

	var K=ifelse(!(Bar%120),1,0);
	
	plot("WHL",K,BARS+NEW,RED);	
}
with StartDate=2019 plots as expected (screen 1) . But when StartDate is set as StartDate=20190201, plot() drops most items to be plotted (pic 2), even after enlargement of the plot area.

The problem can be reliably replicated for Bar%120 ( nothing is plotted), but is intermittent for lower values of the divisor (e.g. 24) (and can work for GBPUSD but not for EURUSD)



Fyi, above code seems to be working for me.

[Linked Image]
Posted By: AdamWu

Re: New Zorro version 2.30 - 08/23/20 07:46

Hi, I found this in the document:
"Multicore training is now possible with scripts located in the StrategyFolder given in Zorro.ini."

My strategy is in the StrategyFolder, but it seems not using more cpu resource(30-40%), which is the same with 2.25. What is the problem? My code is like this:
Code
function run(){
	if(is(INITRUN)) NumCores = -1;
	set(PARAMETERS+LOGFILE+PLOTNOW); //+PLOTNOW
	#ifdef USE_MONEY_MANAGEMENT
	set(PARAMETERS+FACTORS+LOGFILE);
	Capital = 2000;
	#endif
	if(Train){
		StartDate = 20190202;
		EndDate = 20200802;
		NumWFOCycles = 3;
        ...
Posted By: Petra

Re: New Zorro version 2.30 - 08/23/20 09:54

Multicore in the strategyfolder works for me. Have you tried it with the workhop5?
Posted By: AdamWu

Re: New Zorro version 2.30 - 08/28/20 06:16

I tried workshop5. CPU usage is 30-40%, no obvious improvement.
Posted By: AdamWu

Re: New Zorro version 2.30 - 08/28/20 06:20

@jcl, maybe you already know these bugs of "Zorro 2.31.1":
1. "System State: 2020-06-24 12:23 - 22.56" never change or update;
2. It stoped trading once. (around 3 days in total);
Posted By: MatPed

Re: New Zorro version 2.30 - 08/28/20 09:53

Hi all,
Modified the following lines in the ZorroFix file:
HistoryFolder = "C:\Users\matteo.pedroni\OneDrive\Trading\Zorro\HistoryNew" // folder with the price history files
StrategyFolder = "C:\Users\matteo.pedroni\OneDrive\Trading\Zorro\Strategy"


History and Strategy folders are correctly recognized, No mult-icore training with worshop 5 or 6.

Zorro S 2.30.7
Posted By: Grat

Re: New Zorro version 2.30 - 09/02/20 09:58

Zorro 2.31.xx? Exist any info about actual version?

On the web pages is only info:

Zorro 2.30 new features (released August 2020)
Posted By: jcl

Re: New Zorro version 2.30 - 09/07/20 12:14

The current beta version is 2.31.2. Multicore now also supports the StrategyFolder. This was not completely implemented in the previous version.
Posted By: MatPed

Re: New Zorro version 2.30 - 09/08/20 17:41

I have checked the Beta and multi-core training works, thank you. Unfortunately you can only include file with an absolute address i.e "c:\..." you can not include file even in the same strategy directory.

Thank You
Posted By: danatrader

Re: New Zorro version 2.30 - 09/19/20 08:25

Congratulations to the new version, especially from multitrain everybody will benefit, speed is amazing.
Posted By: MatPed

Re: New Zorro version 2.30 - 10/14/20 15:21

Originally Posted by MatPed
I have checked the Beta and multi-core training works, thank you. Unfortunately you can only include file with an absolute address i.e "c:\..." you can not include file even in the same strategy directory.

Thank You

In v2.32.9b including file with relative file address (i.e. #include "ReR\test.c" where ReR is a subdirectoty of the StrategyFolder defined in the ZorroFix file) still does not works

Are you planning to fix it or the function is intended to work as it is?

Thank You
Posted By: jcl

Re: New Zorro version 2.30 - 10/19/20 12:51

I see in our list that implementing the StrategyFolder in the include path of the C compiler is planned.
© 2024 lite-C Forums