| // Services | |
| TickToCandleEventService candle1min = new TickToCandleEventService(TimeFrame.TIMEFRAME_1min,this); |
private final IMarketDataFeed marketDataFeed = new BogusMarketDataFeed();
| |||||
Dear all. How can i publish a tickevent ir a candle event (fakemarketfeed)
--
www.thebonnotgang.com
---
You received this message because you are subscribed to the Google Groups "tbg-Quant-community" group.
To post to this group, send email to tbg-quant...@googlegroups.com.
After Having collected market data, I publish à tick event. When i send an order (paper account), I encounter an error. Do not know how to debug or if sending à tick is enough. Help or an example would be appreciated.
--
www.thebonnotgang.com
---
You received this message because you are subscribed to the Google Groups "tbg-Quant-community" group.
To post to this group, send email to tbg-quant...@googlegroups.com.
This generate the error below. The line "TestOnEvent.java:149" of the stack trace refers to code line "broker.sendOrder(order);"
2014-10-26 00:39:30,225 [AWT-EventQueue-0] INFO [com.tbg.strategy.TradingSystem] - TICK_EVENT => TimeStamp: Thu Jan 01 01:23:34 CET 1970 Symbol: EPA:AI Price: 92.66000366210938 Size: 0.0 Volume: 0 AskPrice: 0.0 BidPrice: 0.0 askSize: 0.0 bidSize: 0.0
2014-10-26 00:39:30,225 [AWT-EventQueue-0] INFO [com.tbg.adapter.paper.broker.PaperBroker] - sendOrder(): OID=null, type=MARKET, security=null, side=BUY, quantity=-1.0, orderTimeStamp=null, executionTragetTimeStamp=null, expirationTimeStamp=null, timeInForce=DAY, stopPrice=-1.0, limitPrice=-1.0, trailingDistance=-1.0, orderStatus=NEW
2014-10-26 00:39:30,225 [AWT-EventQueue-0] WARN [org.bushe.swing.event.EventService] - Exception thrown by;EventService subscriber:com.tbg.core.model.strategy.StrategyBase$MarketDataSubscriber@325c62c0. Subscriber class:class com.tbg.core.model.strategy.StrategyBase$MarketDataSubscriber
org.bushe.swing.exception.SwingException: Exception handling event topic event class=com.tbg.core.model.types.event.TickEvent, event=TICK_EVENT => TimeStamp: Thu Jan 01 01:23:34 CET 1970 Symbol: EPA:AI Price: 92.66000366210938 Size: 0.0 Volume: 0 AskPrice: 0.0 BidPrice: 0.0 askSize: 0.0 bidSize: 0.0, topic=null, eventObj=null
org.bushe.swing.exception.SwingException: Exception handling event topic event class=com.tbg.core.model.types.event.TickEvent, event=TICK_EVENT => TimeStamp: Thu Jan 01 01:23:34 CET 1970 Symbol: EPA:AI Price: 92.66000366210938 Size: 0.0 Volume: 0 AskPrice: 0.0 BidPrice: 0.0 askSize: 0.0 bidSize: 0.0, topic=null, eventObj=null
at org.bushe.swing.event.ThreadSafeEventService.handleException(ThreadSafeEventService.java:2021)
at org.bushe.swing.event.ThreadSafeEventService.handleException(ThreadSafeEventService.java:2009)
at org.bushe.swing.event.ThreadSafeEventService.publish(ThreadSafeEventService.java:975)
at org.bushe.swing.event.SwingEventService.access$001(SwingEventService.java:31)
at org.bushe.swing.event.SwingEventService$1.run(SwingEventService.java:88)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:749)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:702)
at java.awt.EventQueue$3.run(EventQueue.java:696)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:719)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.NullPointerException
at com.tbg.adapter.paper.broker.PaperBroker.getLastMarketTickEvent(PaperBroker.java:419)
at com.tbg.adapter.paper.broker.PaperBroker.sendOrder(PaperBroker.java:80)
at examples.test.TestOnEvent.onEvent(TestOnEvent.java:149)
at com.tbg.service.cep.PassThroughProvider.sendEvent(PassThroughProvider.java:34)
at com.tbg.core.model.strategy.StrategyBase$MarketDataSubscriber.onEvent(StrategyBase.java:93)
at org.bushe.swing.event.ThreadSafeEventService.publish(ThreadSafeEventService.java:971)
... 16 more
ps : having the source code would have been helpful...
best regards.
--
www.thebonnotgang.com
---
You received this message because you are subscribed to the Google Groups "tbg-Quant-community" group.
To post to this group, send email to tbg-quant...@googlegroups.com.
if we suscribe for a security using the constructor with new symbol only generate an exception when you try to send an order. So the steps
1 susbscribesecurity(new security(new symbol("ibm")))
2 ordersend....
Generate an exception.
To avoid this bug/error, One need to subscribesecurity with a complete constructor ie susbscribesecurity(new security(new symbol("ibm", "", "smart",currency, ...)))
Best regards.
An exception occurs when an order is sent on a security subscribed with the most simple constructor. One need to subscribe a security filling all requested parameter (ticker, vendor, type, currency, market, etc) to avoid the exception when sending an order.
Best regards.