Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (Quad, AndrewAMD), 1,007 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: Too good to be true? Help me poke holes in it please [Re: dusktrader] #426396
07/22/13 19:38
07/22/13 19:38
Joined: Nov 2012
Posts: 126
B
blaub4r Offline
Member
blaub4r  Offline
Member
B

Joined: Nov 2012
Posts: 126
If you put the optimize in the else block it won't work as you have to call optimize at every run call, you are not allowed to skip any.
That's what this error is about.
You have to do the optimize calls before the if-else block.

Re: Too good to be true? Help me poke holes in it please [Re: blaub4r] #426411
07/22/13 20:55
07/22/13 20:55
Joined: Jul 2013
Posts: 522
D
dusktrader Offline OP
User
dusktrader  Offline OP
User
D

Joined: Jul 2013
Posts: 522
Thanks blaub4r, that explains the error then. I don't actually want that as the trade close, I was just cutting corners...

Working on the close now. I'm trying to put a exitShort() or exitLong() preceding each entry command (to close all trades in opposite signal direction) but that doesnt seem to be working right either. I'll keep plugging at this.

Btw acidburn... IMO the OptimalF feature of Zorro is one of the BEST parts about this platform. So I hope to become an expert with that one of these days!!

Re: Too good to be true? Help me poke holes in it please [Re: dusktrader] #426413
07/22/13 21:05
07/22/13 21:05

A
acidburn
Unregistered
acidburn
Unregistered
A



Originally Posted By: dusktrader
Thanks blaub4r, that explains the error then. I don't actually want that as the trade close, I was just cutting corners...

Working on the close now. I'm trying to put a exitShort() or exitLong() preceding each entry command (to close all trades in opposite signal direction) but that doesnt seem to be working right either. I'll keep plugging at this.


That is because enterShort() will automatically close all open longs, and same for enterLong(). Unless you're using HEDGING mode, and from what I see, you're not.

Originally Posted By: dusktrader
Btw acidburn... IMO the OptimalF feature of Zorro is one of the BEST parts about this platform. So I hope to become an expert with that one of these days!!


That's great news! Because by the time I get there, I'll have an expert advisor to answer my rookie questions. tongue

Jokes aside, keep up the good work. I agree there is some great stuff in Zorro that I'm yet to discover. I'm also reading some books right now and also can't believe how much stuff is there yet to learn. And the day still ends after 24h, damn. mad

Re: Too good to be true? Help me poke holes in it please [Re: ] #426448
07/23/13 10:19
07/23/13 10:19
Joined: Jul 2013
Posts: 522
D
dusktrader Offline OP
User
dusktrader  Offline OP
User
D

Joined: Jul 2013
Posts: 522
Thanks acidburn, I think you're right -- since I am using the NFA flag, it probably means the exitShort() and exitLong() upon new signal is flawed... I will keep studying this.

In the meantime, I just noticed this... take a look at this picture. Can anyone explain why it seems that Zorro "forgot" to trail on a handful of trades here? On other trades it seems to have worked correctly.

Attached Files Selection_027.png
Re: Too good to be true? Help me poke holes in it please [Re: ] #426449
07/23/13 10:25
07/23/13 10:25
Joined: Apr 2013
Posts: 57
3
3DCat Offline
Junior Member
3DCat  Offline
Junior Member
3

Joined: Apr 2013
Posts: 57
Do you still get those results? Because i could not replicate them with your script.

I understand you're using different Data and/or Broker. Perhaps the problem lies there.
I did a script a while ago that made 18000%. The error was Zorro was trading when the market was closed - because i switched assets in the function. Thus the tradinghours of the asset i was trading were out of sync.
Just a thought - perhaps the problem lies in the same general direction:)

Re: Too good to be true? Help me poke holes in it please [Re: 3DCat] #426478
07/23/13 13:39
07/23/13 13:39
Joined: Jul 2013
Posts: 522
D
dusktrader Offline OP
User
dusktrader  Offline OP
User
D

Joined: Jul 2013
Posts: 522
Hi 3DCat, I'm using the default Zorro data (and I actually reset it this morning to be extra sure). However, I do have it set with my IBFX Assets file, so I will go back and double check this with all the Zorro defaults.

I did a little more digging on this. It seems that the strange behavior happens only on the Trend trading section, which uses a stop of up to 8 * ATR(100), depending on optimization.

Here is the relevant code section for this (note it is from Workshop 6_2, I only added the OptimalF conditions):
Code:
function tradeTrend()
{
	vars Price = series(price());
	vars Trend = series(LowPass(Price,optimize(250,100,1000)));

	Stop = optimize(4,2,8) * ATR(100);
	Trail = 0;
 
	if(valley(Trend) && OptimalFLong > 0) //long setup, known profitable
	{
		// reinvest the square root of profits
		//var MarginLong = sqrt(WinLong-LossLong)*OptimalFLong;
		//Margin = clamp(MarginLong, 5, 100); //max $1000 per trade

		enterLong();
	}
	
	else if(peak(Trend) && OptimalFShort > 0) //short setup, known profitable
	{
		// reinvest the square root of profits
		//var MarginShort = sqrt(WinShort-LossShort)*OptimalFShort;
		//Margin = clamp(MarginShort, 5, 100); //max $1000 per trade

		enterShort();
	}
}



I'm attaching here also a screenshot showing AUDUSD with all CNTR-trend filtered out, and plotting the ATR(100). This seems to indicate a problem where Zorro somehow "forgot" to close some trailed trades.

Next I will check the default Zorro data and Assets, and then dig deeper into the actual trade-by-trade to see if I can spot the specific offending trades.

Attached Files Workshop6_2_dusktrader_AUDUSD_TRND.png
Re: Too good to be true? Help me poke holes in it please [Re: dusktrader] #426480
07/23/13 14:26
07/23/13 14:26
Joined: Jul 2013
Posts: 522
D
dusktrader Offline OP
User
dusktrader  Offline OP
User
D

Joined: Jul 2013
Posts: 522
I wanted to report back that this does seem to be related to the Assets file again. I know there are some fixes for this in 1.13 coming. Meanwhile, I will continue to try to narrow down irregularities related to this.

When I tell Zorro to use its default Assets, I get a completely different result. I then told it to use the IBFX assets simulated for microlot account (instead of nanolot). That gave similar results, which are presumably "more correct".

I want to dig in deeper on this, and see if I can find any more instances of the Trailing stop issue. It could be that all of the issues are related to the nanolots situation.

Re: Too good to be true? Help me poke holes in it please [Re: dusktrader] #426522
07/24/13 09:16
07/24/13 09:16
Joined: Jul 2000
Posts: 27,935
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,935
Frankfurt
If you post the content of the assetsfix.dta from your nanolot account here, I can probably see if there's something wrong with the account parameters.

Re: Too good to be true? Help me poke holes in it please [Re: jcl] #426527
07/24/13 09:48
07/24/13 09:48
Joined: Jul 2013
Posts: 522
D
dusktrader Offline OP
User
dusktrader  Offline OP
User
D

Joined: Jul 2013
Posts: 522
Here you go. These are the 2 Asset files I'm working with. The one labeled "mini 6-digit precision" is the most correct Asset file that matches my account (nanolot). That is the one that produces the abnormal high returns.

The other one labeled "IBFX1000" is also correct, except that I've increased the lot to make it essentially a microlot account. I'm currently testing with this variety to see if Zorro will exhibit any abnormal-looking issues like the Trail issue I discussed above.

Attached Files
Assets.zip (39 downloads)
Re: Too good to be true? Help me poke holes in it please [Re: dusktrader] #426529
07/24/13 10:10
07/24/13 10:10
Joined: Jul 2000
Posts: 27,935
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,935
Frankfurt
The asset files are ok. But I see the reason of the problem. The rollover is calculated for micro lots, not for nano lots. So you have ten times the normal rollover. Combined with the fact that your trades never close, you'll get a crazy rollover gain.

This is a Zorro bug - it will be fixed in the next update. Until then, set RollLong/Short to 0 for testing your strategies. This will probably give you a totally different but realistic result.

Page 2 of 3 1 2 3

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1