PDA

View Full Version : Time based exit


NeilW
21st March 2004, 08:23 AM
I read in Market Wizards where one of the Traders exited his position if he did not have a profit on the first day. Perhaps a little severe but!

What I would like to do is have my normal exits as in Initial stop, trailing stop, Exit trigger whatever, but I would also like to be able to exit a trade if I had not returned a profit in a certain amount of time.
I.e. Enter trade based on EntryTrigger If after two days we have not realised a profit (or not enough profit I.e. > 2 * brokerage) then the market is not doing what we expected. Exit the trade.

Can I do this style of exit?

Thanks,

Neil.

David Samborsky
22nd March 2004, 02:25 AM
To do this you need to use SetProfitStop in conjunction with SetTimeStop.

NeilW
23rd March 2004, 12:47 AM
How do I use SetProfitStop in conjunction with SetTimeStop to perform the following ?

If (DaysInTrade > 2) AND (TradeProfit < 2%) then
ExitTrade
Else
ExitTradeNormally;

In other words the trade is not doing what I expected it to do, better exiting and putting my money elsewhere.

David Samborsky
23rd March 2004, 01:13 AM
ExtFml&#40;"TradeSim.Initialize"&#41;;
ExtFml&#40;"TradeSim.SetProfitStop",2&#41;;
ExtFml&#40;"TradeSim.SetTimeStop",2&#41;;


You need to set your entry and exit prices accordingly as these will determine your profit threshold.

NeilW
23rd March 2004, 01:46 AM
Hi David,
But won't this exit my trade if my profit exceeds 2% OR 2 days. Or is my understanding of the stops not correct.
I only want to exit if after two days I have not made a two percent profit.

:?:

Neil.

David Samborsky
23rd March 2004, 11:42 AM
Yes you are correct.

Probably easier to manually code it.

For argument sake lets say you are comparing Close with the Open


ProfitThreshold&#58;=10; &#123;10% for example&#125;

ExitTrigger&#58;=ref&#40;EntryTrigger,-2&#41; AND &#40;C-ref&#40;O,-2&#41;&#41;/ref&#40;O,-2&#41;*100<ProfitThreshold AND
&#40;ref&#40;C,-1&#41;-ref&#40;O,-2&#41;&#41;/ref&#40;O,-2&#41;*100<ProfitThreshold AND
&#40;ref&#40;C,-2&#41;-ref&#40;O,-2&#41;&#41;/ref&#40;O,-2&#41;*100<ProfitThreshold;