How to view rejected trades?
Author: wbzhang
Creation Date: 9/30/2010 12:45 PM
profile picture

wbzhang

#1
Hello, my positions are calculated very carefully, but still get some rejected trades. The message bar shows "Trades not included due to insufficient simulated capital or selected PosSizer: 5".

But can I view the rejected trades so I can dig into the problems? And actually I use some statement like below in my PosSizer:

curPosition = curCash/(currentPos.EntryPrice) - 1
I only have 4 trades each day, and curCash is actually cash/4 for each day. I dont know why it is still rejected. So it will be helpful if I can view these rejected trades.

profile picture

Cone

#2
The best way is to simply perform a Raw Profit backtest. As long as RP sizing is sufficient to enter as least 1 share (or 1 contract), you'll see all the trades.

Also, keep in mind that the Round Lots Preferences may result in a rejected Position.
profile picture

wbzhang

#3
thanks, Cone.

But in raw profit mode, my PosSizer will not be usable anymore.

And in portfolio mode, even I assigned priority for each trade, I also get different simulation result each time. Is that strange?
profile picture

Cone

#4
QUOTE:
I also get different simulation result each time. Is that strange?
No, it's expected if you don't set Position.Priority. If you don't, the priorities are random.

See User Guide: Strategy Window > Backtesting Strategies > How Trades Are Chosen
profile picture

wbzhang

#5
QUOTE:
And in portfolio mode, even I assigned priority for each trade, I also get different simulation result each time. Is that strange?


As I said, I set Position.Priority for each trade. Any idea?
profile picture

Eugene

#6
I might have an idea: the priority was set incorrectly. Can you show us a code snippet?
profile picture

Cone

#7
I think I need glasses.
profile picture

wbzhang

#8
Hi Eugene, I think you are right. Thank you!

Actually there are multiple places in my code to long/short stocks. But I forget to set priority in one of these places. Now it is fine. thanks!

one more question, do you know how to use DebugPrint in my PosSizer? I want to print something in the Message and Error box.
profile picture

Eugene

#9
Answered in your new thread.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).