I have no trades

71 views
Skip to first unread message

alrts

unread,
Apr 1, 2011, 11:44:15 AM4/1/11
to JBookTrader
Hi,

I am using my simulation account and I chose 'Trade' on several
strategies but I never have a trade, since days. This was under JBT
8.04 and now also under JBT 8.05 using the new Long/Short strategies.
The program seems to work correctly and I can see the book numbers
change all the time. I think I should have one or two trades every day
when 4 strategies run concurrently.

Does anyone actually have trades with the strategies that come with
the distribution?

Thank you,
Alexander

nonlinear

unread,
Apr 1, 2011, 2:57:07 PM4/1/11
to jbook...@googlegroups.com
I am experiencing the same thing: the last several days produced no trades. This is perfectly normal. Run a long term backtest, pop up a chart, and you'll see that it's not uncommon for any of the sample strategies to sometimes go on for days without trades. Sometimes the market "stretches", which is what makes JBT sample strategies trade, and sometimes the market hibernates (which could be  while it's in either a range or a trend).

nonlinear

unread,
Apr 7, 2011, 10:55:57 AM4/7/11
to jbook...@googlegroups.com
Got a few trades today, alrts? I got 3 so far, +$600. Just wanted to compare.

alrts

unread,
Apr 8, 2011, 5:19:38 AM4/8/11
to JBookTrader
I was not at home, what a pity!

alrts

unread,
Apr 15, 2011, 11:20:21 AM4/15/11
to JBookTrader
I'm sorry to bother you again, but I still have no trades. When I
activate LongDeferder1 with option "Trade", I can see the book value
and price of ES change, but the method "onBookSnapshot()" within class
"LongDefender" is never called and therefore tension is not calculated
and therefore no trades are possible. Am I missing something?

alrts

unread,
Apr 15, 2011, 11:29:02 AM4/15/11
to JBookTrader
I think have found the problem. The strategy must run an hour before
onBookSnapshot() is called for the first time.

nonlinear

unread,
Apr 15, 2011, 11:32:08 AM4/15/11
to jbook...@googlegroups.com

but the method "onBookSnapshot()" within class
"LongDefender" is never called and therefore tension is not calculated
and therefore no trades are possible. Am I missing something?

I have had no trades this week either. Prolonged periods of inactivity are normal, as JBT sample strategies are optimized for best risk/reward profile, and not for a particular number of trades.

The onBookSnapshot() method is called every 1 second. If you don't see that, there is something wrong with your code. Feel free to post it, and we'll find out what it is.

If your purpose is to just test JBT framework and the mechanics of autotrading using a simulated TWS account, you can adjust the "entry" and "exit" parameters of your strategy to make it trade as often as you want.

 

nonlinear

unread,
Apr 15, 2011, 1:50:10 PM4/15/11
to jbook...@googlegroups.com
On Friday, April 15, 2011 11:29:02 AM UTC-4, alrts wrote:
I think have found the problem. The strategy must run an hour before
onBookSnapshot() is called for the first time.


That is correct. The intent of this is to allow the indicators (such as EMA and SMA based indicators) to settle in. This is a feature, not a problem.

 

alrts

unread,
Apr 15, 2011, 1:57:06 PM4/15/11
to JBookTrader
I understand this. But there must be another problem. In the
IndicatorManager "samples" is almost always smaller than
MIN_SAMPLE_SIZE. This leads to indicatorManager.hasValidIndicators() =
false. And this in turn prevents the program to call OnBookSnapshot().

nonlinear

unread,
Apr 15, 2011, 3:42:55 PM4/15/11
to jbook...@googlegroups.com

I understand this. But there must be another problem. In the
IndicatorManager "samples" is almost always smaller than
MIN_SAMPLE_SIZE.

More precisely,  the "samples" counter is smaller than MIN_SAMPLE_SIZE for the first hour after you start the strategy. After that, it's always greater than MIN_SAMPLE_SIZE. Again, this is exactly how it was designed. If that's not what you see, please let me know.

 

nonlinear

unread,
Apr 18, 2011, 4:08:51 PM4/18/11
to jbook...@googlegroups.com
Got any action today, alrts? I have 5 trades, +$104. You may have different results, since I run a (slightly) modified version of sample strategies.

alrts

unread,
Apr 20, 2011, 4:45:28 AM4/20/11
to jbook...@googlegroups.com
No, I had no trades. Which of the distributed strategies do you recommend to use ? All of them, or just one LongDefender and one ShortDefender ?

nonlinear

unread,
Apr 20, 2011, 9:52:43 AM4/20/11
to jbook...@googlegroups.com
It's not my intent to recommend any trading strategies. The sample strategies included with JBT are there for reference purposes. I do care about consistency and robustness of the framework. If two (or more) people are running the same strategy, they should see the same results. That's why I sometimes ask to compare the results.

ShaggsTheStud

unread,
Apr 21, 2011, 8:07:18 PM4/21/11
to jbook...@googlegroups.com
I saw trades today.

I am forward testing all the strategies in the latest release, as an experiment.  I recommend you do the same.

On Wed, Apr 20, 2011 at 6:52 AM, nonlinear <eugene....@gmail.com> wrote:
It's not my intent to recommend any trading strategies. The sample strategies included with JBT are there for reference purposes. I do care about consistency and robustness of the framework. If two (or more) people are running the same strategy, they should see the same results. That's why I sometimes ask to compare the results.

--
You received this message because you are subscribed to the Google Groups "JBookTrader" group.
To post to this group, send email to jbook...@googlegroups.com.
To unsubscribe from this group, send email to jbooktrader...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jbooktrader?hl=en.

alrts

unread,
Jul 12, 2011, 8:08:35 AM7/12/11
to jbook...@googlegroups.com
Hi all,

I know now why I had no trades.

It's because I have a multiaccount. In order to enable JBookTrader for multiaccounts, there are only very small modifications necessary, as follows:

TraderAssistant.java: In method placeMarketOrder(), you have to add the following line just before placeOrder(...):

order.m_account = accountCode;


TraderAssistant.java: In method checkAccountType(), you have to replace the following lines 

socket.reqAccountUpdates(true, "");
...
socket.reqAccountUpdates(false, "");

by

socket.reqAccountUpdates(true, accountCode);
...
socket.reqAccountUpdates(false, accountCode);

This is a very simple modification just to make JBookTrader runnable with multiaccounts. Trading takes place with the first subaccount of the multiaccount (not the master account). In order to access other subaccounts of the multiaccount, further modifications would be necessary.

I think with these modifications, JBookTrader is still functoning with singe accounts, but I cannot test this, as I have no single account and IB does not allow me to open a second account.

Could someone implement these modifications and test it with a single account? Thank you!

Alexander


PS: Sorry for this delay. I was moving and out of the office for 2 months



alrts

unread,
Jul 12, 2011, 9:38:07 AM7/12/11
to jbook...@googlegroups.com
I have to add something to my previous post, otherwise it would't work for multiaccounts. For the time being, accountCode has to be explicitly replaced by "Uxxxxxx" for a real multiaccount or "DUxxxxx" for a simulation multiaccount in the statement

replace
        socket.reqAccountUpdates(true, "");
by
        socket.reqAccountUpdates(true, "Uxxxxxx");
or
        socket.reqAccountUpdates(true, "DUxxxxx");

A hardcoded accountCode within the program is an inconvenience but helps me run on a multiaccount for the time being.

Alexander

Judson Wilson

unread,
Jul 12, 2011, 11:49:05 AM7/12/11
to jbook...@googlegroups.com
Thanks alrts, this will be helpful to me.

--
You received this message because you are subscribed to the Google Groups "JBookTrader" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jbooktrader/-/rSCYqlNCb4MJ.
Reply all
Reply to author
Forward
0 new messages