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

Notification

Icon
Error

Options
Go to last post Go to first unread
optionguy  
#1 Posted : Monday, October 3, 2005 6:28:09 PM(UTC)
optionguy

Rank: Newbie

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

Hello, I had this function as a buy order in the system tester: (Security("c:\\metastock data\\futures\\@:ngc1#i",(C)))>Security("c:\\metastock data\\futures\\@:ngc1#i",(mov(C,50,s))*1.35) It buys a security after Nat Gas rose more than 35% above its 50-day moving average. Then for a sell order, I used the "barssince" function to sell the position after 30 bars had passed. However, the resulting sell dates were not even remotely correct most times, selling the position after 30 or 35 or 40 or whatever days. Instead, I replaced the "barssince" function with the following: Simulation.CurrentPositionAge>=30 That gave me exactly what I was looking for. However, with the old formula I could run the tester against 100 securities and it would take about 2 minutes. Using the "simulation" function, it takes more than 3 minutes to run it against only one security using a 3000 bar history. The only chance in the code that resulted in the excruciatingly slow test time was the simulation function. Is this what I should expect by using that function, or is there some way I can improve upon it? Thanks a bunch for any help, Brett
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.