Forum for TradeSim Users  

Go Back   Forum for TradeSim Users > Vitamin-C for MetaStock > Questions and Issues

Questions and Issues This is the place to post your comments if you have any questions or issues regarding Vitamin-C for MetaStock

Reply
 
Thread Tools Display Modes
  #1  
Old 11th June 2010, 01:21 PM
potili2 potili2 is offline
Junior Member
Site Admin
 
Join Date: May 2010
Posts: 3
Default can vitamin_c do that ?

Good morning
i have two questions about Vitamin_c

first one:
is it possible to obtain, as in metastock, the display of two different arrays with the same indicator?

second one:
is it possible to do in the same program something like that:

void indicator_one() //first indicator to display
for(int i=0;i<BarCount;i++)
{
...................
big process
...............
Result[i]=........
number_one=...
}


void indicator_two() //second indicator to display
for(int i=0;i<BarCount;i++)
{
...................
other process
...............
Result[i]=........
if (number_one==...)
{
number_two=...
}
}


regards
Reply With Quote
  #2  
Old 12th June 2010, 10:57 AM
David Samborsky David Samborsky is online now
Administrator
Site Admin
 
Join Date: Jan 2003
Posts: 1,077
Default

It can't remember statically allocated variables between calls because each time a Vitamin-C function is called the Vitamin-C engine is reinitialized.

What you could do is combine everything in one function using a switch statement etc and depending on a certain constant value passed to the function different results are returned.

An example of this is the trailing stop indicator on page 60 of the User Manual which returns a band or trigger depending on the _mode parameter.
__________________
Compuvision Australia Pty Ltd.
Power Tools for Metastock users.
http://www.compuvision.com.au
Reply With Quote
  #3  
Old 13th June 2010, 03:51 AM
potili2 potili2 is offline
Junior Member
Site Admin
 
Join Date: May 2010
Posts: 3
Default

ok i see what you mean.

but you have not answer to my first question:
is it possible to return two different arrays with only one indicator?

regards
Reply With Quote
  #4  
Old 13th June 2010, 04:14 AM
David Samborsky David Samborsky is online now
Administrator
Site Admin
 
Join Date: Jan 2003
Posts: 1,077
Default

You can only return one array which is the predefined Result array.

To return more than one array you have to make multiple calls to return different arrays.

This would be no different than if you had of written an external DLL using the MDK.
__________________
Compuvision Australia Pty Ltd.
Power Tools for Metastock users.
http://www.compuvision.com.au
Reply With Quote
  #5  
Old 15th June 2010, 02:45 AM
potili2 potili2 is offline
Junior Member
Site Admin
 
Join Date: May 2010
Posts: 3
Default

ok, thank you for your explanations.
it would be nice if it was possible in a future version.
Actually, by example, if i want to display a indicator green if it is positif and red if it is negatif, it's a little pity to do two twice the same calculation.
regards
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:06 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright Compuvision Australia Pty Ltd, 2000-2009, All Rights Reserved