1 registered members (degenerate_762),
1,114
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: One Night Stand System
[Re: RTG]
#454844
09/25/15 01:32
09/25/15 01:32
|
Joined: Feb 2014
Posts: 181
RTG
OP
Member
|
OP
Member
Joined: Feb 2014
Posts: 181
|
It looks like the script has stopped worki. Pending trades do not setup as previously on a Friday.
Anyone know why this would be the case?
Last edited by RTG; 09/25/15 14:18.
|
|
|
Re: One Night Stand System
[Re: RTG]
#455118
10/10/15 13:24
10/10/15 13:24
|
Joined: Dec 2013
Posts: 568 Fuerth, DE
Sphin
User
|
User
Joined: Dec 2013
Posts: 568
Fuerth, DE
|
As yet I haven't worked out why the script stopped setting up the pending entry stop levels on Friday This is from a Z-Systems-Thread but I think it is related to the system discussed in here. 1. What code of the system in detail you are trading live? 2. "Stopped setting up entry stop levels" means that Zorro does not open trades at a certain level but as market orders or how does Zorro behave? 3. What Zorro version do you use and did you change it during trading?
|
|
|
Re: One Night Stand System
[Re: Sphin]
#455139
10/10/15 23:36
10/10/15 23:36
|
Joined: Feb 2014
Posts: 181
RTG
OP
Member
|
OP
Member
Joined: Feb 2014
Posts: 181
|
1. I will paste the code at the bottom of this post.
2. Zorro used to setup the entry stop levels every Friday as one would expect. Ie the console would display something like “USD/CHF entry long stop @ 1.05” and do this for all assets at 12am Friday UTC time. From there it would wait until price crossed these thresholds, then it would enter (or not if price didn’t cross the threshold).
Since the crash and installation of version 1.34, it will not do this unless a smaller bar period is used. It works on bar periods from 1 minute to 720 minutes but not at 1440 minutes (which is what the trading system requires).
3. It was working under the previous Zorro version which was 1.32 I believe. After the vps crash I upgraded to 1.34. I can't say if the issue is connected to 1.34.
Here is the code I tried on Friday using 30 minute bars in an attempt to get it to setup properly once again.
include <profile.c>
function tradeOneNightStand() { TimeFrame = 48; vars Price = series(price()); vars SMA10 = series(SMA(Price, 10)); vars SMA40 = series(SMA(Price, 40));
set(PARAMETERS+FACTORS); Margin = 0.02 * (Capital + WinTotal-LossTotal);
//Stop = 150 * PIP;
var BuyStop,SellStop;
BuyStop = HH(10) + 1*PIP; SellStop = LL(10) - 1*PIP;
if (dow() == 5 && NumOpenLong == 0 && NumPendingLong == 0 && SMA10[0] > SMA40[0]) enterLong(0,BuyStop); else if (dow() == 5 && NumOpenShort == 0 && NumPendingShort == 0 && SMA10[0] < SMA40[0]) enterShort(0,SellStop);
if (dow() != 5 && dow() != 6 && dow() != 7){ exitLong(); exitShort();
} } //split oil asset from currencies because of outsized positions function tradeOil(){ TimeFrame = 48; asset("USOil"); vars Price = series(price()); vars SMA10 = series(SMA(Price, 10)); vars SMA40 = series(SMA(Price, 40));
set(PARAMETERS+FACTORS);
Margin = 0.005 * (Capital + WinTotal-LossTotal);
//Stop = 150 * PIP;
var BuyStop,SellStop;
BuyStop = HH(10) + 1*PIP; SellStop = LL(10) - 1*PIP;
if (dow() == 5 && NumOpenLong == 0 && NumPendingLong == 0 && SMA10[0] > SMA40[0]) enterLong(0,BuyStop); else if (dow() == 5 && NumOpenShort == 0 && NumPendingShort == 0 && SMA10[0] < SMA40[0]) enterShort(0,SellStop);
if (dow() != 5 && dow() != 6 && dow() != 7 ){ exitLong(); exitShort();} }
function run() {
LookBack = 40*48; Verbose = 14; BarPeriod = 30; StartDate = 2005; Capital = 50000; // NumWFOCycles = 3;
// method 2: invest the square root of the total profit // Margin = OptimalF * Capital * sqrt(1 + max(0,WinTotal-LossTotal)/Capital);
//while(asset(loop("AUD/CAD","USD/SEK","USD/JPY","USD/HKD","USD/CNH","USD/CHF","USD/CAD","NZD/USD","NZD/JPY","GBP/USD", //"GBP/NZD","GBP/JPY","GBP/CHF","GBP/CAD","GBP/AUD","EUR/USD","EUR/JPY","EUR/GBP","EUR/CHF","EUR/CAD", //"EUR/AUD","CHF/JPY","CAD/JPY","AUD/USD","AUD/NZD","AUD/JPY")))
while(asset(loop("USD/CHF","USD/JPY","GBP/USD","EUR/USD","EUR/JPY","USD/CAD"))) { tradeOneNightStand(); } tradeOil();
//ColorUp = 0; //ColorDn = 0; //ColorEquity = 0; //plotTradeProfile(20); //plotMAEGraph(-1); //plotPriceProfile(10,0); //plotQuarterProfit(); //plotMonthProfit(); plotMonthProfit(); }
|
|
|
Re: One Night Stand System
[Re: RTG]
#455149
10/11/15 12:02
10/11/15 12:02
|
Joined: Dec 2013
Posts: 568 Fuerth, DE
Sphin
User
|
User
Joined: Dec 2013
Posts: 568
Fuerth, DE
|
"set" can be used in a single function? Nice, I thought it could be used in the run() and once only. In my Zorro (1.36.4 - and the .4 meanwhile is important because each version shows, if only slightly but different results) setting BarPeriod to 1440 (and omit TimeFrame of course) works and let the strategy doing as expected. Involving LOGFILE flag shows trades like:
[42: Fri 04.03.05 00:00] 1.3137-1.3166-1.3098-1.3114
(USD/CHF::S) Short 20@1.1571 Entry stop
(USD/JPY::L) Long 100@105.91 Entry stop
(GBP/USD::L) Long 71@1.9266 Entry stop
(EUR/USD::L) Long 100@1.3282 Entry stop
(GBP/USD::L) Entry stop 1.9266 hit at 00:00
[GBP/USD::L4314] Long 71@1.9266 at 00:00
[43: Mon 07.03.05 00:00] 1.30880-1.32560 +0 -161 0/1
Monday 07.03.05 Loss -161$ ----
(USD/CHF::S) Missed entry 1.1571 at exit command
(USD/JPY::L) Missed entry 105.91 at exit command
[GBP/USD::L4314] Sell 71@1.9241: -161$ at 00:00
(EUR/USD::L) Missed entry 1.3282 at exit command
There are only trades in assets that are known to AssetsFix.dta, the default one (that I use) therefore trades only these 4 assets in the log. Using a TimeFrame has 2 important impacts here to the trades, first it does not use 00:00 for the entry stops but any time I guess maybe resulting from the time of starting the strategy and shifted 48 times in the future or similar, and the second one is more important: TimeFrame keeps EntryTime untouched, so the entry stops are only valid for the time of the BarPeriod, here: 30 minutes. These facts are also revealed by the log:
[7440: Fri 12.08.05 04:00] 1.2464-1.2465-1.2461-1.2464
(USD/CHF::S) Short 20@1.2451 Entry stop
(USD/JPY::L) Long 100@112.81 Entry stop
(GBP/USD::L) Long 71@1.8140 Entry stop
(EUR/USD::L) Long 100@1.2479 Entry stop
[7441: Fri 12.08.05 04:30] 1.24580-1.24680 +0 +0 0/0
(USD/CHF::S) Missed entry 1.2451 after 1 bar
(USD/JPY::L) Missed entry 112.81 after 1 bar
(GBP/USD::L) Missed entry 1.8140 after 1 bar
(EUR/USD::L) Missed entry 1.2479 after 1 bar
To avoid this I guess you can synchronise the TimeFrame with frameSync() and increase the EntryTime accordingly. But I think it's really easier to use BarPeriod = 1440.
|
|
|
|