Need to buy on specific date
Author: Darsony
Creation Date: 7/6/2009 8:22 PM
profile picture

Darsony

#1
Hello,

I am a newbie wealth-lab programmer and not familiar with coding in this language. Would someone please post a strategy that allows me to test buying on specific dates and selling after a specific number of trading days has passed? Thanks

For example,
Variables:
EntryDate (specific date that I will manually select for each test)
ExitAfterNumberOfBars (Specific number of trading days that I will manually define - I am only counting trading days and not including weekends & holidays in my count)
NumOfShares (obvious)

If today's date = EntryDate, then Buy NumOfShares at OPEN.
Sell after ExitAfterNumberOfBars

Thank you.
profile picture

Cone

#2
You can drag and drop those rules. User Guide: Strategy Window > Strategy Builder

Re: NumOfShares (obvious)
User Guide: Reference > Data Panel > Position Size Control

Also, see the June 2009 Traders' Tip. You can set long or short and the particular date right from the Strategy Parameter sliders.
profile picture

Darsony

#3
Thanks. I was able to get in working dragging and dropping, but the code in the link had an error "... ATRModified does not exist in the namespace TASCIndicators ..."
profile picture

Cone

#4
Open the Extension manager (Tools menu) and get the update for that Indicator package.
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).