Gamestudio Links
Zorro Links
Newest Posts
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, Ayumi, Quad, PeWi), 488 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Incorrect profit for NET trades (1.26) #448539
02/10/15 04:41
02/10/15 04:41
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
Please look at the attached log file which I produced by [Trade]ing a strategy for several days. The strategy uses several assets and algos, and has Hedge = 4. The surprising parts are that trades are immediately exited at the same price as the entry, and the associated profit is exactly 1 or 3 thousand dollars.
Code:
...
[USD/JPY:NET:S8266] Short 1@119.07 Net trade at 23:00
[USD/JPY:NET:S0001] Cover 1@119.07: +1000$ at 23:00
...
[USD/JPY:NET:S7637] Short 3@118.66 Net trade at 09:25
[USD/JPY:NET:S0001] Cover 3@118.66: +3000$ at 09:25
...


Currently the Result Window reports numbers like "49191 +7073 +20 ////\\" but I believe $7000 of the Money earned, "+7073", is not correct. If it were correct, the Current equity in the demo account would be closer to 56000. Also attached screenshot.

What's going on here?

Attached Files
NET_bug.png (71 downloads)
Re: Incorrect profit for NET trades (1.26) [Re: GPEngine] #448540
02/10/15 04:43
02/10/15 04:43
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
attached log

Attached Files
white1440demo.log.txt (4 downloads)
Re: Incorrect profit for NET trades (1.26) [Re: GPEngine] #448541
02/10/15 04:59
02/10/15 04:59
Joined: Apr 2014
Posts: 482
Sydney, Australia
B
boatman Offline
Senior Member
boatman  Offline
Senior Member
B

Joined: Apr 2014
Posts: 482
Sydney, Australia
I can report similar behavior after manually closing a trade opened by Zorro or otherwise manually trading on the account on which Zorro is operating.

I don't have the log files to back it up, but it has happened at least twice in 2015.

Re: Incorrect profit for NET trades (1.26) [Re: boatman] #448546
02/10/15 08:11
02/10/15 08:11
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
Interesting. Thanks. Let me look in that direction.

I manually closed a position or two in January after I changed the strategy I was testing. I have not opened or closed any trades manually since starting the current session of [Trade], meaning the beginning of the attached log.

I checked the all-time report generated by the FXCM client application. I did find one surprising thing. There are 3 open USD/JPY positions, 2 open EUR/JPY positions, and open 2 CAD/JPY positions. I guess FXCM Demo accounts don't enforce NFA Compliance Rule 2-43(b)? Either way, Zorro shouldn't be able to get the account into this state, as I have set(NFA) and Hedge=4.
AUD/JPY 5,000 2/9/15 4:25 AM
AUD/NZD 20,000 2/8/15 6:00 PM
CAD/JPY 18,000 2/8/15 6:00 PM
CAD/JPY 7,000 2/6/15 4:25 AM
EUR/JPY 1,000 2/3/15 4:25 AM
EUR/JPY 2,000 2/4/15 4:25 AM
GBP/JPY 4,000 2/9/15 4:25 AM
NZD/JPY 16,000 1/27/15 4:25 AM
USD/JPY 1,000 2/8/15 6:00 PM
USD/JPY 2,000 2/8/15 6:00 PM
USD/JPY 3,000 2/9/15 4:25 AM

Is it possible that this Zorro instance has become confused about the open positions in the account? Is there a way to force a re-sync? Or is there a way to list the valid ones associated with this running strategy so that I may close the rogue ones manually?

By the way, http://zorro-trader.com/manual/en/heding.htm is an outdated page that should be deleted. The NFA page links to it in error.

Re: Incorrect profit for NET trades (1.26) [Re: GPEngine] #448548
02/10/15 08:42
02/10/15 08:42
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
I can not see what problem you have with the open positions, but there is indeed a problem with the two closed positions. Can you check the two trades that had a wrong closing message - ID ending with 8266 and 7637? When and at which price were they really closed?

Re: Incorrect profit for NET trades (1.26) [Re: jcl] #448550
02/10/15 08:54
02/10/15 08:54
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
Perhaps I do not know how to read this report.
There is a section of Combined Account Statement called OPEN/FLOATING POSITIONS
IDs 115798266 and 115827637 appear in it. So they are open, not closed.

Ticket # Symbol Volume Date Sold Bought Floating P/L Comm Dividends Rollover Net P/L Condition

115798266 USD/JPY 1,000 2/8/15 6:00 PM 119.059 2.75 -0.04 0.00 -0.03 2.68 Mkt
2/10/15 3:49 AM 118.733

115827637 USD/JPY 3,000 2/9/15 4:25 AM 118.656 -1.95 -0.12 0.00 -0.08 -2.15 Mkt
2/10/15 3:49 AM 118.733


Last edited by GPEngine; 02/10/15 08:54.
Re: Incorrect profit for NET trades (1.26) [Re: GPEngine] #448551
02/10/15 08:59
02/10/15 08:59
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
Code:
OPEN/FLOATING POSITIONS   
Ticket # Symbol Volume Date Sold Bought Floating P/L Comm Dividends Rollover Net P/L Condition
114952070 NZD/JPY 16,000 1/27/15 4:25 AM 87.891   -33.96 -0.96 0.00 -27.19 -62.11 Mkt
115556725 EUR/JPY 2,000 2/4/15 4:25 AM 134.528   1.68 -0.08 0.00 0.01 1.61 Mkt
115742327 CAD/JPY 7,000 2/6/15 4:25 AM   94.258 49.35 -0.42 0.00 0.24 49.17 Mkt
115798257 AUD/NZD 20,000 2/8/15 6:00 PM   1.05685 -88.20 -1.20 0.00 -0.84 -90.24 Mkt
115798259 CAD/JPY 18,000 2/8/15 6:00 PM   95.096 -0.15 -1.08 0.00 0.43 -0.80 Mkt
115798266 USD/JPY 1,000 2/8/15 6:00 PM 119.059   2.75 -0.04 0.00 -0.03 2.68 Mkt
115798383 EUR/JPY 1,000 2/3/15 4:25 AM 132.988   -12.13 -0.04 0.00 0.00 -12.17 Mkt
115827632 AUD/JPY 5,000 2/9/15 4:25 AM   92.408 9.14 -0.30 0.00 0.34 9.18 Mkt
115827634 GBP/JPY 4,000 2/9/15 4:25 AM 180.750   -7.38 -0.16 0.00 -0.29 -7.83 Mkt
115827637 USD/JPY 3,000 2/9/15 4:25 AM 118.656   -1.95 -0.12 0.00 -0.08 -2.15 Mkt
115827744 USD/JPY 2,000 2/8/15 6:00 PM 119.065   5.59 -0.08 0.00 -0.05 5.46 Mkt


Re: Incorrect profit for NET trades (1.26) [Re: GPEngine] #448553
02/10/15 09:28
02/10/15 09:28
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Ok, so the "Cover" message was definitely wrong - not only wrong profit, the position was not closed at all. The cover message also had an imaginary id of 0001.

Can you post the script? You can also send it to Support when you don't want it public. We'll look into it. Due to the wrong message, the displayed accumulated profit is likewise wrong.

Update: I believe we found the problem. It was indeed related to the NFA flag. We'll upload a new version, 1.28.1, to the beta forum in the next days. Please continue with that version. And check if you really have an NFA account: if you can manually open a short and long position at the same time, it is not NFA.

Re: Incorrect profit for NET trades (1.26) [Re: jcl] #448576
02/11/15 06:10
02/11/15 06:10
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
I cannot share the Strategy. All I can say is that it is similar to Workshop 6.

Let's see if this helps anyway.
Since it was time to do system updates on the VPS anyway, I pressed Stop & clicked no for close all trades. and rebooted. When I pressed [Trade] again on the same Strategy, Zorro crashed at start-up. The error reporting dialog had this body. The crash is reproducible.
Code:
Problem signature:
  Problem Event Name: APPCRASH
  Application Name: Zorro.exe
  Application Version:  1.2.4.5
  Application Timestamp:  5418366c
  Fault Module Name:  Zorro.exe
  Fault Module Version: 1.2.4.5
  Fault Module Timestamp: 5418366c
  Exception Code: c0000005
  Exception Offset: 00123031
  OS Version: 6.3.9600.2.0.0.272.7
  Locale ID:  1033
  Additional Information 1: 5861
  Additional Information 2: 5861822e1919d7c014bbb064c64908b2
  Additional Information 3: a10f
  Additional Information 4: a10ff7d2bb2516fdc753f9c34fc3b069


log file has only this.
Quote:
Trade: white1440 portfolio (NFA) 10.02.2015
Trade 0 not found
Trade 1 not found
Trade 2 not found
Trade 3 not found
CNTR0011 Trade 4 not found
Trade 5 not found
Trade 6 not found
Trade 7 not found
Trade 8 not found
Trade 9 not found
Trade 10 not found
Trade 11 not found
AUD/JPY Trade 12 not found

I held on to the previous log file as well.

To possibly help you further, I created a new demo account and began the same strategy again on it. Obviously there are no open positions in this one. I will let you know if Zorro gets confused again. My working theory is that there were some leftover trades in the account when I started this session. And, Zorro was unable to detect and recover from this broken state.

Last edited by GPEngine; 02/11/15 06:22.
Re: Incorrect profit for NET trades (1.26) [Re: GPEngine] #448577
02/11/15 06:45
02/11/15 06:45
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
Oops i did not see your in-place update.

This FXCM demo account has NFA compliance. I just tried your instructions. In FXCM Trading Station App, I was not able to open two opposite positions in the same currency. The 2nd trade caused the first one to be closed, resulting in a single open position with size being the sum of the two requested positions. (-13 + 17 = 4)

I will await beta version. Can you offer more details about the nature of the code fault?

Page 1 of 2 1 2

Moderated by  Petra 

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