BTWFMgr can also handle partial exits - below is an example of a partial exit:
Label | Time | Price | Contracts | ||
LE | Long Entry | 10:05 | $927.50 | +3 | |
LP | Long partial Exit | 10:10 | $928.00 | -2 | Sold 2 contracts at a 0.5 points gain |
LX | Long final Exit | 10:35 | $925.75 | -1 | Sold remaining 1 contract at a 2.75 points loss |
To repeat on your computer:
1. | Import the sample strategy used here (PSS_BTMGR1.ELD) |
2. | Open partial Exit workspace (BT_PartialES.tsw) |
3. | Extract the BTWFMgr file to C:\BTWFMGr
from ES5_Partial.zip and open ES5_Partial.btwf1 with BTWFMgr (just double click) You can also run a simple backtest for parameter TimeExitLP as shown below: |
4. | You will see the results from a small backtest - partial
exit time (TimeExitLP) between 10:05 and 10:15: |
5. | Open the actual trading event file: File/Open detailed trading Events (btwf2) The Events#1 to 3 show the long trades: Event#1(LE) Entry Event#2 partial 2 contract exit @928.00 and Event#3 the closing exit @925.75 Event#4 - 6 - short position Event#7 etc - the other backtest parameter variations (TimeExitLP 10:10 and 10:15 etc) |
6. | The strategy print log shows also the long trades: (View/Easylanguage
Output Bar - click on Print Log): D=716 T= 955 Bar= 929.25/ 927.75 Sh= 0 Entry= 0.00/ 0.00/ 0.00 Exit= 0.00/ 0.00/ 0.00 AvgPrc= 0.00 PL= 0.00/ 0.00/ 0.00 BarE= 0/ 0/ 0 BarX= 0/ 0/ 0 MaxSh= 0 D=716 T=1000 L Tar1= 0.0000 D=716 T=1000 Bar= 929.25/ 927.25 Sh= 0 Entry= 0.00/ 0.00/ 0.00 Exit= 0.00/ 0.00/ 0.00 AvgPrc= 0.00 PL= 0.00/ 0.00/ 0.00 BarE= 0/ 0/ 0 BarX= 0/ 0/ 0 MaxSh= 0 D=716 T=1005 L Partial Exit=927.7500 Since= 0 D=716 T=1005 Bar= 928.50/ 927.00 Sh= 3 Entry= 927.50/ 0.00/ 0.00 Exit= 0.00/ 0.00/ 0.00 AvgPrc= 927.50 PL= 22.50/ 0.00/ 0.00 BarE= 0/ 0/ 0 BarX= 0/ 0/ 0 MaxSh= 3 D=716 T=1010 Bar= 929.00/ 927.75 Sh= 1 Entry= 927.50/ 0.00/ 0.00 Exit= 0.00/ 0.00/ 0.00 AvgPrc= 927.50 PL= 37.50/ 0.00/ 0.00 BarE= 1/ 0/ 0 BarX= 0/ 0/ 0 MaxSh= 3 D=716 T=1015 Bar= 927.75/ 926.00 Sh= 1 Entry= 927.50/ 0.00/ 0.00 Exit= 0.00/ 0.00/ 0.00 AvgPrc= 927.50 PL= -12.50/ 0.00/ 0.00 BarE= 2/ 0/ 0 BarX= 0/ 0/ 0 MaxSh= 3 D=716 T=1020 Bar= 927.00/ 925.25 Sh= 1 Entry= 927.50/ 0.00/ 0.00 Exit= 0.00/ 0.00/ 0.00 AvgPrc= 927.50 PL= -50.00/ 0.00/ 0.00 BarE= 3/ 0/ 0 BarX= 0/ 0/ 0 MaxSh= 3 D=716 T=1025 Bar= 926.50/ 925.50 Sh= 1 Entry= 927.50/ 0.00/ 0.00 Exit= 0.00/ 0.00/ 0.00 AvgPrc= 927.50 PL= -25.00/ 0.00/ 0.00 BarE= 4/ 0/ 0 BarX= 0/ 0/ 0 MaxSh= 3 D=716 T=1030 Bar= 926.50/ 925.50 Sh= 1 Entry= 927.50/ 0.00/ 0.00 Exit= 0.00/ 0.00/ 0.00 AvgPrc= 927.50 PL= -50.00/ 0.00/ 0.00 BarE= 5/ 0/ 0 BarX= 0/ 0/ 0 MaxSh= 3 D=716 T=1035 Bar= 926.00/ 924.75 Sh= 0 Entry= 0.00/927.50/0.00 Exit= 0.00/925.75/0.00 AvgPrc= 0.00 PL= 0.00/-67.50/ 0.00 BarE= 0/ 6/ 0 BarX= 0/ 0/ 0 MaxSh=0/3 Unfortunately Tradestation does NOT report the partial exit price - as the "Exit= 0.00/ 0.00/ 0.00" at 10:10 shows which tracks the recent exit prices. Usually exits are market orders and use the open price of the bar after the partial sell order and so BTWFMgr is by default picking up the open price as the partial exit price. Open the PSS_BTMGR1 EasyLanguage code and you will see "PSS_BTSetExit(Open);" which instructs BTWFMgr to use the open price as the exit price for any partial exits. If you are using limit orders - you can of cause use the "PSS_BTSetExit" function to set your specific partial limit order price(s). |
7. | In this example we are using a $5.00 commission per
contract traded and a 3 contract initial size: |
8. | BTWFMgr Commission calculation Logic: Futures: BTWFMgr ALWAYS uses the "per Share/Contract" option to calculate net profit/loss for future trades! Stocks/ETF's: BTWFMgr ALWAYS uses the "per Trade" option to calculate net profit/loss for stock trades! FOREX: commission does not apply (enter 0) |
.