logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
meridien  
#1 Posted : Monday, July 6, 2009 8:33:08 PM(UTC)
meridien

Rank: Newbie

Groups: Registered, Registered Users
Joined: 7/6/2009(UTC)
Posts: 8

Would the following formula be correct (I am asking because the backtest's exits don't function as intended):

In the system tester, under the "sell" and "buy to cover" tabs, I wrote the following code in order to close the position on the 10th day close after entering it (the test is on daily candlesticks):

ref(c,+10)

Thanks for your help.

wabbit  
#2 Posted : Tuesday, July 7, 2009 6:54:17 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Hi meridien,

There are many ways (allegedly) to achieve this, although I personally haven't tried any of them!

In the sell condition, reference the buy criteria
Code:
{sell}
buy:={something}
barssince(buy)>=3;

This might have some issues if the buy condition is true some time between the actual entry and the desired exit day.

You can use the same buy criteria, and assign a strategic delay. This will have the same limitations as using the barssince() as shown above.

Use the Simulation functions:
Code:
{sell}
Simulation.CurrentPositionAge>=3;

One problem with the simulation functions is they are quite slow, so use sparing and with some regard to the speed of execution.

Set an inactivity stop to some rediculously large value like 1000% with a corresponding delay period.


That's all that immediately spring to mind, so if you find any more methods let us know. Give one/all methods a go and see what works for you. Please report your findings.


wabbit [:D]


meridien  
#3 Posted : Tuesday, July 7, 2009 1:46:15 PM(UTC)
meridien

Rank: Newbie

Groups: Registered, Registered Users
Joined: 7/6/2009(UTC)
Posts: 8

Hello Wabbit,

I have tried the second formula and it works perfectly. Thank you so much for your help.

Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.