Gamestudio Links
Zorro Links
Newest Posts
rMomentum always returns 0 when checking for peak/valley
by jcl
Today at 17:38
a little help here?
by 3run
Today at 16:38
How to set a pair trading order right
by jcl
Today at 11:46
Dual Momentum Algorithm - The way Zorro would have done it
by Hredot
Today at 05:21
HIgh FRequency Trading Script -- Highly Profitable
by Yosh
Yesterday at 19:27
Linear Regression in objective function
by jcl
11/22/17 15:40
MT4 vs Zorro
by pascalx
11/22/17 14:00
AUM Magazine
Latest Screens
RPG PARTY
Triton Wing now available on Steam
AckCon'17: Lotter vs The World
Triton Wing
Who's Online
14 registered (Lobo, Hredot, painkiller, 3run, alibaba, Kartoffel, FLD, RealSerious3D, Jerome8911, 1 invisible), 169 Guests and 4 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
ech87, Lobo, Andy60, AzzoCorp, franzz
17813 Registered Users
Page 3 of 4 < 1 2 3 4 >
Topic Options
Rate This Topic
#468985 - 11/01/17 05:15 Re: Dual Momentum Algorithm - The way Zorro would have done it [Re: firecrest]
Hredot Online
Junior Member

Registered: 09/11/17
Posts: 95
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.

Top
#468993 - 11/01/17 17:19 Re: Dual Momentum Algorithm - The way Zorro would have done it [Re: firecrest]
Nanitek Offline
Senior Member

Registered: 03/25/15
Posts: 327
Loc: 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

Top
#469019 - 11/02/17 14:59 Re: Dual Momentum Algorithm - The way Zorro would have done it [Re: Nanitek]
Hredot Online
Junior Member

Registered: 09/11/17
Posts: 95
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


Edited by Hredot (11/02/17 14:59)

Top
#469032 - 11/03/17 11:47 Re: Dual Momentum Algorithm - The way Zorro would have done it [Re: firecrest]
Nanitek Offline
Senior Member

Registered: 03/25/15
Posts: 327
Loc: 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


Top
#469110 - 11/05/17 17:41 Re: Dual Momentum Algorithm - The way Zorro would have done it [Re: Nanitek]
Hredot Online
Junior Member

Registered: 09/11/17
Posts: 95
@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!


Edited by Hredot (11/05/17 17:44)

Top
#469339 - 11/11/17 17:48 Re: Dual Momentum Algorithm - The way Zorro would have done it [Re: Hredot]
Cheulmen Offline
Newbie

Registered: 11/09/17
Posts: 19
@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)

Top
#469341 - 11/11/17 18:21 Re: Dual Momentum Algorithm - The way Zorro would have done it [Re: Cheulmen]
Hredot Online
Junior Member

Registered: 09/11/17
Posts: 95
@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.


Edited by Hredot (11/11/17 18:25)

Top
#469388 - 11/14/17 14:18 Re: Dual Momentum Algorithm - The way Zorro would have done it [Re: Hredot]
Cheulmen Offline
Newbie

Registered: 11/09/17
Posts: 19
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

Top
#469397 - 11/14/17 18:40 Re: Dual Momentum Algorithm - The way Zorro would have done it [Re: Cheulmen]
Hredot Online
Junior Member

Registered: 09/11/17
Posts: 95
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.

Top
#469578 - Yesterday at 03:11 Re: Dual Momentum Algorithm - The way Zorro would have done it [Re: Hredot]
jmlocatelli Offline
Newbie

Registered: 10/12/17
Posts: 5
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]];
}

Top
Page 3 of 4 < 1 2 3 4 >



Gamestudio download | chip programmers | Zorro platform | shop | resources | magazine | manual | support faq | bugs

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) 3dgamestudio.net