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

Notification

Icon
Error

Options
Go to last post Go to first unread
Data  
#1 Posted : Friday, September 25, 2009 7:37:11 AM(UTC)
Data

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 5/20/2008(UTC)
Posts: 53

When I use either of these functions (Valuewhen or Prev) Metastock becomes extremely slow and sometimes it will simply freeze ! I've got a recent computer, a dual core, 4 Go of Ram, 1500 Go on my hard drive, I can't see why this program is freezing :( Especially when it takes less than 80 Mb of RAM.


Is there any way out of this mess ? Can I :
- allow Metastock to use more ressources ;
- find another way to code these indicators ;
- find an alternative program ?


What I am trying to do is quite simple : I don't want to do any trade is the close is higher/lower than the last short/buy signal. A basic C > valuewhen(1,signal,C) does the trick but that blocks metastock. It works quite well if I'm offline and it really improves my bottom line.
Could I just switch to Trade Station ?
When I think about it, I can not go somewhere else because of very useful add ons...
Justin  
#2 Posted : Friday, September 25, 2009 8:28:37 AM(UTC)
Justin

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 9/13/2004(UTC)
Posts: 673
Location: Salt Lake City, UT

MetaStock has some multi-threading. More specifically, individual components in MetaStock can each use a thread, i.e. the Expert Advisor creates a thread, the chart creates a thread, the indicator builder creates a thread. However, an individual component (i.e. the Expert Advisor) will not create multiple threads. Therefore if that one piece of the software is hammering on one of your CPU's, your other core(s) may very well be sitting idle (or at least offering little benefit to MetaStock).

PREV is a very resource intensive function as it requires every formula involved to be re-calculated on every bar loaded in the chart with every update received to the data, so the amount of data loaded into each chart can play a big impact on how well the PREV function will work.

It's possible there might be a better way to write this within the MetaStock language, or perhaps as a last resort you could look at having a custom DLL programmed to accomplish what you need. I'll leave those last questions for someone more proficient in programming / familiar with other products.
Data  
#3 Posted : Friday, September 25, 2009 8:55:33 AM(UTC)
Data

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 5/20/2008(UTC)
Posts: 53

Thanks for your answer Justin ! You're always helpful !

But does that mean that there are no solution to that problem ? Do you have a similar "slowness" of your computer when you use the PREV function on intraday charts ? The problem might be at my level...
Justin  
#4 Posted : Friday, September 25, 2009 9:50:18 AM(UTC)
Justin

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 9/13/2004(UTC)
Posts: 673
Location: Salt Lake City, UT

I haven't personally, but someone here mentioned to me how they created a complex enough formula with PREV using Local Data that it took 2 minutes before it would come back with the values. If local data can cause that kind of responsiveness, I am sure you can only imagine how bad that would be with live data.

We'd probably need to take a look at the formula as a whole, i.e. how many times is PREV used, other functions it might be nested in, etc. One thing you may want to try is simply loading less data into the chart (if this is possible) to see if that improves performance.
mstt  
#5 Posted : Friday, September 25, 2009 7:47:45 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)

Hi Data

I’ve never heard of ValueWhen() slowing MetaStock down but I certainly know about PREV having that effect. The P variable (INDICATOR is it’s other name) also apparently causes explorations to slow. Well, actually it might not be the P variable but just the fact that something on the active chart is highlighted.

I’ve discovered in a number of situations that ValueWhen() can be used to eliminate PREV without having any impact on the indicators result. If the code has more than one PREV then there is probably not going to be any possible solution down this road.

There is a simple trick that you can use with explorations to mitigate the effects of PREV. Limit the exploration to the minimum number of records – never use 10,000 when 500 will also give the correct result. (In this context “minimum records” does not mean using the Explorer Minimum Records setting.)

If you’re using the same PREV-based formula result in several columns then transferring the formula result to the GV DLL at the beginning of column A and then reading back from the DLL in subsequent columns should limit a PREV bottleneck.

Drop me a line if you need more specific help with this problem. I’ve been battling against PREV for a number of years now, so while I might not have a total solution I can probably come up with a few more ideas if I have more information. On the surface the ValueWhen() thing doesn’t make sense.

Roy

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.