2 registered members (AndrewAMD, juanex),
1,247
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Multiple broker connection - beta testers wanted!
[Re: jcl]
#470428
01/14/18 11:59
01/14/18 11:59
|
Joined: Dec 2013
Posts: 568 Fuerth, DE
Sphin
User
|
User
Joined: Dec 2013
Posts: 568
Fuerth, DE
|
I fear it was not or not completely. But the differences have been moved to PriceA/Asset_A compared to the previous version and sometimes the values are equal.
V 1.745 on Sun 18-01-14 11:43:05
Test: BA_BTC_A_B (TICKS) 2018
Assets AssetsArb.csv
PriceA: 13842.00000, PriceB: 14353.00000, Difference: -511.00000
[Asset_A::L0101] Long 10@13405.00000 at 00:00:01
[Asset_B::S0102] Short 1@14353.00000 at 00:00:01
[1: Tue 18-01-02 01:00:00] 0000 -93.73 1/1 (14353.00)
[2: Tue 18-01-02 02:00:00] 0000 +421 2/0 (13719.20)
PriceA: 13592.00000, PriceB: 13591.50000, Difference: 0.50000
[Asset_A::L0101] Sell 10@13592.00: +12.40 at 02:52:58
[Asset_B::S0102] Cover 1@13591.40: +509 at 02:52:58
[3: Tue 18-01-02 03:00:00] 522 0 2/0 (13605.60)
[4: Tue 18-01-02 04:00:00] 522 0 2/0 (13412.70)
PriceA: 13071.00000, PriceB: 13412.70020, Difference: -341.70020
[Asset_A::L0501] Long 10@13343.00000 at 04:00:01
[Asset_B::S0502] Short 1@13412.70020 at 04:00:01
[5: Tue 18-01-02 05:00:00] 522 +10.27 3/1 (13204.70)
[6: Tue 18-01-02 06:00:00] 522 -8.10 3/1 (13231.90)
PriceA: 13293.00000, PriceB: 13231.90039, Difference: 61.09961
[Asset_A::L0501] Sell 10@13116.00: -29.00 at 06:00:01
[Asset_B::S0502] Cover 1@13231.90: +20.90 at 06:00:01
[...]
[18: Tue 18-01-02 18:00:00] 514 0 3/1 (13964.50)
PriceA: 14648.00000, PriceB: 13964.40039, Difference: 683.59961
[Asset_A::S1901] Short 10@13914.00000 at 18:00:01
[Asset_B::L1902] Long 1@13964.40039 at 18:00:01
PriceA: 13914.00000, PriceB: 13964.50000, Difference: -50.50000
[Asset_A::S1901] Cover 10@13914.00: -6.30 at 18:00:01
[Asset_B::L1902] Sell 1@13964.90: -131 at 18:00:01
(Broker B has changed its minimum trade size to 0.1, so lot factor for Broker A is now 10)
Especially the last trade seemed very strange, Price_A had fallen from 14648 to 13914 within a second? So I asked ZHistoryEditor about Asset_A.t1 and found:
2018.01.02 18:00:09.000 13915
2018.01.02 18:00:01.000 13914
2018.01.02 18:00:00.000 13914
2018.01.02 17:59:58.000 13915
2018.01.02 17:59:57.000 13918
No idea where the value of 14648 came from. I compared randomly some further Price_A's from the log with the values of Asset_A.t1 and it was always like in the sample: the prices of Zorro's entries and exits are the ones that I also found in .t1. Anything seems sometimes to go wrong with setting PriceA = priceClose().
|
|
|
Re: Multiple broker connection - beta testers wanted!
[Re: jcl]
#470646
01/27/18 12:19
01/27/18 12:19
|
Joined: Dec 2013
Posts: 568 Fuerth, DE
Sphin
User
|
User
Joined: Dec 2013
Posts: 568
Fuerth, DE
|
The bid price is negative, so: I stored .t1 that way and my .t1 in ZHistoryEditor look like
2018.01.27 00:28:34.000 177,18
2018.01.27 00:28:34.000 -175,23
2018.01.27 00:28:31.000 177,2
2018.01.27 00:28:31.000 -175,23
Then I modified the code of the BrokerArb example with
asset("Asset_A");
Spread = marketVal(); // From Manual: For backtesting with variable spread, set Spread = marketVal() in the script.
var SpreadA = Spread, PriceA = priceClose(), CommissionA = ...
asset("Asset_B");
Spread = marketVal();
var SpreadB = Spread, PriceB = priceClose(), CommissionB = ...
But both SpreadA and SpreadB remain always 0.0000. Did I miss something?
|
|
|
|