Z12 Realized P/L problem [Unresolved]

Posted By: ESR

Z12 Realized P/L problem [Unresolved] - 05/29/20 15:24

Hi All,

I have been running Zorro S with Z12 in demo account since 04/28/20 (It's 05/29/20 today) on a US based Oanda account with 50:1 leverage, FX Only and virtual hedging. Z12.84: FX PH H 5 B 0 V 3

Events:
Zorro was shut down (for testing purposes) with Trades left open on Sunday May 3rd and resumed the same day prior to markets opening for the week.
Zorro was shut down (for testing purposes) with Trades left open on Tuesday May 28th and resumed within a few minutes.
In both of these instances the open trades were resumed with no errors.

Issue
On May 29th I noticed that my Realized P/L for the brokerage account (6.40) and Zorro (3.63) didn't match. I am trying find out why by matching closed positions between my brokerage account and Zorro.

In the brokerage account the 1st Closed Trade was listed as:
Ticket Type Market Units Price Half Spread Cost Profit (USD) Commission Balance Date / Time
15 Close Trade USD/JPY 912 106.776 -0.0726 -3.76 0.00 3995.98 5/1/2020, 5:29:41 AM

When I view the Z12_demo.log the trade does not show up.

Nor do any of these trades;
19 Close Trade USD/JPY 912 106.673 -0.0598 -6.10 0.00 3989.88 5/1/2020, 8:11:50 AM
46 Close Trade USD/JPY 225 107.154 -0.0147 1.27 0.00 3989.26 5/11/2020, 4:07:01 AM
50 Close Trade USD/JPY 912 106.961 -0.0554 3.52 0.00 3992.01 5/13/2020, 4:40:05 AM
52 Close Trade USD/JPY 912 106.928 -0.0512 -0.29 0.00 3991.72 5/13/2020, 7:43:08 AM
64 Close Trade EUR/USD 2,140 1.09339 -0.1177 10.02 0.00 3999.67 5/19/2020, 12:07:08 PM
79 Close Trade USD/JPY 912 107.656 -0.0508 -1.86 0.00 3995.03 5/26/2020, 12:07:12 PM
81 Close Trade USD/JPY 50 107.657 -0.0030 -0.05 0.00 3994.98 5/26/2020, 12:07:13 PM

These are first references to Closed Trades in Z12_demo.log
[Fri 20-05-29 04:04] 4109 0 +111 9/3 1.10741/1.10942\1.10707/1.10930 -0.00014
[Fri 20-05-29 08:04] 4101 0 +103 8/4 1.10930/1.11142\1.10903/1.11027 -0.00013
{USD/JPY:BB:s76309} exit
{USD/JPY:BB:s76309} Cover 862@107.20: +4.24 at 08:04:01
Opn 107.75 Cls 107.20 Spr 0.0150000 Slp 0.00 Rol -0.08 Com 0.00 Net -862
[USD/JPY:NET:S00083] Cover 862@107.20: +3.63 at 08:04:01
Opn 107.67 Cls 107.20 Spr 0.0120000 Slp 0.00 Rol -0.03 Com 0.00 Net -862

Not sure why the Cover for 862@107.20 shows up twice with different P/L's. The brokerage account shows;
90 Close Trade USD/JPY 862 107.199 -0.0523 3.66 0.00 3996.26 5/29/2020, 4:04:01 AM
There is no trade with a P/L of 4.24


What am I missing? Should the Closed Trades show up in Z12_demo.log? If not where would they be? They don't show up in Z12_pnl.csv. That file only shows that trades from the test period.

Lastly, the Trade Period field does not seem correct in the Z12.htm web page.
It shows:Trade period 2020-05-28..2020-05-29
When it should show: 2020-04-28..2020-05-29


Note: All of the Open Positions are accurate between Zorror and the brokerage account.

Thank you in advance for any help!

~eric
Posted By: danatrader

Re: Z12 Realized P/L problem - 05/30/20 00:11

https://zorro-trader.com/manual/en/log.htm

{} are phantom trades and should not show up on the broker

Not sure why the Cover for 862@107.20 shows up twice with different P/L's. <<-- Hedging 5, updates open positions to the new value the newly triggered trade would have in other hedge mode.

[] <- only those are executed trades.
Posted By: ESR

Re: Z12 Realized P/L problem - 06/01/20 14:27

Update:

As for the closed trades issue I found that all of the open trades are showing up properly and the closed trades show up properly in the demo_trades.csv file.

However, the web status page and zorro panel do not reflect the correct numbers for closed trades.

On the web status page Trade period 2020-05-28..2020-06-01

As such the page only references one closed trade that took place on the 28th of May.

The Trade period should show: 2020-04-28.2020-06-01

How can this be adjusted?
Posted By: ESR

Re: Z12 Realized P/L problem - 06/01/20 14:31

Ah! I see. Thank you danatrader,

Does the algorithm provide a reason why they were phantom trades? They would normally only be phantom trades due to equity curve trading or would trade balance/leverage also cause a phantom trade?
Posted By: danatrader

Re: Z12 Realized P/L problem - 06/01/20 19:31

https://zorro-trader.com/manual/en/trademode.htm

Phantom trades are used for equity curve trading, for Virtual Hedging, or for both.

And the online manual for "Hedge":

Hedge
Hedging behavior; determines how simultaneous long and short positions with the same asset are handled.
Range:
0 No hedging; automatically closes opposite positions with the same asset when a new position is opened (NFA compliant; default for NFA accounts).
1 Hedging across algos; automatically closes opposite positions with the same algo when a new position is opened (not NFA compliant in multi-algo systems; default for non-NFA accounts).
2 Full hedging; long and short positions even with the same algo can be open at the same time (not NFA compliant).
4 Virtual hedging without partial closing. Long and short positions can be open simultaneously, but only the net position is open in the broker account. Phantom trades immediately trigger the opening or closing of corresponding pool positions. NFA and FIFO compliant. Zorro S required.
5 Virtual hedging with partial closing and pooling. Phantom trades in the run function are collected and result in a single pool trade. Intrabar phantom trades trigger pool trades immediately. Open pool positions are partially closed to match the net amount. NFA and FIFO compliant. Zorro S required.
Posted By: ESR

Re: Z12 Realized P/L problem - 06/01/20 20:23

Thanks danatrader, I hadn't thought about the virtual hedging aspect of phantom trades. It's very cool...

As of right now the only remaining issue for this post is:

On the Trading Status web page Trade period shows 2020-05-28..2020-06-01 (the last day that I stopped and restarted Zorro)

As such the page only references one closed trade that took place on the 28th of May (not the other 8 trades that occurred) and of course the rest of the trade statistics are incorrect because of this.

The Trade period should show: 2020-04-28.2020-06-01

How can this be adjusted?
© 2024 lite-C Forums