How to do this?

Discussions about the testing and simulation of mechanical trading systems using historical data and other methods. Trading Blox Customers should post Trading Blox specific questions in the Customer Support forum.
Post Reply
freedom007
Contributor
Contributor
Posts: 2
Joined: Thu Jun 23, 2005 7:51 pm

How to do this?

Post by freedom007 »

Hi,

Is that possible to do something like this in Tradingbloxbuilder

For the same symbol, the quantity of Enter and Exit a trade was different

let say Enter a trade with quantity of 1000 and exit with 800.If it is

possible would you pls give some hint for me how to deal with it?


Regards
Tim Arnold
Site Admin
Site Admin
Posts: 9024
Joined: Tue Apr 06, 2004 1:41 pm
Location: Boston, MA
Contact:

Post by Tim Arnold »

The last optional parameter in the broker function call is the quantity to exit. So you can use the following to exit 800 contracts of unit 1.

Code: Select all

broker.ExitUnitOnOpen( 1, 800 )
There are a number of Adjust Position functions as well to increase or decrease the position size by a percent.
freedom007
Contributor
Contributor
Posts: 2
Joined: Thu Jun 23, 2005 7:51 pm

Post by freedom007 »

Thanks,Tim,However,May be I need to elaborate my point more clearly.

What I have seen in trade log file, a complete one roundtrip trade record which contain entry and exit infor,just have one colume of ' quantity 'before ' entry fill ' ,so is that mean we have to keep the same quantity on Entry and Exit in one roundtrip Trade.What if I want to buy 1000 share and just exit 800 in one roundtrip.Is there any chance to do it
in TBB? (may be can use of different unit number I think). If it possible,would u pls drop me a sample, very appreciate.


Regards
Tim Arnold
Site Admin
Site Admin
Posts: 9024
Joined: Tue Apr 06, 2004 1:41 pm
Location: Boston, MA
Contact:

Post by Tim Arnold »

Yes, if you use the code above, Trading Blox will create a trade entry showing an entry and exit of 800. Then if you exit the last 200 you will have another trade with an entry and exit of 200.

So a single unit entry with multiple exits becomes multiple round trip trades. Another way to approach the problem could be to use multiple units. You could have an entry of 800, and an entry of 200, and then exit them separately.
Post Reply