Hello,
We did it.
We included the synchronizing filter inside the BackTester class, this works only for CandleEvents.
We submitted to my git repository ( MASTER ), please test it and give us feedbacks.
We will include this feature inside the tbg-quant 1.1beta6.
By setting FORCE_SYNCHRONIZATION variable to true, means you want to receive only synchronized events, ex: if for the day d exists the quote of XOM and BHP then push the events, if for the day d exists only one of the two quote, it does not push the event. By default this is set to false, means that we push events if XOM or BHP quote exist.
See the code:
marketDataFeed.FORCE_SYNCHRONIZATION = false;
Please note that if we are waiting for candles of 3 stocks, we expect to receive 3 events, 1 for stocks (if the candle exists for that day), to better understand this please run the example above.
Connected to YahooMarketDataFeed.
Fetching SPY from Yahoo...
Fetching ^GDAXI from Yahoo...
Active MarketDataFeed...
onEvent(): S: ^GDAXI D : Mon Jul 01 00:00:00 CEST 2013 O : 8000.02 H : 8023.15 L : 7890.28 C : 7983.92 V : 30610300
onEvent(): S: SPY D : Mon Jul 01 00:00:00 CEST 2013 O : 161.26 H : 162.48 L : 161.08 C : 161.36 V : 131954800
onEvent(): S: ^GDAXI D : Tue Jul 02 00:00:00 CEST 2013 O : 7988.92 H : 7988.96 L : 7873.97 C : 7910.77 V : 29054900
onEvent(): S: SPY D : Tue Jul 02 00:00:00 CEST 2013 O : 161.12 H : 162.3 L : 160.5 C : 161.21 V : 154863700
onEvent(): S: ^GDAXI D : Wed Jul 03 00:00:00 CEST 2013 O : 7841.18 H : 7841.87 L : 7730.37 C : 7829.32 V : 34236500
onEvent(): S: SPY D : Wed Jul 03 00:00:00 CEST 2013 O : 160.48 H : 161.77 L : 160.22 C : 161.28 V : 75216400
onEvent(): S: ^GDAXI D : Thu Jul 04 00:00:00 CEST 2013 O : 7877.91 H : 8015.08 L : 7863.76 C : 7994.31 V : 33496000
onEvent(): S: ^GDAXI D : Fri Jul 05 00:00:00 CEST 2013 O : 8010.44 H : 8031.71 L : 7805.36 C : 7806.0 V : 35643800
onEvent(): S: SPY D : Fri Jul 05 00:00:00 CEST 2013 O : 162.47 H : 163.08 L : 161.3 C : 163.02 V : 122416900
onEvent(): S: ^GDAXI D : Mon Jul 08 00:00:00 CEST 2013 O : 7865.92 H : 8015.21 L : 7848.14 C : 7968.54 V : 31059500
onEvent(): S: SPY D : Mon Jul 08 00:00:00 CEST 2013 O : 163.86 H : 164.39 L : 163.08 C : 163.95 V : 108092500
onEvent(): S: ^GDAXI D : Tue Jul 09 00:00:00 CEST 2013 O : 8021.13 H : 8086.95 L : 8005.73 C : 8057.75 V : 26183800
onEvent(): S: SPY D : Tue Jul 09 00:00:00 CEST 2013 O : 164.98 H : 165.33 L : 164.27 C : 165.13 V : 119298000
onEvent(): S: ^GDAXI D : Wed Jul 10 00:00:00 CEST 2013 O : 8056.51 H : 8081.21 L : 7990.65 C : 8066.48 V : 17189200
onEvent(): S: SPY D : Wed Jul 10 00:00:00 CEST 2013 O : 164.97 H : 165.75 L : 164.63 C : 165.19 V : 121410100
onEvent(): S: ^GDAXI D : Thu Jul 11 00:00:00 CEST 2013 O : 8163.56 H : 8176.7 L : 8130.48 C : 8158.8 V : 25814400
onEvent(): S: SPY D : Thu Jul 11 00:00:00 CEST 2013 O : 167.11 H : 167.61 L : 165.18 C : 167.44 V : 135592200
onEvent(): S: ^GDAXI D : Fri Jul 12 00:00:00 CEST 2013 O : 8192.91 H : 8244.13 L : 8178.2 C : 8212.77 V : 29697900
onEvent(): S: SPY D : Fri Jul 12 00:00:00 CEST 2013 O : 167.39 H : 167.93 L : 167.13 C : 167.51 V : 104191300
onStop():
As you can see it streams 2 events per day except for Jul4 where we got only 1 event ( becasue SPY is close ).
If the variable FORCE_SYNCHRONIZATION was setted to true, we did not receive any event on july 4.
Please we are looking forward to receive some feedbacks.
Thank you
Alberto