Gamestudio Links
Zorro Links
Newest Posts
Instrument Price Zorro Chart
by felixfx. 10/19/19 20:48
Today real live account blown - my experience
by Clifford_B. 10/19/19 17:09
Building Diversified Portfolios - New Paper
by SnoopySniff. 10/18/19 16:23
Indices & metals easier to trade than FX???
by SnoopySniff. 10/18/19 10:08
What are you working on?
by txesmi. 10/17/19 07:00
Ducascopy exporter
by line7. 10/17/19 06:21
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
2 registered members (Bolle, Dooley), 656 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
VillageTalkies, line7, Shutch, Clifford_B, Paulius
18310 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 4
Page 3 of 4 1 2 3 4
Re: Dual Momentum Algorithm - The way Zorro would have done it [Re: firecrest] #468985
11/01/17 04:15
11/01/17 04:15
Joined: Sep 2017
Posts: 235
H
Hredot Offline OP
Member
Hredot  Offline OP
Member
H

Joined: Sep 2017
Posts: 235
Since I did not try live trading this script, I'm afraid I cannot help you there.
Perhaps updating Zorro as firecast suggests might help.

Re: Dual Momentum Algorithm - The way Zorro would have done it [Re: firecrest] #468993
11/01/17 16:19
11/01/17 16:19
Joined: Mar 2015
Posts: 334
Rogaland
N
Nanitek Offline
Senior Member
Nanitek  Offline
Senior Member
N

Joined: Mar 2015
Posts: 334
Rogaland
Originally Posted By: firecrest
I have the same problem previously too but it solved with the latest Zorro version 1.66.5. Not sure if your problem is the same.


I am using 1.60 but I will try with that one

Re: Dual Momentum Algorithm - The way Zorro would have done it [Re: Nanitek] #469019
11/02/17 13:59
11/02/17 13:59
Joined: Sep 2017
Posts: 235
H
Hredot Offline OP
Member
Hredot  Offline OP
Member
H

Joined: Sep 2017
Posts: 235
For some reason I cannot edit the first post any more, to make updates. Here it was pointed out that the INITRUN clause is not needed when loading Assets.csv file (probably to allow the script to load an updated list at any point in time during execution).
The use of INITRUN condition likely came from here. So to stop confusing people I dropped the INITRUN check from the script:

Quote:
Disclaimer: Use at your own risk! You alone are responsible for your gains or losses.
Dual Momentum Algorithm V1.1

Last edited by Hredot; 11/02/17 13:59.
Re: Dual Momentum Algorithm - The way Zorro would have done it [Re: firecrest] #469032
11/03/17 10:47
11/03/17 10:47
Joined: Mar 2015
Posts: 334
Rogaland
N
Nanitek Offline
Senior Member
Nanitek  Offline
Senior Member
N

Joined: Mar 2015
Posts: 334
Rogaland
Originally Posted By: firecrest
I have the same problem previously too but it solved with the latest Zorro version 1.66.5. Not sure if your problem is the same.


I used 1.66.5 and got the same problem. Did I choose the wrong assets?
The zorro window shows XXXX as price and the box is red in the zorro window but the Ib gateway is window shows green connection

Quote:




Trade: Dual_Momentum (NFA) 2017-11-02
Assets HistoryAssetsZ9.csv
Lookback period (580 bars) .

Download CSJ.US.. 2723 bars read
[638: Fri 17-11-03 04:00] (105.0500)
!Order Message:
BUY 1 XBI ARCA
Warning: your order will not be placed at the exchange until 2017-11-03 09:30:00 US/Eastern XBI-STK--0--SMART--USD
(XBI::L) Can't open 1@82.47 at 04:00:01
[SMH::L] Skipped: Lots 0
!Order Message:
BUY 2 ITB BATS
Warning: your order will not be placed at the exchange until 2017-11-03 09:30:00 US/Eastern ITB-STK--0--SMART--USD
(ITB::L) Can't open 2@39.98 at 04:00:01
!Order Message:
BUY 1 XLV ARCA
Warning: your order will not be placed at the exchange until 2017-11-03 09:30:00 US/Eastern XLV-STK--0--SMART--USD
(XLV::L) Can't open 1@81.31 at 04:00:01


Re: Dual Momentum Algorithm - The way Zorro would have done it [Re: Nanitek] #469110
11/05/17 16:41
11/05/17 16:41
Joined: Sep 2017
Posts: 235
H
Hredot Offline OP
Member
Hredot  Offline OP
Member
H

Joined: Sep 2017
Posts: 235
@Nanitek
Actually, it seems that your problem is not with the script but with operating hours of the broker. It says, the code tries to open trades at 4am in the morning. The exchange however only opens at 9:30am. That is what the error message seems to be informing you of: that your trades will only go through once the exchange opens at 9:30am.

I believe there is a flag in Zorro which you might want to search for, that restricts trading only to the hours when the exchange is open. Or perhaps you can shift the local clock on your trading computer by 5-6 hours, so that the script tries to trade after 9:30am. Hope this helps!

Last edited by Hredot; 11/05/17 16:44.
Re: Dual Momentum Algorithm - The way Zorro would have done it [Re: Hredot] #469339
11/11/17 16:48
11/11/17 16:48
Joined: Nov 2017
Posts: 34
C
Cheulmen Offline
Newbie
Cheulmen  Offline
Newbie
C

Joined: Nov 2017
Posts: 34
@Hredot, I'm getting the following error message:

Error 014: ATR needs LookBack 520 > 480

The script runs and it gets a 26% CAGR, but this error makes it a bit scary to put it live laugh

It appears a couple of times, the script I'm running is the v1.1 without any change (but it happened also in v1.0).

(Also it gave a warning about VOO not having the first 175 bars, but that warning disappears using a StartDate=2011)

Re: Dual Momentum Algorithm - The way Zorro would have done it [Re: Cheulmen] #469341
11/11/17 17:21
11/11/17 17:21
Joined: Sep 2017
Posts: 235
H
Hredot Offline OP
Member
Hredot  Offline OP
Member
H

Joined: Sep 2017
Posts: 235
@Cheulmen

I would not recommend using any script, where you do not fully understand what it does and its limitations. Testing after 2011 is very misleading, since its a period of great growth. In fact, in my personal opinion the script performs sub-optimal in the years 2008-2011. I suspect Z9 probably has similar trouble there (which is why its testing period "conveniently" starts in 2011). Long story short:

The Dual Momentum script I posted is not really intended to be traded live, but serves as a proof of concept first iteration, for others to use as a starting point and refine until you are satisfied with the performance. That would also involve figuring out all warning messages, understanding why they appear and fixing them if you think it is necessary.

Last edited by Hredot; 11/11/17 17:25.
Re: Dual Momentum Algorithm - The way Zorro would have done it [Re: Hredot] #469388
11/14/17 13:18
11/14/17 13:18
Joined: Nov 2017
Posts: 34
C
Cheulmen Offline
Newbie
Cheulmen  Offline
Newbie
C

Joined: Nov 2017
Posts: 34
Yep, that's why I was asking, I'm trying to understand... I'm not sure to grasp why the error appears, as 520 is less than two years, and the time involved is over that timeframe

Re: Dual Momentum Algorithm - The way Zorro would have done it [Re: Cheulmen] #469397
11/14/17 17:40
11/14/17 17:40
Joined: Sep 2017
Posts: 235
H
Hredot Offline OP
Member
Hredot  Offline OP
Member
H

Joined: Sep 2017
Posts: 235
Actually, in trading terms, a year is only 12*20 days, since only about 20 days a month are working days.
So two years are 24*20 = 480, which means, you could either increase the LookBack period accordingly, or alter the ATR command later in the script.

Re: Dual Momentum Algorithm - The way Zorro would have done it [Re: Hredot] #469578
11/23/17 02:11
11/23/17 02:11
Joined: Oct 2017
Posts: 36
Brazil
J
jmlocatelli Offline
Newbie
jmlocatelli  Offline
Newbie
J

Joined: Oct 2017
Posts: 36
Brazil
Very nice piece of code.
Thanks for sharing.

Looking into the script, what is this code for?

var totalSlope=0;
for(i=0;i<enterNum;i++){ // determine the overall weight of wanted assets
totalSlope=totalSlope+assetWeight[assetSorted[i]];
}

Page 3 of 4 1 2 3 4

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1