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

Notification

Icon
Error

Options
Go to last post Go to first unread
Willleung  
#1 Posted : Sunday, June 25, 2006 4:36:01 PM(UTC)
Willleung

Rank: Newbie

Groups: Registered, Registered Users
Joined: 6/15/2006(UTC)
Posts: 9

Hi, Would like to get some help on on the System Tester. Would like to do an exit on the same bar, is it possible? Thanks Will
mstt  
#2 Posted : Sunday, June 25, 2006 7:56:33 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Will Yes it is possibe to exit on the same bar as the entry. I posted the following for Charmeta about 4 weeks ago and your question is virtually the same. Use a forward reference for your Buy Order code (and Price code too if that's how you are defining entry price), and then apply a Strategic Delay of 1 bar to the Buy order. That allows the Enhanced System Tester to "Consider" the order 1 bar prior to when it thinks it will be executed, then Execute the order on the correct day. The Sell Order remains as is and has neither a forward reference nor a delay applied. I've explained this process more fully in a couple Of MSTT articles, and I can assure you that it does work. I think the problem is that the EST WILL NOT "Consider" a Buy and a Sell on the same bar, but it can certainly be tricked into executing on the same EOD bar. {Buy Order} Ref(Fml("My Buy Signal"),+1); {Price} Ref(Fml("My Buy Price"),+1); Strategic Delay (bars); [1] {Sell Order} Fml("My Sell Signal"); Strategic Delay (bars); [0] Set the Simulation Buy Price to OPEN and Delay order opening to 0. Note that testing does not occur on the last bar of data when using a forward reference of 1 bar, but this is of little consequence in the general scheme of things. Roy MetaStock Tips & Tools
Willleung  
#3 Posted : Sunday, June 25, 2006 8:38:02 PM(UTC)
Willleung

Rank: Newbie

Groups: Registered, Registered Users
Joined: 6/15/2006(UTC)
Posts: 9

Thanks Roy. Will
henry1224  
#4 Posted : Sunday, June 25, 2006 11:46:12 PM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
What came first, the chicken or the egg? Are we talking about an exit on close? Or are we talking about a separate exit signal that requires the data to have been updated? Using an expert, only one signal per bar can be used in the symbol area, another can be coded into the highlight area. My thinking is that on Tuesday night, I download my data, after the market is closed for the day, I get a buy signal for the daily bar chart. Wednesday morning, I enter my buy order. Wednesday night, I download my data, after the market is closed, I get an exit signal, so the next morning I put in an exit order. As each bar is updated, RT or EOD, each bar signals one signal. An expert uses priority to filter out signals. You develope a system with 4 signals: Long entry,Long exit, Short entry, and short exit. You are looking for the new bar to fire off a new signal You cannot trade what If's or forward Ref( my buy,1) signals Maybe I'm wrong, but I don't see how this works in an expert. Henry
Willleung  
#5 Posted : Monday, June 26, 2006 8:11:28 AM(UTC)
Willleung

Rank: Newbie

Groups: Registered, Registered Users
Joined: 6/15/2006(UTC)
Posts: 9

Roy, It doesn't work (for my purpose). Henry, I think you are right, the system tester is not getting right. I would like something like this: Day 1: Buy/Sell Signal Day 2: Enter Position (Open Price) and Exit Position (Close Price) This is very naive, I must say, but I am testing the a signal for the next day's movement in price. Cheers Will
mstt  
#6 Posted : Monday, June 26, 2006 9:24:34 AM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Will The method does work and I'm confident that I could have code to do exactly what you want up and running within about 30 minutes. However you're not obliged to accept help so I'll leave it at that. Good luck with doing it a different way. Roy MetaStock Tips & Tools
Willleung  
#7 Posted : Monday, June 26, 2006 9:39:28 AM(UTC)
Willleung

Rank: Newbie

Groups: Registered, Registered Users
Joined: 6/15/2006(UTC)
Posts: 9

Roy, Got it going now, instead of moving the signal forward then backward, I just move it back. Long: fml("WL - Up Day"); Strategic Delay (bars); [1] Long Cover: fml("WL - Up Day"); Strategic Delay (bars); [0] Been at it for the last 2 hours. Thanks a lot, Roy. Will
konrad  
#8 Posted : Monday, June 26, 2006 8:45:22 PM(UTC)
konrad

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/6/2005(UTC)
Posts: 424
Location: connecticut,USA

msst would you like to share your code of entry and exit and the same bar please?
mstt  
#9 Posted : Monday, June 26, 2006 9:29:48 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Konrad The code is unimportant. What's important is first understanding that there's a four-stage process for the EST in executing an order, and then modifying the timing of the code so that Buy and Sell are "considered" on different bars. The four stages of each trade, as found in the EST "Orders" report, are.. Considered, Placed, Opened, and Executed. The EST will happily excecute Buy and Sell on the same bar, but what it will not do is consider them both on the same bar. The trick is to consider the Buy at least one bar before considering the Sell. Using a forward reference for your entry code tricks the EST into considering the Buy 1 bar before it can realistically execute it, and using a Straegic Delay ensures that the execution stage takes palce on the intended bar. This method is not about buying on the OPEN or intraday based on values that are not known yet. It's about tricking the EST into executing a Buy and a Sell on the same bar, and that is done by separating the Buy and Sell consideration stages to different bars. Hope this helps. Roy MetaStock Tips & Tools
hayseed  
#10 Posted : Tuesday, June 27, 2006 1:25:07 AM(UTC)
hayseed

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/7/2005(UTC)
Posts: 1,346

i remember roys article, it was the january issue... we can be running the daily chart in realtime so its being updated constantly during market hours ..... certain systems could give buys/sells that we could legitimately execute in the final minutes or possibly in after hours trading..... in those cases a buy at close would be possible, but backtesting results might be off a tad.... also , couldn't systems based on something completely foreign to the purchased object yield many buy/sells in any given day ...... well known are systems based purely on trin as example..... there are others, i use some roy and henry would be aware of but others might not be such as those based on put/call ratio of the s&p 500 index options .... very few hayseeds trade index options, mostly smart money professionals..... when the p/c exceeds certain levels turns are emminent.... again that system would be independent of price...... other possible examples come to mind..... h
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.