1. The contract multiplier should be set to 1 for stocks (it's only
applicable to futures)
2. The EmailException is thrown because you have not configured the email
user name and password. You can simply turn off the email notification
service from preferences.
3. In your second try, the error was swallowed. To enable the error
reporting, replace this:
// 200: bad contract
if (errorCode == 200) {
traderAssistant.volumeResponse(id, -1);
}
with this
// 200: bad contract
if (errorCode == 200) {
eventReport.report(JBookTrader.APP_NAME, errorMsg);
traderAssistant.volumeResponse(id, -1);
}
4. How does your market data subscription age looks like. Do you have both
the "US Securities Bundle" and "Nasdaq TotalView" checked? I've attached
mine for reference.
5. I've always used JBT with futures, and it's been a long time since I
tested it with stocks, so perhaps I missed something.
On Thu, Aug 14, 2014 at 9:57 PM, Ben <[email protected]> wrote:
> Hi Eugene,
>
> The code I am using for TSLA is as below:
>
> public abstract class StrategyTSLA extends Strategy {
> protected StrategyTSLA(StrategyParams optimizationParams) throws
> JBookTraderException {
> super(optimizationParams);
> // Specify the contract to trade
> Contract contract = ContractFactory.makeStockContract("TSLA",
> "SMART","USD");
> // Define trading schedule
> TradingSchedule tradingSchedule = new TradingSchedule("09:30",
> "16:30", "America/New_York");
> int multiplier = 100;// contract multiplier
> double bidAskSpread = 0.01; // prevalent spread between best bid
> and best ask
> Commission commission =
> CommissionFactory.getBundledNorthAmericaStockCommission();
> setStrategy(contract, tradingSchedule, multiplier, commission,
> bidAskSpread);
> }
> }
>
> Following is what I got from EventReport (please note the error message Deep
> market data is not supported for this combination of security type/exchange
> ):
>
> 08/14/1420:47:39.286JBookTraderMonitoring server started 08/14/14
> 20:47:39.287Sample_TSLAStrategy started. Trading schedule: 09:30 to 16:30
> (America/New_York)08/14/1420:47:39.287JBookTraderRequested contract
> details for instrument TSLA-USD-SMART-STK
> 08/14/1420:47:39.288JBookTraderRequested
> book data for instrument
> TSLA-USD-SMART-STK08/14/1420:47:39.288JBookTraderRequested
> market data for instrument TSLA-USD-SMART-STK 08/14/1420:47:39.327IB
> APIContract
> details:
> ID: 4
> Trading class: NMS
> Exchanges:
> SMART,ISE,CHX,ARCA,ISLAND,IBSX,DRCTEDGE,BEX,BATS,EDGEA,LAVA,CSFBALGO,JEFFALGO,BYX,IEX,PSX
> Long name: TESLA MOTORS INC
> Market name: NMS
>
> Minimum tick: 0.01
> Contract month: null
> Time zone id: EST5EDT
> Trading hours: 20140814:0400-2000;20140815:0400-2000
> Liquid hours: 20140814:0930-1600;20140815:0930-1600
> 08/14/1420:47:39.409IB API10092: Deep market data is not supported for
> this combination of security type/exchange (for id 4)08/14/14 20:47:40.390
> JBookTraderorg.apache.commons.mail.EmailException: Sending the email to
> the following server failed : smtp.gmail.com:465 at
> org.apache.commons.mail.Email.sendMimeMessage(Email.java:1401) at
> org.apache.commons.mail.Email.send(Email.java:1428) at
> com.jbooktrader.platform.email.Notifier.send(Notifier.java:61) at
> com.jbooktrader.platform.email.Notifier.send(Notifier.java:41) at
> com.jbooktrader.platform.trader.Trader.error(Trader.java:212) at
> com.ib.client.EClientSocket.error(EClientSocket.java:1890) at
> com.ib.client.EReader.processMsg(EReader.java:331) at
> com.ib.client.EReader.run(EReader.java:69) Caused by:
> javax.mail.AuthenticationFailedException: 535-5.7.8 Username and Password
> not accepted. Learn more at 535 5.7.8
> http://support.google.com/mail/bin/answer.py?answer=14257 z4sm503580igm.2
> - gsmtp at
> com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:826)
> at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:761) at
> com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:685) at
> javax.mail.Service.connect(Service.java:317) at
> javax.mail.Service.connect(Service.java:176) at
> javax.mail.Service.connect(Service.java:125) at
> javax.mail.Transport.send0(Transport.java:194) at
> javax.mail.Transport.send(Transport.java:124) at
> org.apache.commons.mail.Email.sendMimeMessage(Email.java:1391) ... 7 more
> When using Contract contract = ContractFactory.makeStockContract("TSLA",
> "ISLAND","USD");
> I got the EventReport as below (no error message but still not able to see
> the deep data in JBT):
>
> 08/14/1420:53:43.299JBookTraderMonitoring server started 08/14/14
> 20:53:43.300Sample_TSLAStrategy started. Trading schedule: 09:30 to 16:30
> (America/New_York)08/14/1420:53:43.301JBookTraderRequested contract
> details for instrument TSLA-USD-ISLAND-STK
> 08/14/1420:53:43.301JBookTraderRequested
> book data for instrument TSLA-USD-ISLAND-STK08/14/1420:53:43.302
> JBookTraderRequested market data for instrument TSLA-USD-ISLAND-STK
> 08/14/1420:53:41.337IB APIContract details:
> ID: 4
> Trading class: NMS
> Exchanges:
> SMART,ISE,CHX,ARCA,ISLAND,IBSX,DRCTEDGE,BEX,BATS,EDGEA,LAVA,CSFBALGO,JEFFALGO,BYX,IEX,PSX
> Long name: TESLA MOTORS INC
> Market name: NMS
>
> Minimum tick: 0.01
> Contract month: null
> Time zone id: EST5EDT
> Trading hours: 20140814:0400-2000;20140815:0400-2000
> Liquid hours: 20140814:0930-1600;20140815:0930-1600
>
> On Thursday, August 14, 2014 2:15:36 PM UTC-5, Eugene Kononov wrote:
>>
>> Ben, when you return, please try one more thing:
>> Contract contract = ContractFactory.makeStockContract("MSFT", "SMART",
>> "USD");
>>
>> I don't have the NasdaqTotalView subscription (because I only trade
>> futures), so I can't verify, but I think that will work for you.
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "JBookTrader" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/jbooktrader.
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"JBookTrader" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/jbooktrader.
For more options, visit https://groups.google.com/d/optout.